~mefrio-g/+junk/pantheon-shutdown

« back to all changes in this revision

Viewing changes to src/MainWindow.vala

  • Committer: Mario Guerriero
  • Date: 2013-03-11 20:23:41 UTC
  • Revision ID: mefrio.g@gmail.com-20130311202341-zkph10y0x3gpjfwm
added a blue reboot blue button

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    
26
26
    const string STYLESHEET = 
27
27
    """
 
28
        .blue-button {
 
29
            -unico-inner-stroke-width: 1px 0 1px 0;
 
30
 
 
31
            background-image: -gtk-gradient (linear,
 
32
                            left top,
 
33
                            left bottom,
 
34
                            from (shade (@selected_bg_color, 1.30)),
 
35
                            to (shade (@selected_bg_color, 0.98)));
 
36
 
 
37
            -unico-border-gradient: -gtk-gradient (linear,
 
38
                            left top, left bottom,
 
39
                            from (shade (@selected_bg_color, 1.05)),
 
40
                            to (shade (@selected_bg_color, 0.88)));
 
41
 
 
42
            -unico-inner-stroke-gradient: -gtk-gradient (linear,
 
43
                            left top, left bottom,
 
44
                            from (alpha (#fff, 0.30)),
 
45
                            to (alpha (#fff, 0.06)));
 
46
        }
 
47
        
28
48
        .red-button {
29
49
            -unico-inner-stroke-width: 1px 0 1px 0;
30
50
            
64
84
            // Window properties
65
85
            set_keep_above (true);
66
86
            window_position = Gtk.WindowPosition.CENTER;
 
87
            has_focus = true;
67
88
            
68
89
            // Style context
69
90
            var style_context = new Gtk.CssProvider ();
112
133
                    image.pixel_size = 128;
113
134
                    window_box.pack_start (image, false, false, 0);
114
135
                }
 
136
                // Minimize all windows
 
137
                if (window.get_workspace () == workspace && (window.get_window_type () == Wnck.WindowType.NORMAL)
 
138
                    && (window.get_window_type () == Wnck.WindowType.NORMAL)) {
 
139
                    window.minimize ();
 
140
                }
115
141
            }
116
142
            
117
143
            // Shutdown buttons
125
151
            });
126
152
            bbox.add (cancel_button);
127
153
            
 
154
            var reboot_button = new Gtk.Button ();
 
155
            var reboot_label = new Gtk.Label ("");
 
156
            reboot_label.use_markup = true;
 
157
            reboot_label.set_markup ("<span foreground='white'>" + _("Reboot") + "</span>");
 
158
            reboot_button.add (reboot_label);
 
159
            //shutdown_button.use_
 
160
            reboot_button.get_style_context ().add_provider (style_context, Gtk.STYLE_PROVIDER_PRIORITY_THEME);
 
161
            reboot_button.get_style_context ().add_class ("blue-button");
 
162
            bbox.add (reboot_button);
 
163
            
128
164
            var shutdown_button = new Gtk.Button ();
129
165
            var shutdown_label = new Gtk.Label ("");
130
166
            shutdown_label.use_markup = true;