示例#1
0
 def get_hbox_for(self, info):
     hbox = widgetset.HBox()
     hbox.pack_start(self.get_label_for(info.name))
     button = imagebutton.ImageButton('guide-sidebar-play')
     button.connect('clicked', self.on_play_clicked, info)
     hbox.pack_end(button)
     return hbox
示例#2
0
    def __init__(self):
        style.LowerBox.__init__(self)
        self.controls = PlaybackControls()
        self.timeline = ProgressTimeline()
        app.playback_manager.connect('will-start', self.on_playback_started)
        app.playback_manager.connect('did-stop', self.on_playback_stopped)
        app.playback_manager.connect('selecting-file', self.on_file_selected)
        self.timeline.info.connect('clicked', self.on_title_clicked)
        self.playback_mode = PlaybackModeControls()
        self.volume_muter = imagebutton.ImageButton('volume')
        self.volume_muter.set_can_focus(False)
        self.volume_slider = VolumeSlider()
        self.time_slider = self.timeline.slider

        hbox = widgetset.HBox(spacing=20)
        hbox.pack_start(self.controls, expand=False)
        hbox.pack_start(widgetutil.align_middle(self.timeline), expand=True)
        volume_hbox = widgetset.HBox(spacing=4)
        volume_hbox.pack_start(widgetutil.align_middle(self.volume_muter))
        volume_hbox.pack_start(widgetutil.align_middle(self.volume_slider))
        hbox.pack_start(volume_hbox)
        hbox.pack_start(self.playback_mode)

        vbox = widgetset.VBox()
        hline = separator.HSeparator(widgetutil.BLACK)
        vbox.pack_start(hline)
        vbox.pack_start(widgetutil.align_middle(hbox, 0, 0, 25, 25),
                        expand=True)

        self.add(vbox)

        self.selected_tab_list = self.selected_tabs = None
        self.selected_file = None
示例#3
0
 def make_button(self, name, continous):
     if continous:
         button = imagebutton.ContinuousImageButton(name)
         button.set_delays(0.6, 0.3)
     else:
         button = imagebutton.ImageButton(name)
     button.set_can_focus(False)
     button.disable()
     return button
示例#4
0
    def __init__(self):
        widgetset.Background.__init__(self)

        vbox = widgetset.VBox()
        # first line: sync progess and cancel button
        line = widgetset.HBox()
        self.sync_progress = SyncProgressBar()
        self.sync_progress.set_size_request(400, 10)
        self.cancel_button = imagebutton.ImageButton('sync-cancel')
        line.pack_start(widgetutil.pad(self.sync_progress, 10, 10, 5, 5))
        line.pack_end(widgetutil.pad(self.cancel_button, 5, 5, 5, 5))
        vbox.pack_start(line)

        # second line: time remaining, all the way to the right
        line = widgetset.HBox()
        self.sync_files = widgetset.Label(u"")
        self.sync_remaining = widgetset.Label(u"")
        self.sync_remaining.set_bold(True)
        line.pack_start(widgetutil.align_left(self.sync_files, 5, 5, 5, 5))
        line.pack_end(widgetutil.align_right(self.sync_remaining, 5, 5, 5, 5))
        vbox.pack_start(line)

        self.add(widgetutil.pad(vbox, 10, 10, 10, 10))
示例#5
0
文件: browser.py 项目: kmshi/miro
    def __init__(self):
        itemlistwidgets.Titlebar.__init__(self)

        hbox = widgetset.HBox()
        self.add(hbox)

        self.create_signal('browser-reload')
        self.create_signal('browser-back')
        self.create_signal('browser-forward')
        self.create_signal('browser-stop')
        self.create_signal('browser-home')
        self.create_signal('address-entered')
        self.create_signal('browser-download')
        self.create_signal('browser-open')

        self.back_button = imagebutton.ImageButton('navback')
        self.back_button.set_squish_width(True)
        self.back_button.connect('clicked', self._on_back_button_clicked)
        self.back_button.disable()
        hbox.pack_start(widgetutil.align_middle(self.back_button, left_pad=10))

        nav_separator = widgetset.ImageDisplay(
            imagepool.get(resources.path('images/navseparator.png')))
        hbox.pack_start(widgetutil.align_middle(nav_separator))

        self.forward_button = imagebutton.ImageButton('navforward')
        self.forward_button.set_squish_width(True)
        self.forward_button.connect('clicked', self._on_forward_button_clicked)
        self.forward_button.disable()
        hbox.pack_start(widgetutil.align_middle(self.forward_button))

        self.reload_button = imagebutton.ImageButton('navreload')
        self.reload_button.connect('clicked', self._on_reload_button_clicked)
        hbox.pack_start(widgetutil.align_middle(self.reload_button,
                                                left_pad=4))

        self.stop_button = imagebutton.ImageButton('navstop')
        self.stop_button.connect('clicked', self._on_stop_button_clicked)
        hbox.pack_start(widgetutil.align_middle(self.stop_button, left_pad=4))

        self.home_button = imagebutton.ImageButton('navhome')
        self.home_button.connect('clicked', self._on_home_button_clicked)
        hbox.pack_start(widgetutil.align_middle(self.home_button, left_pad=4))

        self.browser_open_button = widgetutil.TitlebarButton(
            _('Open in browser'), 'navopen')
        self.browser_open_button.connect('clicked',
                                         self._on_browser_open_activate)
        hbox.pack_end(
            widgetutil.align_middle(self.browser_open_button, right_pad=10))

        self.download_button = widgetutil.TitlebarButton(
            _("Download this video"), 'navdownload')
        self.download_button.connect('clicked',
                                     self._on_download_button_clicked)
        self.download_button = widgetutil.HideableWidget(self.download_button)
        hbox.pack_end(
            widgetutil.align_middle(self.download_button, right_pad=4))

        self.loading_icon = BrowserLoadingImage()
        hbox.pack_start(widgetutil.align_middle(self.loading_icon),
                        expand=True)
示例#6
0
 def _make_button(self, image_name):
     button = imagebutton.ImageButton(image_name)
     button.set_squish_width(True)
     button.set_can_focus(False)
     return button