def __init__(self): self.button = ToggleButton( app_theme.get_pixbuf("bottom_buttons/play_list_button.png"), app_theme.get_pixbuf("bottom_buttons/list_button_background.png"), ) self.button.set_active(False) tooltip_text(self.button, _("Playlist"))
def __init__( self, tip_text=None, menu=None, top_menu_normal=app_theme.get_pixbuf("top_menu/normal.png"), top_menu_prelight=app_theme.get_pixbuf("top_menu/prelight.png"), top_menu_press=app_theme.get_pixbuf("top_menu/press.png")): gtk.Button.__init__(self) # set topmenu tooltip. if tip_text: tooltip_text(self, tip_text) self.top_menu_normal = top_menu_normal self.top_menu_prelight = top_menu_prelight self.top_menu_press = top_menu_press self.top_menu_pixbuf_width = 40 self.top_menu_pixbuf_height = 40 self.menu = menu self.menu_show = False # set topmenu size. self.set_size_request(self.top_menu_pixbuf_width, self.top_menu_pixbuf_height) # Init events. self.connect("expose-event", self.expose_topmenu) self.connect("button-press-event", self.button_press_topmenu) self.connect("button-release-event", self.button_release_topmenu) self.connect("leave-notify-event", self.leave_notify_topmenu)
def __init__(self, tip_text=None, menu=None, top_menu_normal = app_theme.get_pixbuf("top_menu/normal.png"), top_menu_prelight = app_theme.get_pixbuf("top_menu/prelight.png"), top_menu_press = app_theme.get_pixbuf("top_menu/press.png") ): gtk.Button.__init__(self) # set topmenu tooltip. if tip_text: tooltip_text(self, tip_text) self.top_menu_normal = top_menu_normal self.top_menu_prelight = top_menu_prelight self.top_menu_press = top_menu_press self.top_menu_pixbuf_width = 40 self.top_menu_pixbuf_height = 40 self.menu = menu self.menu_show = False # set topmenu size. self.set_size_request( self.top_menu_pixbuf_width, self.top_menu_pixbuf_height) # Init events. self.connect("expose-event", self.expose_topmenu) self.connect("button-press-event", self.button_press_topmenu) self.connect("button-release-event", self.button_release_topmenu) self.connect("leave-notify-event", self.leave_notify_topmenu)
def set_event_value(self, widget, event): rect = widget.allocation value = event.x / (float(rect.width) / self.max_value) self.value = max(min(value, self.max_value), self.min_value) # 添加提示信息. tooltip_text(widget, str(int(self.value))) self.mute_check = False self.queue_draw()
def __init__(self): self.input_string = "play_control_panel: " self.hbox_hframe = HorizontalFrame() self.hbox = gtk.HBox() self.hbox_hframe.add(self.hbox) self.stop_button = StartButton(app_theme.get_pixbuf("bottom_buttons/stop_normal.png"), app_theme.get_pixbuf("bottom_buttons/stop_hover.png"), app_theme.get_pixbuf("bottom_buttons/stop_press.png"), app_theme.get_pixbuf("bottom_buttons/stop_normal.png"), app_theme.get_pixbuf("bottom_buttons/stop_hover.png"), app_theme.get_pixbuf("bottom_buttons/stop_press.png") ) tooltip_text(self.stop_button, _("Stop")) self.pre_button = StartButton(app_theme.get_pixbuf("bottom_buttons/pre_button_normal.png"), app_theme.get_pixbuf("bottom_buttons/pre_button_hover.png"), app_theme.get_pixbuf("bottom_buttons/pre_button_press.png"), app_theme.get_pixbuf("bottom_buttons/pre_button_normal.png"), app_theme.get_pixbuf("bottom_buttons/pre_button_hover.png"), app_theme.get_pixbuf("bottom_buttons/pre_button_press.png")) tooltip_text(self.pre_button, _("Previous")) self.start_button = StartButton(image_y_padding=1) tooltip_text(self.start_button, _("Play")) self.next_button = StartButton(app_theme.get_pixbuf("bottom_buttons/next_button_normal.png"), app_theme.get_pixbuf("bottom_buttons/next_button_hover.png"), app_theme.get_pixbuf("bottom_buttons/next_button_press.png"), app_theme.get_pixbuf("bottom_buttons/next_button_normal.png"), app_theme.get_pixbuf("bottom_buttons/next_button_hover.png"), app_theme.get_pixbuf("bottom_buttons/next_button_press.png")) tooltip_text(self.next_button, _("Next")) self.open_button = StartButton(app_theme.get_pixbuf("bottom_buttons/open_normal.png"), app_theme.get_pixbuf("bottom_buttons/open_hover.png"), app_theme.get_pixbuf("bottom_buttons/open_press.png"), app_theme.get_pixbuf("bottom_buttons/open_normal.png"), app_theme.get_pixbuf("bottom_buttons/open_hover.png"), app_theme.get_pixbuf("bottom_buttons/open_press.png")) tooltip_text(self.open_button, _("Open File")) self.hbox.pack_start(self.stop_button, False, False) self.hbox.pack_start(self.pre_button, False, False) self.hbox.pack_start(self.start_button, False, False) self.hbox.pack_start(self.next_button, False, False) self.hbox.pack_start(self.open_button, False, False)
def __init__(self): self.opacity = 0.0 self.show = False self.hbox = gtk.HBox() self.default_opacity = 0.9 self.toolbar_radio_button = ToolbarRadioButton(None, [None, None]) # full buton. self.toolbar_full_hframe = self.toolbar_radio_button.full_button_align self.toolbar_full_button = self.toolbar_radio_button.full_button # self.toolbar_common_hframe = self.toolbar_radio_button.win_mode_button_align self.toolbar_common_button = self.toolbar_radio_button.win_mode_button # self.toolbar_concise_hframe = self.toolbar_radio_button.concise_button_align self.toolbar_concise_button = self.toolbar_radio_button.concise_button # 1X conect-> self.set_2x_video_play self.toolbar_1X_hframe = HorizontalFrame(5) self.toolbar_1X_button = ToggleHoverButton(None, [None, None], app_theme.get_pixbuf("top_toolbar/1_window_normal.png"), app_theme.get_pixbuf("top_toolbar/1_window_hover.png"), app_theme.get_pixbuf("top_toolbar/1_window_normal.png"), app_theme.get_pixbuf("top_toolbar/1_window_hover.png"), ) tooltip_text(self.toolbar_1X_button, _("100%")) self.toolbar_1X_hframe.add(self.toolbar_1X_button) # 2X conect-> self.set_2x_video_play self.toolbar_2X_hframe = HorizontalFrame(5) self.toolbar_2X_button = ToggleHoverButton(None, [None, None], app_theme.get_pixbuf("top_toolbar/2_window_normal.png"), app_theme.get_pixbuf("top_toolbar/2_window_hover.png"), app_theme.get_pixbuf("top_toolbar/2_window_normal.png"), app_theme.get_pixbuf("top_toolbar/2_window_hover.png"), ) tooltip_text(self.toolbar_2X_button, _("200%")) self.toolbar_2X_hframe.add(self.toolbar_2X_button) self.toolbar_above_hframe = HorizontalFrame(5) self.toolbar_above_button = ToggleHoverButton(None, [None, None]) tooltip_text(self.toolbar_above_button, _("Always on Top")) self.toolbar_above_hframe.add(self.toolbar_above_button) self.hbox.pack_start(self.toolbar_radio_button, False, False) self.hbox.pack_start(self.toolbar_1X_hframe, False, False) self.hbox.pack_start(self.toolbar_2X_hframe, False, False) self.hbox.pack_start(self.toolbar_above_hframe, False, False) # above_button self.hbox_hframe = VerticalFrame(padding=4) self.hbox_hframe.add(self.hbox) self.show_time_id = None
def __init__(self): self.opacity = 0.0 self.show = False self.hbox = gtk.HBox() self.default_opacity = 0.9 self.toolbar_radio_button = ToolbarRadioButton(None, [None, None]) # full buton. self.toolbar_full_hframe = self.toolbar_radio_button.full_button_align self.toolbar_full_button = self.toolbar_radio_button.full_button # self.toolbar_common_hframe = self.toolbar_radio_button.win_mode_button_align self.toolbar_common_button = self.toolbar_radio_button.win_mode_button # self.toolbar_concise_hframe = self.toolbar_radio_button.concise_button_align self.toolbar_concise_button = self.toolbar_radio_button.concise_button # 1X conect-> self.set_2x_video_play self.toolbar_1X_hframe = HorizontalFrame(5) self.toolbar_1X_button = ToggleHoverButton(None, [None, None], app_theme.get_pixbuf("top_toolbar/1_window_normal.png"), app_theme.get_pixbuf("top_toolbar/1_window_hover.png"), app_theme.get_pixbuf("top_toolbar/1_window_normal.png"), app_theme.get_pixbuf("top_toolbar/1_window_hover.png"), ) tooltip_text(self.toolbar_1X_button, _("100%")) self.toolbar_1X_hframe.add(self.toolbar_1X_button) # 2X conect-> self.set_2x_video_play 显示是 1.5倍. self.toolbar_2X_hframe = HorizontalFrame(5) self.toolbar_2X_button = ToggleHoverButton(None, [None, None], app_theme.get_pixbuf("top_toolbar/2_window_normal.png"), app_theme.get_pixbuf("top_toolbar/2_window_hover.png"), app_theme.get_pixbuf("top_toolbar/2_window_normal.png"), app_theme.get_pixbuf("top_toolbar/2_window_hover.png"), ) tooltip_text(self.toolbar_2X_button, _("150%")) self.toolbar_2X_hframe.add(self.toolbar_2X_button) self.toolbar_above_hframe = HorizontalFrame(5) self.toolbar_above_button = ToggleHoverButton(None, [None, None]) tooltip_text(self.toolbar_above_button, _("Always on Top")) self.toolbar_above_hframe.add(self.toolbar_above_button) self.hbox.pack_start(self.toolbar_radio_button, False, False) self.hbox.pack_start(self.toolbar_1X_hframe, False, False) self.hbox.pack_start(self.toolbar_2X_hframe, False, False) self.hbox.pack_start(self.toolbar_above_hframe, False, False) # above_button self.hbox_hframe = VerticalFrame(padding=4) self.hbox_hframe.add(self.hbox) self.show_time_id = None
def __init__(self, connect_function, argv, ############## full_normal_pixbuf = app_theme.get_pixbuf("top_toolbar/full_window_normal.png"), full_hover_pixbuf = app_theme.get_pixbuf("top_toolbar/full_window_hover.png"), ########################## window_mode_normal_pixbuf = app_theme.get_pixbuf("top_toolbar/window_mode_normal.png"), window_mode_hover_pixbuf = app_theme.get_pixbuf("top_toolbar/window_mode_hover.png"), ########################################### concise_normal_pixbuf = app_theme.get_pixbuf("top_toolbar/concise_window_normal.png"), concise_hover_pixbuf = app_theme.get_pixbuf("top_toolbar/concise_hover.png") ): gtk.HBox.__init__(self) self.connect_function = connect_function self.argv = argv # Init pixbuf. self.full_normal_pixbuf = full_normal_pixbuf self.full_hover_pixbuf = full_hover_pixbuf self.window_mode_normal_pixbuf = window_mode_normal_pixbuf self.window_mode_hover_pixbuf = window_mode_hover_pixbuf self.concise_normal_pixbuf = concise_normal_pixbuf self.concise_hover_pixbuf = concise_hover_pixbuf # Init value. self.window_state = 0 # 0-> window mode state; 1-> concise state. self.full_state = 1 # 0-> quit full state; 1-> full state. # Init buttons. self.full_button_align = gtk.Alignment() self.full_button_align.set_padding(0, 0, 5, 5) self.full_button = gtk.Button() self.full_button_align.add(self.full_button) tooltip_text(self.full_button, _("Full Screen")) self.full_button.add_events(gtk.gdk.ALL_EVENTS_MASK) self.full_button.connect("expose-event", self.expose_draw_full_button) self.full_button.connect("motion-notify-event", self.show_toolbar) self.win_mode_button_align = gtk.Alignment() self.win_mode_button_align.set_padding(0, 0, 5, 5) self.win_mode_button = gtk.Button() self.win_mode_button_align.add(self.win_mode_button) tooltip_text(self.win_mode_button, _("Normal Mode")) self.win_mode_button.add_events(gtk.gdk.ALL_EVENTS_MASK) self.win_mode_button.connect("expose-event", self.expose_draw_win_mode_button) self.win_mode_button.connect("motion-notify-event", self.show_toolbar) self.concise_button_align = gtk.Alignment() self.concise_button_align.set_padding(0, 0, 5, 5) self.concise_button = gtk.Button() self.concise_button_align.add(self.concise_button) tooltip_text(self.concise_button, _("Compact Mode")) self.concise_button.add_events(gtk.gdk.ALL_EVENTS_MASK) self.concise_button.connect("expose-event", self.expose_draw_concise_button) self.concise_button.connect("motion-notify-event", self.show_toolbar) # add buttons. self.pack_start(self.full_button_align, False, False) self.pack_start(self.win_mode_button_align, False, False) self.pack_start(self.concise_button_align, False, False) self.show_all()