def __init__(self, auto_hide=True, mini_mode=False): super(VolumeSlider, self).__init__() self.volume_button = VolumeButton(auto_hide=auto_hide, mini_mode=mini_mode) Tooltip.custom(self.volume_button, self.get_tip_label).always_update(self.volume_button, True) self.volume_button.connect("volume-state-changed",self.__volume_changed) self.load_volume_config() Dispatcher.connect("volume", self.change_volume) self.add(self.volume_button)
def __init__(self, auto_hide=True, mini_mode=False): super(VolumeSlider, self).__init__() self.volume_button = VolumeButton(auto_hide=auto_hide, mini_mode=mini_mode) Tooltip.custom(self.volume_button, self.get_tip_label).always_update( self.volume_button, True) self.volume_button.connect("volume-state-changed", self.__volume_changed) self.load_volume_config() Dispatcher.connect("volume", self.change_volume) self.add(self.volume_button)
def __init__(self): super(VolumeSlider, self).__init__() self.volume_progressbar = VolumeButton(volume_y=2, scroll_bool=True) Tooltip.custom(self.volume_progressbar, self.get_tip_label).always_update(self.volume_progressbar, True) self.volume_progressbar.set_size_request(92, 30) self.volume_progressbar.connect("volume-state-changed",self.__volume_changed) save_volume = float(config.get("player","volume")) self.volume_progressbar.value = int(save_volume * 100) Dispatcher.connect("volume", self.change_volume) self.add(self.volume_progressbar) self.set_size_request(92, 17)
def __init__(self, init_index=0): super(ComboMenuButton, self).__init__() self.current_index = init_index self.current_status = "artist" self.set_spacing(0) self.msg_content = _("By Artist") self.list_button = ComboItem( (app_theme.get_pixbuf("combo/left_normal.png"), app_theme.get_pixbuf("combo/left_hover.png"), app_theme.get_pixbuf("combo/left_press.png")), (app_theme.get_pixbuf("combo/list_normal.png"), app_theme.get_pixbuf("combo/list_normal.png"), app_theme.get_pixbuf("combo/list_press.png")), 0, self.set_index, self.get_index) Tooltip.text(self.list_button, _("List view")) # draw left_button. self.left_button = gtk.Button() self.left_button = ComboItem( (app_theme.get_pixbuf("combo/left_normal.png"), app_theme.get_pixbuf("combo/left_hover.png"), app_theme.get_pixbuf("combo/left_press.png")), (app_theme.get_pixbuf("combo/artist_normal.png"), app_theme.get_pixbuf("combo/artist_normal.png"), app_theme.get_pixbuf("combo/artist_press.png")), 1, self.set_index, self.get_index) Tooltip.custom(self.left_button, self.get_msg_label).always_update( self.left_button, True) # draw right_button. self.right_button = ComboButton( (app_theme.get_pixbuf("combo/right_normal.png"), app_theme.get_pixbuf("combo/right_hover.png"), app_theme.get_pixbuf("combo/right_hover.png")), (app_theme.get_pixbuf("combo/triangle_normal.png"), app_theme.get_pixbuf("combo/triangle_normal.png"), app_theme.get_pixbuf("combo/triangle_press.png"))) # signals. self.left_button.connect("clicked", lambda w: self.emit_combo_signal()) self.right_button.connect("button-press-event", self.show_right_menu) self.list_button.connect("clicked", lambda w: self.emit_list_signal()) # pack combo_box = gtk.HBox() combo_box.pack_start(self.left_button) combo_box.pack_start(self.right_button) self.pack_start(self.list_button) self.pack_start(combo_box)
def __init__(self, init_index=0): super(ComboMenuButton, self).__init__() self.current_index = init_index self.current_status = "artist" self.set_spacing(0) self.msg_content = _("By artist") self.list_button = ComboItem( (app_theme.get_pixbuf("combo/left_normal.png"), app_theme.get_pixbuf("combo/left_hover.png"), app_theme.get_pixbuf("combo/left_press.png")), (app_theme.get_pixbuf("combo/list_normal.png"), app_theme.get_pixbuf("combo/list_normal.png"), app_theme.get_pixbuf("combo/list_press.png") ), 0, self.set_index, self.get_index) Tooltip.text(self.list_button, _("List view")) # draw left_button. self.left_button = gtk.Button() self.left_button = ComboItem( (app_theme.get_pixbuf("combo/left_normal.png"), app_theme.get_pixbuf("combo/left_hover.png"), app_theme.get_pixbuf("combo/left_press.png")), (app_theme.get_pixbuf("combo/artist_normal.png"), app_theme.get_pixbuf("combo/artist_normal.png"), app_theme.get_pixbuf("combo/artist_press.png") ), 1, self.set_index, self.get_index) Tooltip.custom(self.left_button, self.get_msg_label).always_update(self.left_button, True) # draw right_button. self.right_button = ComboButton( (app_theme.get_pixbuf("combo/right_normal.png"), app_theme.get_pixbuf("combo/right_hover.png"), app_theme.get_pixbuf("combo/right_hover.png")), (app_theme.get_pixbuf("combo/triangle_normal.png"), app_theme.get_pixbuf("combo/triangle_normal.png"), app_theme.get_pixbuf("combo/triangle_press.png") )) # signals. self.left_button.connect("clicked", lambda w: self.emit_combo_signal()) self.right_button.connect("button-press-event", self.show_right_menu) self.list_button.connect("clicked", lambda w: self.emit_list_signal()) # pack combo_box = gtk.HBox() combo_box.pack_start(self.left_button) combo_box.pack_start(self.right_button) self.pack_start(self.list_button) self.pack_start(combo_box)