本文整理汇总了Python中miro.frontends.widgets.widgetutil.align_left函数的典型用法代码示例。如果您正苦于以下问题:Python align_left函数的具体用法?Python align_left怎么用?Python align_left使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了align_left函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self):
widgetset.SolidBackground.__init__(self, (0, 0, 0))
vbox = widgetset.VBox()
label = widgetset.Label(_(
"%(appname)s can't play this file. You may "
"be able to open it with a different program",
{"appname": app.config.get(prefs.SHORT_APP_NAME)}
))
label.set_color((1, 1, 1))
vbox.pack_start(label)
table = widgetset.Table(2, 2)
table.set_column_spacing(6)
self.filename_label = self._make_label('')
self.filetype_label = self._make_label('')
table.pack(widgetutil.align_left(self._make_heading(_('Filename:'))),
0, 0)
table.pack(widgetutil.align_left(self.filename_label), 1, 0)
table.pack(widgetutil.align_left(self._make_heading(_('File type:'))),
0, 1)
table.pack(widgetutil.align_left(self.filetype_label), 1, 1)
vbox.pack_start(widgetutil.align_left(table, top_pad=12))
hbox = widgetset.HBox(spacing=12)
reveal_button = widgetset.Button(_('Reveal File'))
self.play_externally_button = widgetset.Button(_('Play Externally'))
self.play_externally_button.connect('clicked', self._on_play_externally)
skip_button = widgetset.Button(_('Skip'))
reveal_button.connect('clicked', self._on_reveal)
skip_button.connect('clicked', self._on_skip)
hbox.pack_start(reveal_button)
hbox.pack_start(self.play_externally_button)
hbox.pack_start(skip_button)
vbox.pack_start(widgetutil.align_center(hbox, top_pad=24))
alignment = widgetset.Alignment(xalign=0.5, yalign=0.5)
alignment.add(vbox)
self.add(alignment)
示例2: __init__
def __init__(self):
widgetset.Background.__init__(self)
self.create_signal('install-clicked')
vbox = widgetset.VBox()
label = widgetset.Label(_("Sharing Disabled").upper())
label.set_bold(True)
label.set_color((1, 1, 1))
vbox.pack_start(widgetutil.align_left(label, top_pad=10))
# Note: "Miro iPad app" is the name of a specific piece of
# software and thus should not be %(appname)s iPad app.
label = widgetset.Label(
_("You need to install the Bonjour libraries to be able to "
"share files from %(appname)s-to-%(appname)s or to the "
"Miro iPad app.\n\n"
"Once you install the Bonjour libraries, you will have "
"to restart %(appname)s.",
{'appname': app.config.get(prefs.SHORT_APP_NAME)}))
label.set_wrap(True)
label.set_size_request(550, -1)
label.set_color((1, 1, 1))
vbox.pack_start(widgetutil.align_left(label, top_pad=20))
button = widgetset.Button(_("Click here to install"))
button.connect('clicked', self.on_clicked)
vbox.pack_start(widgetutil.align_left(button, top_pad=20,
bottom_pad=20))
self.add(widgetutil.align(vbox, xscale=1, left_pad=20))
示例3: _conversions_panel
def _conversions_panel():
extras = []
lab = widgetset.Label(_("Binaries to use:"))
lab.set_bold(True)
extras.append(align_left(lab))
grid = dialogwidgets.ControlGrid()
grid.pack_label(_("ffmpeg binary path:"), grid.ALIGN_RIGHT)
ffmpeg_binary = widgetset.TextEntry()
attach_text(ffmpeg_binary, options.FFMPEG_BINARY)
grid.pack(ffmpeg_binary)
grid.end_line(spacing=4)
grid.pack_label(_("ffmpeg2theora binary path:"), grid.ALIGN_RIGHT)
ffmpeg2theora_binary = widgetset.TextEntry()
attach_text(ffmpeg2theora_binary, options.FFMPEG2THEORA_BINARY)
grid.pack(ffmpeg2theora_binary)
grid.end_line(spacing=4)
extras.append(align_left(grid.make_table()))
return extras
示例4: _playback_panel
def _playback_panel():
extras = []
lab = widgetset.Label(_("Renderer options:"))
lab.set_bold(True)
extras.append(align_left(lab))
grid = dialogwidgets.ControlGrid()
note = dialogwidgets.note(
_("You must restart %(appname)s for renderer "
"changes to take effect.",
{"appname": app.config.get(prefs.SHORT_APP_NAME)}))
grid.pack(align_left(note, bottom_pad=12), grid.ALIGN_LEFT, span=2)
grid.end_line(spacing=12)
rbg = widgetset.RadioButtonGroup()
radio_map = {}
for mem in renderers.get_renderer_list():
radio_map[mem] = widgetset.RadioButton(mem, rbg)
buttons = [(v, k) for k, v in radio_map.items()]
attach_radio(buttons, options.USE_RENDERER)
grid.pack_label(_("Video renderer:"), grid.ALIGN_RIGHT)
grid.pack(dialogwidgets.radio_button_list(*radio_map.values()))
grid.end_line(spacing=12)
extras.append(align_left(grid.make_table()))
return extras
示例5: build_widget
def build_widget(self):
v = widgetset.VBox(8)
run_at_startup_cbx = widgetset.Checkbox(_(
"Automatically run %(appname)s when I log in.",
{'appname': app.config.get(prefs.SHORT_APP_NAME)}))
attach_boolean(run_at_startup_cbx, prefs.RUN_AT_STARTUP)
v.pack_start(run_at_startup_cbx)
warn_if_downloading_cbx = widgetset.Checkbox(_("Warn me if I attempt to quit with downloads in progress."))
attach_boolean(warn_if_downloading_cbx, prefs.WARN_IF_DOWNLOADING_ON_QUIT)
v.pack_start(warn_if_downloading_cbx)
warn_if_converting_cbx = widgetset.Checkbox(_("Warn me if I attempt to quit with conversions in progress."))
attach_boolean(warn_if_converting_cbx, prefs.WARN_IF_CONVERTING_ON_QUIT)
v.pack_start(warn_if_converting_cbx)
# FIXME - need to automatically generate list of available languages
# in correct language
lang_options = gtcache.get_languages()
lang_options.insert(0, ("system", _("System default")))
lang_option_menu = widgetset.OptionMenu([op[1] for op in lang_options])
attach_combo(lang_option_menu, prefs.LANGUAGE,
[op[0] for op in lang_options])
v.pack_start(widgetutil.align_left(
widgetutil.build_control_line((widgetset.Label(_("Language:")), lang_option_menu))))
v.pack_start(widgetutil.align_left(
dialogwidgets.note(_("(Changing the language requires you to restart Miro.)"))))
pack_extras(v, "general")
return v
示例6: run_dialog
def run_dialog(channel):
"""Displays the feed settings panel dialog."""
pref_window = MainDialog(_("Feed Settings"))
try:
try:
v = widgetset.VBox(spacing=10)
v.pack_start(widgetutil.align_left(_build_header(channel), left_pad=20, right_pad=20))
v.pack_start(separator.HThinSeparator((0.6, 0.6, 0.6)), padding=18)
grid = dialogwidgets.ControlGrid()
_build_auto_download(channel, grid)
grid.end_line(spacing=20)
_build_video_expires(channel, grid)
grid.end_line(spacing=20)
_build_remember_items(channel, grid)
v.pack_start(widgetutil.align_left(grid.make_table(), left_pad=20, right_pad=20))
v.pack_end(separator.HThinSeparator((0.6, 0.6, 0.6)), padding=6)
pref_window.set_extra_widget(v)
pref_window.add_button(BUTTON_DONE.text)
pref_window.run()
except StandardError:
logging.exception("feed settings panel threw exception.")
finally:
pref_window.destroy()
示例7: _build_sync_section
def _build_sync_section(self, bottom):
hbox = widgetset.HBox()
vbox = widgetset.VBox()
label_line = widgetset.HBox()
label = self.build_header(_("Sync a Phone, Tablet, or Digital Camera"))
label_line.pack_start(widgetutil.align_left(label, left_pad=20,
bottom_pad=10))
help_button = HelpButton()
help_button.connect('clicked', self.help_button_clicked)
label_line.pack_start(widgetutil.align_top(help_button))
bottom.pack_start(label_line)
label = widgetset.Label(
_("Connect the USB cable to sync your Android device with "
"%(shortappname)s. Be sure to set your device to 'USB Mass "
"Storage' mode in your device settings. Attach your digital "
"camera, and convert your video files to be instantly "
"web-ready.", self.trans_data))
label.set_size(self.TEXT_SIZE)
label.set_color(self.TEXT_COLOR)
label.set_size_request(400, -1)
label.set_wrap(True)
vbox.pack_start(widgetutil.align_left(label, left_pad=20,
bottom_pad=20))
show_all_vbox = widgetset.VBox()
self.show_unknown = widgetset.Checkbox(
_("Show all attached devices and drives"))
self.show_unknown.set_checked(
app.config.get(prefs.SHOW_UNKNOWN_DEVICES))
self.show_unknown.connect('toggled', self.show_all_devices_toggled)
show_all_vbox.pack_start(self.show_unknown)
padding = self.show_unknown.get_text_padding()
label = widgetset.Label(
_("Use this if your phone doesn't appear in %(shortappname)s when "
"you connect it to the computer, or if you want to sync with an "
"external drive.", self.trans_data))
label.set_size(self.TEXT_SIZE)
label.set_color(self.TEXT_COLOR)
label.set_size_request(370 - padding, -1)
label.set_wrap(True)
show_all_vbox.pack_start(widgetutil.pad(label, top=10, left=padding))
bg = widgetutil.RoundedSolidBackground(
widgetutil.css_to_color('#e4e4e4'))
bg.set_size_request(400, -1)
bg.add(widgetutil.pad(show_all_vbox, 20, 20, 20, 20))
vbox.pack_start(widgetutil.pad(bg, left=20, right=10, bottom=50))
hbox.pack_start(vbox)
hbox.pack_start(widgetutil.align_top(widgetset.ImageDisplay(
imagepool.get(resources.path('images/connect-android.png')))))
bottom.pack_start(hbox)
示例8: _build_header
def _build_header(channel):
v = widgetset.VBox(6)
lab = widgetset.Label(clamp_text(channel.name, 60))
lab.set_bold(True)
lab.set_size(1.2)
v.pack_start(widgetutil.align_left(lab))
lab = widgetset.Label(clamp_text(channel.url, 80))
lab.set_selectable(True)
lab.set_size(widgetconst.SIZE_SMALL)
lab.set_color(widgetconst.DIALOG_NOTE_COLOR)
v.pack_start(widgetutil.align_left(lab))
return v
示例9: _build_android_section
def _build_android_section(self, bottom):
hbox = widgetset.HBox()
vbox = widgetset.VBox()
label = self.build_header(_("Miro on Android"))
vbox.pack_start(widgetutil.align_left(label, left_pad=20,
bottom_pad=10))
label = self.build_text(
_("We don't yet have a Miro app for Android, but you can stream "
"to your device using other DAAP apps."))
label.set_wrap(True)
label.set_size_request(550, -1)
vbox.pack_start(widgetutil.align_left(label, left_pad=20,
right_pad=10,
bottom_pad=20))
hbox.pack_start(vbox)
bottom.pack_start(hbox)
示例10: build_widget
def build_widget(self):
SimpleItemListController.build_widget(self)
button = widgetset.Button(_('Back to feed'))
button.connect('clicked', self._on_clicked)
self.widget.titlebar_vbox.pack_start(widgetutil.align_left(button,
left_pad=10, top_pad=6, bottom_pad=4))
示例11: _build_title
def _build_title(text):
"""Builds and returns a title widget for the panes in the
First Time Startup dialog.
"""
lab = widgetset.Label(text)
lab.set_bold(True)
lab.set_wrap(True)
return widgetutil.align_left(lab, bottom_pad=10)
示例12: build_media_player_import_page
def build_media_player_import_page(self):
vbox = widgetset.VBox(spacing=5)
vbox.pack_start(_build_title_question(_(
"Would you like to display your %(player)s music and "
"video in %(appname)s?",
{"player": self.mp_name,
"appname": app.config.get(prefs.SHORT_APP_NAME)})))
rbg = widgetset.RadioButtonGroup()
yes_rb = widgetset.RadioButton(_("Yes"), rbg)
no_rb = widgetset.RadioButton(_("No"), rbg)
yes_rb.set_selected()
vbox.pack_start(widgetutil.align_left(yes_rb))
vbox.pack_start(widgetutil.align_left(no_rb))
lab = widgetset.Label(_(
"Note: %(appname)s won't move or copy any files on your "
"disk. It will just add them to your %(appname)s library.",
{"appname": app.config.get(prefs.SHORT_APP_NAME)}))
lab.set_size_request(WIDTH - 40, -1)
lab.set_wrap(True)
vbox.pack_start(widgetutil.align_left(lab))
def handle_next(widget):
if rbg.get_selected() == yes_rb:
self.import_media_player_stuff = True
else:
self.import_media_player_stuff = False
self.next_page()
prev_button = widgetset.Button(_("< Previous"))
prev_button.connect('clicked', lambda x: self.prev_page())
next_button = widgetset.Button(_("Next >"))
next_button.connect('clicked', handle_next)
vbox.pack_start(
widgetutil.align_bottom(widgetutil.align_right(
widgetutil.build_hbox((prev_button, next_button)))),
expand=True)
vbox = widgetutil.pad(vbox)
return vbox
示例13: _general_panel
def _general_panel():
extras = []
show_cbx = widgetset.Checkbox(_("Enable tray icon"))
attach_boolean(show_cbx, options.SHOW_TRAYICON)
extras.append(show_cbx)
lab = widgetset.Label(_("When I click the red close button:"))
extras.append(widgetutil.align_left(lab))
rbg = widgetset.RadioButtonGroup()
rad_close = widgetset.RadioButton(_("Close to tray so that downloads can continue."), rbg)
rad_quit = widgetset.RadioButton(_("Quit %(appname)s completely.",
{'appname': app.config.get(prefs.SHORT_APP_NAME)}), rbg)
attach_radio([(rad_close, True), (rad_quit, False)], prefs.MINIMIZE_TO_TRAY)
extras.append(widgetutil.align_left(rad_close, left_pad=20))
extras.append(widgetutil.align_left(rad_quit, left_pad=20))
return extras
示例14: build_first_page
def build_first_page(self):
vbox = widgetset.VBox(spacing=5)
vbox.pack_start(_build_title(_("Choose Language")))
lab = widgetset.Label(_(
"Welcome to the %(name)s first time setup!\n"
"\n"
"The next few screens will help you set up %(name)s so that "
"it works best for you.\n"
"\n"
"What language would you like Miro to be in?",
{'name': app.config.get(prefs.SHORT_APP_NAME)}))
lab.set_wrap(True)
lab.set_size_request(400, -1)
vbox.pack_start(widgetutil.align_left(lab))
lang_options = gtcache.get_languages()
lang_options.insert(0, ("system", _("System default")))
lang_option_menu = widgetset.OptionMenu([op[1] for op in lang_options])
lang = app.config.get(prefs.LANGUAGE)
try:
lang_option_menu.set_selected([op[0] for op in lang_options].index(lang))
except ValueError:
lang_option_menu.set_selected(1)
def update_clicked(widget):
os.environ["LANGUAGE"] = _SYSTEM_LANGUAGE
app.config.set(prefs.LANGUAGE,
str(lang_options[lang_option_menu.get_selected()][0]))
gtcache.init()
self.this_page(rebuild=True)
def next_clicked(widget):
os.environ["LANGUAGE"] = _SYSTEM_LANGUAGE
app.config.set(prefs.LANGUAGE,
str(lang_options[lang_option_menu.get_selected()][0]))
gtcache.init()
self.next_page(rebuild=True)
update_button = widgetset.Button(_("Update"))
update_button.connect('clicked', update_clicked)
hbox = widgetset.HBox()
hbox.pack_start(widgetset.Label(_("Language:")), padding=0)
hbox.pack_start(lang_option_menu, padding=5)
hbox.pack_start(update_button, padding=5)
vbox.pack_start(hbox)
vbox.pack_start(widgetset.Label(" "), expand=True)
next_button = widgetset.Button(_("Next >"))
next_button.connect('clicked', next_clicked)
vbox.pack_start(widgetutil.align_right(next_button))
return vbox
示例15: _build_title_question
def _build_title_question(text):
"""Builds and returns a title widget for the panes in the
First Time Startup dialog.
"""
lab = widgetset.Label(text)
lab.set_bold(True)
lab.set_wrap(True)
lab.set_size_request(WIDTH - 40, -1)
return widgetutil.align_left(lab, bottom_pad=15)