Exemplo n.º 1
0
 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
Exemplo n.º 2
0
class PlayControlPanel(object):    
    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)
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
    # Set application default size.
    application.set_default_size(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT)

    # Set application icon.
    application.set_icon(ui_theme.get_pixbuf("icon.ico"))

    # 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)
Exemplo n.º 5
0
    tab_1_box = gtk.VBox()
    tab_2_box = gtk.VBox()
    tab_4_box = gtk.VBox()
    tab_5_box = gtk.VBox()

    notebook = Notebook([
        (app_theme.get_pixbuf("music.png"), "分类列表",
         lambda: switch_tab(notebook_box, tab_1_box)),
        (app_theme.get_pixbuf("web.png"), "网络浏览器",
         lambda: switch_tab(notebook_box, tab_2_box)),
        (app_theme.get_pixbuf("music.png"), "专辑封面",
         lambda: switch_tab(notebook_box, tab_4_box)),
        (app_theme.get_pixbuf("music.png"), "自定义控件",
         lambda: switch_tab(notebook_box, tab_5_box)),
    ])
    notebook_frame = HorizontalFrame(20)
    notebook_frame.add(notebook)
    slider = HSlider()
    notebook_c = gtk.VBox()
    notebook_c.pack_start(notebook_frame, False, False)
    notebook_c.pack_start(notebook_box, True, True)
    #application.main_box.pack_start(notebook_frame, False, False)

    slider.to_page_now(notebook_c)
    application.main_box.pack_start(slider, True, True)

    notebook_box.add(tab_1_box)

    # Add body box.
    body_box = gtk.HBox()
    horizontal_frame = HorizontalFrame()
Exemplo n.º 6
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
Exemplo n.º 7
0
if __name__ == "__main__":
    # Init application.
    application = Application("browser_demo")
    
    # Set application default size.
    application.set_default_size(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT)
    
    # Set application icon.
    application.set_icon(ui_theme.get_pixbuf("icon.ico"))
    
    # Add titlebar.
    application.add_titlebar(
        ["theme", "menu", "max", "min", "close"], 
        ui_theme.get_pixbuf("title.png"), 
        "深度图形库",
        "/home/andy/deepin-ui/browser_demo.py")
    
    # Add browser.
    horizontal_frame = HorizontalFrame()
    browser_client = BrowserClient(
        "http://ting.baidu.com",
        "/home/andy/cookie.txt",
        application.app_bus_name,
        application.app_dbus_name,
        )
    horizontal_frame.add(browser_client)
    application.main_box.pack_start(horizontal_frame)
    
    # Run.
    application.run()
Exemplo n.º 8
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
Exemplo n.º 9
0
 application.set_default_size(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT)
 
 # Set application icon.
 application.set_icon(ui_theme.get_pixbuf("icon.ico"))
 
 # 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)
 
Exemplo n.º 10
0
 application.window.add_move_event(navigatebar)
 application.window.add_toggle_event(navigatebar)
 
 notebook_box = gtk.VBox()
 tab_1_box = gtk.VBox()
 tab_2_box = gtk.VBox()
 tab_4_box = gtk.VBox()
 tab_5_box = gtk.VBox()
 
 notebook = Notebook(
     [(app_theme.get_pixbuf("music.png"), "分类列表", lambda : switch_tab(notebook_box, tab_1_box)),
      (app_theme.get_pixbuf("web.png"), "网络浏览器", lambda : switch_tab(notebook_box, tab_2_box)),
      (app_theme.get_pixbuf("music.png"), "专辑封面", lambda : switch_tab(notebook_box, tab_4_box)),
      (app_theme.get_pixbuf("music.png"), "自定义控件", lambda : switch_tab(notebook_box, tab_5_box)),
      ])
 notebook_frame = HorizontalFrame(20)
 notebook_frame.add(notebook)
 application.main_box.pack_start(notebook_frame, False, False)
 
 application.main_box.pack_start(notebook_box, True, True)
 
 notebook_box.add(tab_1_box)
 
 # Add body box.
 body_box = gtk.HBox()
 horizontal_frame = HorizontalFrame()
 horizontal_frame.add(body_box)
 tab_1_box.pack_start(horizontal_frame, True, True)
 
 # Add categorybar.
 # Note if you add list in categorybar make sure height is multiples of list length.
Exemplo n.º 11
0
from dtk.ui.theme import ui_theme

if __name__ == "__main__":
    # Init application.
    application = Application("browser_demo")

    # Set application default size.
    application.set_default_size(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT)

    # Set application icon.
    application.set_icon(ui_theme.get_pixbuf("icon.ico"))

    # Add titlebar.
    application.add_titlebar(["theme", "menu", "max", "min", "close"],
                             ui_theme.get_pixbuf("title.png"), "深度图形库",
                             "/home/andy/deepin-ui/browser_demo.py")

    # Add browser.
    horizontal_frame = HorizontalFrame()
    browser_client = BrowserClient(
        "http://ting.baidu.com",
        "/home/andy/cookie.txt",
        application.app_bus_name,
        application.app_dbus_name,
    )
    horizontal_frame.add(browser_client)
    application.main_box.pack_start(horizontal_frame)

    # Run.
    application.run()
Exemplo n.º 12
0
    def __init__(self, type_bottom_check=True):
        type_bottom_check = type_bottom_check
        self.vbox = gtk.VBox()

        self.hbox = gtk.HBox()
        #
        self.pb_hbox = gtk.HBox()
        self.pb_hbox_ali = gtk.Alignment(0, 0, 1, 1)
        self.pb_hbox_ali.set_padding(0, 0, 2, 2)
        self.pb_fseek_btn = SeekButton(type="fseek")
        self.pb_bseek_btn = SeekButton(type="bseek")
        self.progressbar_ali = gtk.Alignment(0, 0, 1, 1)
        self.progressbar_ali.set_padding(0, 0, 3, 3)
        self.progressbar = ProgressBar()
        self.progressbar_ali.add(self.progressbar)
        self.pb_hbox.pack_start(self.pb_bseek_btn, False, False)
        self.pb_hbox.pack_start(self.progressbar_ali, True, True)
        self.pb_hbox.pack_start(self.pb_fseek_btn, False, False)
        self.pb_hbox_ali.add(self.pb_hbox)
        #self.progressbar.set_sensitive(False)
        # hbox add child widget.
        self.show_time_hframe = HorizontalFrame()
        self.show_time = ShowTime()
        self.show_time.time_font1 = "00:00:00"
        self.show_time.time_font2 = "00:00:00 / "
        self.show_time.set_time_font(self.show_time.time_font2,
                                     self.show_time.time_font1)
        self.show_time_hframe.add(self.show_time.time_box)
        show_time_padding_widht = 110
        show_time_padding_height = -1
        self.show_time.time_box.set_size_request(show_time_padding_widht,
                                                 show_time_padding_height)
        self.show_time_hframe.set(0, 0, 1, 1)
        self.show_time_hframe.set_padding(2, 0, 10, 20)

        self.play_control_panel = PlayControlPanel()
        self.play_control_panel_hframe = self.play_control_panel.hbox_hframe
        self.play_control_panel_hframe.set(0, 0, 0, 0)
        self.play_control_panel_hframe.set_padding(0, 0, 0, 0)
        if not type_bottom_check:
            self.play_control_panel_hframe.set(0.5, 0, 1.0, 0)
            self.play_control_panel_hframe.set_padding(3, 0, 0, 0)

        self.volume_hframe = HorizontalFrame()
        self.volume_button = VolumeButton()
        self.volume_hframe.add(self.volume_button)
        self.volume_hframe.set(0.5, 0.5, 0, 0)
        self.volume_hframe.set_padding(0, 0, 0, 10)

        self.hbox.pack_start(self.show_time_hframe, True, True)
        self.hbox.pack_start(self.play_control_panel.hbox_hframe, True, True)
        if not type_bottom_check:  # 骰子.
            pass
        self.hbox.pack_start(self.volume_hframe, False, False)
        if not type_bottom_check:  # 播放列表控制.
            self.play_list_btn_ali = gtk.Alignment(0.7, 0.45, 0, 0)
            self.play_list_btn_ali.set_padding(0, 0, 0, 20)
            self.play_list_btn = PlayListButton()
            self.play_list_btn_ali.add(self.play_list_btn.button)
            self.hbox.pack_start(self.play_list_btn_ali, False, False)
        label = gtk.Label()
        label.set_size_request(10, 1)
        self.hbox.pack_start(label, False, False)
        self.vbox.pack_start(self.pb_hbox_ali, False, False)
        self.vbox.pack_start(self.hbox, True, True)
Exemplo n.º 13
0
 def __init__(self, type_bottom_check=True):
     type_bottom_check = type_bottom_check
     self.vbox = gtk.VBox()
     
     self.hbox = gtk.HBox()
     #
     self.pb_hbox = gtk.HBox()
     self.pb_hbox_ali = gtk.Alignment(0, 0, 1, 1)
     self.pb_hbox_ali.set_padding(0, 0, 2, 2)
     self.pb_fseek_btn = SeekButton(type="fseek")
     self.pb_bseek_btn = SeekButton(type="bseek")
     self.progressbar_ali = gtk.Alignment(0, 0, 1, 1)
     self.progressbar_ali.set_padding(0, 0, 3, 3)
     self.progressbar = ProgressBar()
     self.progressbar_ali.add(self.progressbar)
     self.pb_hbox.pack_start(self.pb_bseek_btn, False, False)
     self.pb_hbox.pack_start(self.progressbar_ali, True, True)
     self.pb_hbox.pack_start(self.pb_fseek_btn, False, False)
     self.pb_hbox_ali.add(self.pb_hbox)
     #self.progressbar.set_sensitive(False)
     # hbox add child widget.
     self.show_time_hframe = HorizontalFrame()
     self.show_time = ShowTime()
     self.show_time.time_font1 = "00:00:00"
     self.show_time.time_font2 = "00:00:00 / "
     self.show_time.set_time_font(self.show_time.time_font2, self.show_time.time_font1)
     self.show_time_hframe.add(self.show_time.time_box)
     show_time_padding_widht = 110
     show_time_padding_height = -1
     self.show_time.time_box.set_size_request(
         show_time_padding_widht, 
         show_time_padding_height
         )
     self.show_time_hframe.set(0, 0, 1, 1)
     self.show_time_hframe.set_padding(2, 0, 10, 20)
     
     self.play_control_panel = PlayControlPanel()      
     self.play_control_panel_hframe = self.play_control_panel.hbox_hframe
     self.play_control_panel_hframe.set(0, 0, 0, 0)
     self.play_control_panel_hframe.set_padding(0, 0, 0, 0)
     if not type_bottom_check: 
         self.play_control_panel_hframe.set(0.5, 0, 1.0, 0)
         self.play_control_panel_hframe.set_padding(3, 0, 0, 0)
     
     self.volume_hframe = HorizontalFrame()
     self.volume_button = VolumeButton()
     self.volume_hframe.add(self.volume_button)
     self.volume_hframe.set(0.5, 0.5, 0, 0)
     self.volume_hframe.set_padding(0, 0, 0, 10)
     
     
     self.hbox.pack_start(self.show_time_hframe, True, True)
     self.hbox.pack_start(self.play_control_panel.hbox_hframe, True, True)
     if not type_bottom_check: # 骰子.
         pass
     self.hbox.pack_start(self.volume_hframe, False, False)
     if not type_bottom_check: # 播放列表控制.
         self.play_list_btn_ali = gtk.Alignment(0.7, 0.45, 0, 0)
         self.play_list_btn_ali.set_padding(0, 0, 0, 20)
         self.play_list_btn = PlayListButton()
         self.play_list_btn_ali.add(self.play_list_btn.button)
         self.hbox.pack_start(self.play_list_btn_ali, False, False)
     label = gtk.Label()
     label.set_size_request(10, 1)
     self.hbox.pack_start(label, False, False)
     self.vbox.pack_start(self.pb_hbox_ali, False, False) 
     self.vbox.pack_start(self.hbox, True, True)