~macslow/notify-osd/urgency-display-bar

« back to all changes in this revision

Viewing changes to examples/icon-value.cs

  • Committer: Mirco Müller
  • Date: 2009-04-24 15:33:07 UTC
  • Revision ID: mirco.mueller@ubuntu.com-20090424153307-bby0abiavtpog6xa
under- and overshoot-effects for icon-value layout-case are now triggered for passed values -1 and 101, also updated examples and test-script to reflect this, fixes LP: #337820

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 
35
35
public class IconValue
36
36
{
 
37
        public static void pushNotification (String icon,
 
38
                                             int    val)
 
39
        {
 
40
                Notification n = new Notification ("Brightness", // for a11y-reasons supply something meaning full
 
41
                                                   "",           // this needs to be empty!
 
42
                                                   icon);
 
43
                n.AddHint ("value", val);
 
44
                n.AddHint ("x-canonical-private-synchronous", "");
 
45
                n.Show ();
 
46
                Mono.Unix.Native.Syscall.sleep (1);
 
47
        }
 
48
 
37
49
        public static void Main ()
38
50
        {
39
51
                // call this so we can savely use the m_capabilities array later
45
57
                // try the icon-value case, usually used for synchronous bubbles
46
58
                if (ExampleUtil.HasCap (ExampleUtil.Capability.CAP_SYNCHRONOUS))
47
59
                {
48
 
                        Notification n = new Notification ("Brightness", // for a11y-reasons supply something meaning full
49
 
                                                           "",           // this needs to be empty!
50
 
                                                           "notification-keyboard-brightness-high");
51
 
                        n.AddHint ("value", 95);
52
 
                        n.AddHint ("x-canonical-private-synchronous", "");
53
 
                        n.Show ();
 
60
                        pushNotification ("notification-keyboard-brightness-low",
 
61
                                          25);
 
62
 
 
63
                        pushNotification ("notification-keyboard-brightness-medium",
 
64
                                          50);
 
65
 
 
66
                        pushNotification ("notification-keyboard-brightness-high",
 
67
                                          75);
 
68
 
 
69
                        pushNotification ("notification-keyboard-brightness-full",
 
70
                                          100);
 
71
 
 
72
                        // trigger "overshoot"-effect
 
73
                        pushNotification ("notification-keyboard-brightness-full",
 
74
                                          101);
 
75
 
 
76
                        pushNotification ("notification-keyboard-brightness-high",
 
77
                                          75);
 
78
 
 
79
                        pushNotification ("notification-keyboard-brightness-medium",
 
80
                                          50);
 
81
 
 
82
                        pushNotification ("notification-keyboard-brightness-low",
 
83
                                          25);
 
84
 
 
85
                        pushNotification ("notification-keyboard-brightness-off",
 
86
                                          0);
 
87
 
 
88
                        // trigger "undershoot"-effect
 
89
                        pushNotification ("notification-keyboard-brightness-off",
 
90
                                          -1);
54
91
                }
55
92
                else
56
93
                        Console.WriteLine ("The daemon does not support the x-canonical-private-synchronous hint!");