Exemplo n.º 1
0
    def create_menu_item(self, label, icon_name, comment):
        item = gtk.ImageMenuItem(label)
        item.set_use_underline(0)
        #~ item.props.always_show_image = True
            
        icon_pixbuf = Core.get_pixbuf_icon(icon_name)
        item.set_image(gtk.image_new_from_pixbuf(icon_pixbuf))

        return item
Exemplo n.º 2
0
    def create_menu_item(self, label, icon_name, comment):
        item = gtk.ImageMenuItem(label)

        if gtk.gtk_version >= (2, 16, 0):
            item.props.always_show_image = True
            
        icon_pixbuf = Core.get_pixbuf_icon(icon_name)
        item.set_image(gtk.image_new_from_pixbuf(icon_pixbuf))
        
        if comment is not None:
            item.set_tooltip_text(comment)
        return item
Exemplo n.º 3
0
 def create_session_button(self):
     for action in ('lockscreen', 'logout', 'reboot', 'shutdown', 'hibernate', 'suspend'):
         if not self.plugin.settings[action] == '':
             
             if self.plugin.settings['show_label']:
                 label = '<b>%s</b>\n<small>%s</small>' % (session[action][0], session[action][1])
                 pixbuf = Core.get_pixbuf_icon(session[action][2], self.plugin.settings['icon_size'])
                 if pixbuf == None:
                    pixbuf = Core.pixbuf_from_file('images/plugins/session/'+session[action][2]+'.png', self.plugin.settings['icon_size'], self.plugin.settings['icon_size'])
                 button = Core.image_button(label, pixbuf, self.plugin.settings['icon_size'])
             else:
                 button = gtk.Button()
                 button.set_relief(gtk.RELIEF_NONE)
                 img = gtk.Image()
                 pixbuf = Core.get_pixbuf_icon(session[action][2], self.plugin.settings['icon_size'])
                 if pixbuf == None:
                    pixbuf = Core.pixbuf_from_file('images/plugins/session/'+session[action][2]+'.png', self.plugin.settings['icon_size'], self.plugin.settings['icon_size'])
                 img.set_from_pixbuf(pixbuf)
                 button.add(img)
             button.connect("button-release-event", self.onClicked, self.plugin.settings[action])
             self.box.pack_start(button, False)
             self.buttons.append(button)
             
     self.box.show_all()
Exemplo n.º 4
0
    def create_session_button(self):
        for action in ('lockscreen', 'logout', 'reboot', 'shutdown',
                       'hibernate', 'suspend'):
            if not self.plugin.settings[action] == '':

                if self.plugin.settings['show_label']:
                    label = '<b>%s</b>\n<small>%s</small>' % (
                        session[action][0], session[action][1])
                    pixbuf = Core.get_pixbuf_icon(
                        session[action][2], self.plugin.settings['icon_size'])
                    if pixbuf == None:
                        pixbuf = Core.pixbuf_from_file(
                            'images/plugins/session/' + session[action][2] +
                            '.png', self.plugin.settings['icon_size'],
                            self.plugin.settings['icon_size'])
                    button = Core.image_button(
                        label, pixbuf, self.plugin.settings['icon_size'])
                else:
                    button = gtk.Button()
                    button.set_relief(gtk.RELIEF_NONE)
                    img = gtk.Image()
                    pixbuf = Core.get_pixbuf_icon(
                        session[action][2], self.plugin.settings['icon_size'])
                    if pixbuf == None:
                        pixbuf = Core.pixbuf_from_file(
                            'images/plugins/session/' + session[action][2] +
                            '.png', self.plugin.settings['icon_size'],
                            self.plugin.settings['icon_size'])
                    img.set_from_pixbuf(pixbuf)
                    button.add(img)
                button.connect("button-release-event", self.onClicked,
                               self.plugin.settings[action])
                self.box.pack_start(button, False)
                self.buttons.append(button)

        self.box.show_all()
Exemplo n.º 5
0
 def create_menu_item(self, name, icon):
     item = gtk.ImageMenuItem(name)
     icon_pixbuf = Core.get_pixbuf_icon(icon)
     item.set_image(gtk.image_new_from_pixbuf(icon_pixbuf))
     return item
Exemplo n.º 6
0
        adj = gtk.Adjustment(value=vol, lower=0, upper=100, step_incr=1, page_incr=5)

        self.scale = gtk.VScale(adjustment=adj)
        self.scale.set_size_request(30, 170)
        self.scale.set_inverted(True)
        self.scale.set_digits(0)
        self.scale.show()
        self.scale.connect("value_changed", self.on_value_changed)

        self.box = gtk.VBox(False, 4)
        self.box.set_border_width(2)

        mixer_bt = gtk.Button()
        image = gtk.Image()
        pixbuf = Core.get_pixbuf_icon("multimedia-volume-control", self.cfg["icon_size"])
        image.set_from_pixbuf(pixbuf)
        mixer_bt.set_image(image)
        mixer_bt.connect("clicked", self.onClicked)
        mixer_bt.set_relief(gtk.RELIEF_NONE)
        mixer_bt.set_border_width(0)
        mixer_bt.set_focus_on_click(False)
        mixer_bt.set_property("can-focus", False)
        mixer_bt.show()

        self.box.pack_start(self.scale)
        self.box.pack_end(mixer_bt)
        self.add(self.box)
        self.box.show()

        self.set_volume(vol)
Exemplo n.º 7
0
 def create_menu_item(self, name, icon):
     item = gtk.ImageMenuItem(name)
     icon_pixbuf = Core.get_pixbuf_icon(icon)
     item.set_image(gtk.image_new_from_pixbuf(icon_pixbuf))
     return item
Exemplo n.º 8
0
                             step_incr=1,
                             page_incr=5)

        self.scale = gtk.VScale(adjustment=adj)
        self.scale.set_size_request(30, 170)
        self.scale.set_inverted(True)
        self.scale.set_digits(0)
        self.scale.show()
        self.scale.connect("value_changed", self.on_value_changed)

        self.box = gtk.VBox(False, 4)
        self.box.set_border_width(2)

        mixer_bt = gtk.Button()
        image = gtk.Image()
        pixbuf = Core.get_pixbuf_icon('multimedia-volume-control',
                                      self.cfg['icon_size'])
        image.set_from_pixbuf(pixbuf)
        mixer_bt.set_image(image)
        mixer_bt.connect("clicked", self.onClicked)
        mixer_bt.set_relief(gtk.RELIEF_NONE)
        mixer_bt.set_border_width(0)
        mixer_bt.set_focus_on_click(False)
        mixer_bt.set_property('can-focus', False)
        mixer_bt.show()

        self.box.pack_start(self.scale)
        self.box.pack_end(mixer_bt)
        self.add(self.box)
        self.box.show()

        self.set_volume(vol)
Exemplo n.º 9
0
        adj = gtk.Adjustment(value=vol, lower=0, upper=100, step_incr=1, page_incr=5)

        self.scale = gtk.VScale(adjustment=adj)
        self.scale.set_size_request(30, 170)
        self.scale.set_inverted(True)
        self.scale.set_digits(0)
        self.scale.show()
        self.scale.connect("value_changed", self.on_value_changed)

        self.box = gtk.VBox(False, 4)
        self.box.set_border_width(2)

        mixer_bt = gtk.Button()
        image =  gtk.Image()
        pixbuf = Core.get_pixbuf_icon('multimedia-volume-control', self.cfg['icon_size'])
        image.set_from_pixbuf(pixbuf)
        mixer_bt.set_image(image)
        mixer_bt.connect("clicked", self.onClicked)
        mixer_bt.set_relief(gtk.RELIEF_NONE)
        mixer_bt.set_border_width(0)
        mixer_bt.set_focus_on_click(False)
        mixer_bt.set_property('can-focus', False)
        mixer_bt.show()

        self.box.pack_start(self.scale)
        self.box.pack_end(mixer_bt)
        self.add(self.box)
        self.box.show()
        
        self.set_volume(vol)