コード例 #1
0
    # Add titlebar.
    application.add_titlebar(["theme", "menu", "max", "min", "close"],
                             ui_theme.get_pixbuf("title.png"), "电影播放器",
                             "深度Linux视频演示")

    # Add mplayer view.
    mplayer_view = MplayerView()
    mplayer_view.connect("get-xid", show_video)
    mplayer_frame = HorizontalFrame()
    mplayer_frame.add(mplayer_view)

    main_box = gtk.VBox()
    main_box.pack_start(mplayer_frame)

    main_frame = VerticalFrame()
    main_frame.add(main_box)
    application.main_box.pack_start(main_frame)

    # Add statusbar.
    statusbar = Statusbar(36)
    main_box.pack_start(statusbar, False)
    application.window.add_move_event(statusbar)
    application.window.add_toggle_event(statusbar)

    # Add drag bar.
    Dragbar(application.window, statusbar)

    # Run.
    application.run()
コード例 #2
0
class ToolBar(object):
    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 focus_hide_toolbar(self, widget, event):
        pass
        
    def show_time(self):        
        pass
        
    def show_panel_toolbar(self, widget, event):    
        self.show = False
        if self.show_time_id:
            gtk.timeout_remove(self.show_time_id)
        
    def hide_panel_toolbar(self, widget, event):            
        self.show = True
        self.show_time_id = gtk.timeout_add(1000, self.hide_toolbar_time)
        
    def hide_toolbar_time(self):    
        self.hide_toolbar()
        return False
        
    def show_toolbar(self):   
        if not self.show:
            gtk.timeout_add(50, self.show_time)
            self.show = True
            
    def hide_toolbar(self):    
        if self.show:
            self.show = False
コード例 #3
0
class ToolBar(object):
    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 focus_hide_toolbar(self, widget, event):
        pass
        
    def show_time(self):        
        pass
        
    def show_panel_toolbar(self, widget, event):    
        self.show = False
        if self.show_time_id:
            gtk.timeout_remove(self.show_time_id)
        
    def hide_panel_toolbar(self, widget, event):            
        self.show = True
        self.show_time_id = gtk.timeout_add(1000, self.hide_toolbar_time)
        
    def hide_toolbar_time(self):    
        self.hide_toolbar()
        return False
        
    def show_toolbar(self):   
        if not self.show:
            gtk.timeout_add(50, self.show_time)
            self.show = True
            
    def hide_toolbar(self):    
        if self.show:
            self.show = False
コード例 #4
0
ファイル: mplayer_demo.py プロジェクト: Jiarui315/deepin-ui
    application.add_titlebar(
        ["theme", "menu", "max", "min", "close"], 
        ui_theme.get_pixbuf("title.png"), 
        "电影播放器",
        "深度Linux视频演示")
    
    # Add mplayer view.
    mplayer_view = MplayerView()
    mplayer_view.connect("get-xid", show_video)
    mplayer_frame = HorizontalFrame()
    mplayer_frame.add(mplayer_view)
    
    main_box = gtk.VBox()
    main_box.pack_start(mplayer_frame)
    
    main_frame = VerticalFrame()
    main_frame.add(main_box)
    application.main_box.pack_start(main_frame)
    
    # Add statusbar.
    statusbar = Statusbar(36)
    main_box.pack_start(statusbar, False)
    application.window.add_move_event(statusbar)
    application.window.add_toggle_event(statusbar)
    
    # Add drag bar.
    Dragbar(application.window, statusbar)
    
    # Run.
    application.run()