本文整理汇总了Python中miro.frontends.widgets.widgetutil.align_middle函数的典型用法代码示例。如果您正苦于以下问题:Python align_middle函数的具体用法?Python align_middle怎么用?Python align_middle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了align_middle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
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
示例2: __init__
def __init__(self):
widgetset.VBox.__init__(self)
if not app.sharing_manager.mdns_present:
sharing_broken = SharingBroken()
sharing_broken.connect('install-clicked',
self.daap_install_clicked)
self.pack_start(widgetutil.align_center(sharing_broken))
title = widgetset.HBox()
logo = widgetset.ImageDisplay(imagepool.get(
resources.path('images/icon-connect_large.png')))
title.pack_start(widgetutil.align_middle(logo))
label = widgetset.Label(_("Connect"))
label.set_size(widgetutil.font_scale_from_osx_points(30))
label.set_bold(True)
title.pack_start(widgetutil.align_middle(label, left_pad=5))
self.pack_start(widgetutil.align_center(title, top_pad=30,
bottom_pad=20))
bottom = widgetset.VBox()
self._build_daap_section(bottom)
self._build_sync_section(bottom)
self._build_app_store_section(bottom)
self._build_android_section(bottom)
self.pack_start(widgetutil.align_center(bottom))
示例3: __init__
def __init__(self):
widgetset.SolidBackground.__init__(self, itemlistwidgets.StandardView.BACKGROUND_COLOR)
bg = widgetutil.RoundedSolidBackground(widgetutil.WHITE)
vbox = widgetset.VBox()
title = widgetset.HBox()
logo = imagepool.get_image_display(resources.path("images/icon-search_large.png"))
title.pack_start(widgetutil.align_middle(logo))
label = widgetset.Label(self.TITLE)
label.set_bold(True)
label.set_size(widgetutil.font_scale_from_osx_points(30))
title.pack_start(widgetutil.align_middle(label, left_pad=5))
vbox.pack_start(widgetutil.align_center(title, bottom_pad=20))
desc = widgetset.Label(self.DESC)
vbox.pack_start(widgetutil.align_center(desc, bottom_pad=40))
engine_width = int((desc.get_width() - 30) / 2)
engine_widgets = self.build_engine_widgets()
for widgets in engine_widgets[:-1]: # widgets with borders
hbox = widgetset.HBox(spacing=30)
for widget in widgets:
widget.set_size_request(engine_width, 45)
hbox.pack_start(widget, expand=True)
vbox.pack_start(hbox)
hbox = widgetset.HBox(spacing=30)
for widget in engine_widgets[-1]: # has no border
widget.set_has_border(False)
widget.set_size_request(engine_width, 45)
hbox.pack_start(widget, expand=True)
vbox.pack_start(hbox)
bg.add(widgetutil.pad(vbox, 45, 45, 45, 45))
self.add(widgetutil.align(bg, xalign=0.5, top_pad=50))
示例4: _build_titlebar_extra
def _build_titlebar_extra(self):
hbox = widgetset.HBox()
self.searchbox = widgetset.VideoSearchTextEntry()
w, h = self.searchbox.get_size_request()
self.searchbox.set_size_request(w * 2, h)
self.searchbox.connect('validate', self._on_search_activate)
hbox.pack_start(widgetutil.align_middle(self.searchbox, 0, 0, 16, 16))
return widgetutil.align_middle(hbox, right_pad=20)
示例5: run_dialog
def run_dialog(self):
"""
Returns (directory, show-in-sidebar) or None
"""
try:
extra = widgetset.VBox(spacing=10)
if self.previous_error:
extra.pack_start(widgetset.Label(self.previous_error))
self.folder_entry = widgetset.TextEntry()
self.folder_entry.set_activates_default(True)
self.folder_entry.set_text(filename_to_unicode(self.path))
self.folder_entry.set_size_request(300, -1)
choose_button = widgetset.Button(_("Choose..."))
choose_button.connect('clicked', self.handle_choose)
h = widgetset.HBox(spacing=5)
h.pack_start(widgetutil.align_middle(
widgetset.Label(_("Directory:"))))
h.pack_start(widgetutil.align_middle(self.folder_entry))
h.pack_start(widgetutil.align_middle(choose_button))
extra.pack_start(h)
self.visible_checkbox = widgetset.Checkbox(
_("Show in my sidebar as a podcast"))
self.visible_checkbox.set_checked(True)
extra.pack_start(self.visible_checkbox)
self.vbox = extra
self.set_extra_widget(extra)
self.add_button(BUTTON_ADD_FOLDER.text)
self.add_button(BUTTON_CANCEL.text)
ret = self.run()
if ret == 0:
# 17407 band-aid - don't init with PlatformFilenameType since
# str use ascii codec
dir = self.folder_entry.get_text()
if PlatformFilenameType == str:
dir = dir.encode('utf-8')
return (dir, self.visible_checkbox.get_checked())
return None
except StandardError:
logging.exception("newwatchedfolder threw exception.")
示例6: __init__
def __init__(self):
DisplayToolbar.__init__(self)
vbox = widgetset.VBox()
sep = separator.HSeparator((0.85, 0.85, 0.85), (0.95, 0.95, 0.95))
vbox.pack_start(sep)
h = widgetset.HBox(spacing=5)
self.create_signal('pause-all')
self.create_signal('resume-all')
self.create_signal('cancel-all')
self.create_signal('settings')
pause_button = widgetset.Button(_('Pause All'), style='smooth')
pause_button.set_size(widgetconst.SIZE_SMALL)
pause_button.set_color(widgetset.TOOLBAR_GRAY)
pause_button.connect('clicked', self._on_pause_button_clicked)
h.pack_start(widgetutil.align_right(pause_button, top_pad=5,
bottom_pad=5), expand=True)
resume_button = widgetset.Button(_('Resume All'), style='smooth')
resume_button.set_size(widgetconst.SIZE_SMALL)
resume_button.set_color(widgetset.TOOLBAR_GRAY)
resume_button.connect('clicked', self._on_resume_button_clicked)
h.pack_start(widgetutil.align_middle(resume_button, top_pad=5,
bottom_pad=5))
cancel_button = widgetset.Button(_('Cancel All'), style='smooth')
cancel_button.set_size(widgetconst.SIZE_SMALL)
cancel_button.set_color(widgetset.TOOLBAR_GRAY)
cancel_button.connect('clicked', self._on_cancel_button_clicked)
h.pack_start(widgetutil.align_middle(cancel_button, top_pad=5,
bottom_pad=5))
settings_button = widgetset.Button(_('Download Settings'),
style='smooth')
settings_button.set_size(widgetconst.SIZE_SMALL)
settings_button.set_color(widgetset.TOOLBAR_GRAY)
settings_button.connect('clicked', self._on_settings_button_clicked)
h.pack_start(widgetutil.align_middle(settings_button, top_pad=5,
bottom_pad=5, right_pad=16))
vbox.pack_start(h)
h = widgetset.HBox(spacing=10)
vbox.pack_start(h)
self.add(vbox)
示例7: __init__
def __init__(self):
widgetset.HBox.__init__(self)
self.set_size_request(-1, 25)
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()
self.pack_start(widgetutil.align_middle(self.back_button, left_pad=4))
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()
self.pack_start(widgetutil.align_middle(self.forward_button))
self.reload_button = imagebutton.ImageButton('navreload')
self.reload_button.connect('clicked', self._on_reload_button_clicked)
self.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)
self.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)
self.pack_start(widgetutil.align_middle(self.home_button, left_pad=4))
self.browser_open_button = widgetset.Button(
_('Open in browser'), style='smooth')
self.browser_open_button.set_size(widgetconst.SIZE_SMALL)
self.browser_open_button.connect(
'clicked', self._on_browser_open_activate)
self.pack_end(widgetutil.align_middle(self.browser_open_button,
right_pad=4))
self.download_button = widgetset.Button(_("Download this video"),
style="smooth")
self.download_button.set_size(widgetconst.SIZE_SMALL)
self.download_button.connect('clicked',
self._on_download_button_clicked)
self.download_button = widgetutil.HideableWidget(self.download_button)
self.pack_end(widgetutil.align_middle(self.download_button,
right_pad=4))
self.loading_icon = widgetutil.HideableWidget(
widgetset.AnimatedImageDisplay(
resources.path('images/load-indicator.gif')))
self.pack_end(widgetutil.align_middle(self.loading_icon, right_pad=6))
示例8: __init__
def __init__(self, tab_type, selected_tabs):
Display.__init__(self)
self.type = tab_type
self.child_count = self.folder_count = self.folder_child_count = 0
if tab_type == 'feed':
tab_list = app.tab_list_manager.feed_list
elif tab_type == 'audio-feed':
tab_list = app.tab_list_manager.audio_feed_list
elif tab_type == 'site':
tab_list = app.tab_list_manager.site_list
else:
tab_list = app.tab_list_manager.playlist_list
for tab in selected_tabs:
if hasattr(tab, "is_folder") and tab.is_folder:
self.folder_count += 1
self.folder_child_count += tab_list.get_child_count(tab.id)
else:
self.child_count += 1
vbox = widgetset.VBox(spacing=20)
label = self._make_label(tab_type, selected_tabs)
label.set_size(2)
label.set_color((0.3, 0.3, 0.3))
vbox.pack_start(widgetutil.align_center(label))
vbox.pack_start(widgetutil.align_center(
self._make_buttons(tab_type)))
self.widget = widgetutil.align_middle(vbox)
示例9: __init__
def __init__(self):
widgetset.HBox.__init__(self, spacing=2)
self.previous = self.make_button("skip_previous", True)
self.stop = self.make_button("stop", False)
self.play = self.make_button("play", False)
self.forward = self.make_button("skip_forward", True)
self.fullscreen = self.make_button("play_fullscreen", True)
self.pack_start(widgetutil.align_middle(self.previous))
self.pack_start(widgetutil.align_middle(self.stop))
self.pack_start(widgetutil.align_middle(self.play))
self.pack_start(widgetutil.align_middle(self.fullscreen))
self.pack_start(widgetutil.align_middle(self.forward))
app.playback_manager.connect("selecting-file", self.handle_selecting)
app.playback_manager.connect("will-play", self.handle_play)
app.playback_manager.connect("will-pause", self.handle_pause)
app.playback_manager.connect("will-stop", self.handle_stop)
示例10: __init__
def __init__(self):
style.LowerBox.__init__(self)
self.search_field = widgetset.VideoSearchTextEntry()
self.search_field.select_engine(app.search_manager.engine)
self.search_field.connect('validate', self.on_search)
self.add(widgetutil.align_middle(self.search_field, 0, 0, 16, 0))
app.playback_manager.connect('will-play-attached', self.on_start_attached_playback)
app.playback_manager.connect('will-play-detached', self.on_start_detached_playback)
app.playback_manager.connect('did-stop', self.on_stop_playback)
示例11: _build_add_playlist_section
def _build_add_playlist_section(self, bottom):
hbox = widgetset.HBox()
label = widgetset.Label(_("Name"))
hbox.pack_start(widgetutil.align_middle(label))
self.name_entry = widgetset.TextEntry()
self.name_entry.set_size_request(400, -1)
self.name_entry.connect('activate', self._on_add_playlist)
hbox.pack_start(widgetutil.align_middle(
self.name_entry, left_pad=15))
self.add_playlist_button = widgetutil.TitlebarButton(_("Add Playlist"))
self.add_playlist_button.connect('clicked', self._on_add_playlist)
hbox.pack_start(widgetutil.align_middle(
self.add_playlist_button, left_pad=15))
bg = widgetutil.RoundedSolidBackground(
widgetutil.css_to_color('#e4e4e4'))
bg.add(widgetutil.pad(hbox, 10, 10, 10, 10))
bottom.pack_start(bg)
示例12: __init__
def __init__(self):
widgetset.DonateWindow.__init__(self, _("Donate"))
self.create_signal("donate-clicked")
self.vbox = widgetset.VBox(spacing=5)
self.hbox = widgetset.HBox(spacing=5)
self.button_yes = widgetset.Button(_("Yes, I can donate now"))
self.button_no = widgetset.Button(_("Ask me later"))
self.button_yes.connect("clicked", self._on_button_clicked)
self.button_no.connect("clicked", self._on_button_clicked)
self.browser = widgetset.Browser()
self.browser.set_size_request(640, 440)
self.browser.connect("net-stop", self._on_browser_stop)
self.browser.connect("net-error", self._on_browser_error)
self.hbox.pack_end(widgetutil.align_middle(self.button_no, right_pad=10))
self.hbox.pack_end(widgetutil.align_middle(self.button_yes))
self.vbox.pack_start(self.browser, padding=10, expand=True)
self.vbox.pack_start(self.hbox, padding=5)
self.set_content_widget(self.vbox)
self.was_shown_invoked = False
self.callback_object = None
示例13: __init__
def __init__(self):
style.LowerBox.__init__(self)
self.controls = PlaybackControls()
self.timeline = ProgressTimeline()
if hasattr(widgetset, 'VolumeMuter'):
self.volume_muter = widgetset.VolumeMuter()
else:
self.volume_muter = imagebutton.ImageButton('volume')
if hasattr(widgetset, 'VolumeSlider'):
self.volume_slider = widgetset.VolumeSlider()
else:
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)
self.add(widgetutil.align_middle(hbox, 0, 0, 25, 25))
示例14: _build_stores_section
def _build_stores_section(self, bottom):
vbox = widgetset.VBox()
from miro.frontends.widgets import prefpanel
self.store_helper = prefpanel.StoreHelper(height=200)
self.store_helper.store_list.set_size_request(550, -1)
vbox.pack_start(widgetutil.align_middle(
self.store_helper.store_list, top_pad=20, bottom_pad=15,
left_pad=15, right_pad=15))
bg = widgetutil.RoundedSolidBackground(
widgetutil.css_to_color('#e4e4e4'))
bg.add(widgetutil.pad(vbox, 00, 10, 10, 10))
bottom.pack_start(bg)
示例15: pack_hbox_extra
def pack_hbox_extra(self):
self.filter_switch = segmented.SegmentedButtonsRow(behavior='custom')
# this "All" is different than other "All"s in the codebase, so it
# needs to be clarified
self.filter_switch.add_text_button('view-all',
declarify(_('View|All')),
self._on_view_all_clicked)
self.filter_switch.add_text_button('view-unwatched',
self.unwatched_label,
self._on_toggle_unwatched_clicked)
self.filter_switch.add_text_button('view-non-feed',
_('Non Feed'),
self._on_toggle_non_feed_clicked)
self.filter_switch.set_active('view-all')
self._hbox.pack_start(widgetutil.align_middle(
self.filter_switch.make_widget(), left_pad=12))