当前位置: 首页>>代码示例>>Python>>正文


Python widgetutil.align_center函数代码示例

本文整理汇总了Python中miro.frontends.widgets.widgetutil.align_center函数的典型用法代码示例。如果您正苦于以下问题:Python align_center函数的具体用法?Python align_center怎么用?Python align_center使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了align_center函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __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))
开发者ID:kmshi,项目名称:miro,代码行数:35,代码来源:searchcontroller.py

示例2: build_results_page

    def build_results_page(self):
        # FIXME - this is built just like the search_page.  it'd be
        # better to just change the buttons on the bottom of the
        # search page.
        vbox = widgetset.VBox(spacing=5)

        progress_bar = widgetset.ProgressBar()
        progress_bar.set_size_request(400, -1)
        vbox.pack_start(widgetutil.align_center(progress_bar,
                                                top_pad=50))

        progress_bar.stop_pulsing()
        progress_bar.set_progress(1.0)

        self.results_label = widgetset.Label("")
        vbox.pack_start(
            widgetutil.align_top(
                widgetutil.align_center(self.results_label),
                top_pad=10))

        vbox.pack_start(self._force_space_label(), expand=True)

        cancel_button = widgetset.Button(BUTTON_CANCEL.text)
        cancel_button.connect('clicked', self.on_cancel)

        import_button = widgetset.Button(BUTTON_IMPORT_FILES.text)
        import_button.connect('clicked', lambda x: self.destroy_dialog())

        vbox.pack_start(widgetutil.align_right(
                widgetutil.build_hbox((cancel_button, import_button))))

        return vbox
开发者ID:CodeforEvolution,项目名称:miro,代码行数:32,代码来源:searchfilesdialog.py

示例3: __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)
开发者ID:nxmirrors,项目名称:miro,代码行数:26,代码来源:displays.py

示例4: __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))
开发者ID:CodeforEvolution,项目名称:miro,代码行数:28,代码来源:tabcontroller.py

示例5: __init__

    def __init__(self):
        widgetset.VBox.__init__(self)
        label = widgetset.Label()
        label.set_text(
            _("Your device isn't telling us its exact model number."))
        self.pack_start(widgetutil.align_center(label, left_pad=20, top_pad=50,
                                              bottom_pad=20))
        label = widgetset.Label()
        label.set_text(
            _('For optimal video conversion, select the device model.'))
        label.set_bold(True)
        self.pack_start(widgetutil.align_center(label, left_pad=20,
                                                bottom_pad=20)),

        self.device_choices = widgetset.VBox()
        self.pack_start(widgetutil.align_center(self.device_choices,
                                                left_pad=20, top_pad=20,
                                                bottom_pad=20))

        image = widgetset.ImageDisplay(
            imagepool.get(resources.path('images/sync-unknown.png')))
        self.pack_start(widgetutil.align_center(image, left_pad=20,
                                                bottom_pad=20))

        label = widgetset.Label()
        label.set_text(_("If you don't know the model or it doesn't appear "
                         "in the list, it's fine to choose the 'Generic' "
                         "device option."))
        label.set_bold(True)
        self.pack_start(widgetutil.align_center(label, left_pad=20,
                                                bottom_pad=20))
开发者ID:kmshi,项目名称:miro,代码行数:31,代码来源:devicecontroller.py

示例6: __init__

 def __init__(self):
     widgetset.VBox.__init__(self)
     label = widgetset.Label()
     label.set_text(_('This phone is not yet mounted.'))
     label.set_bold(True)
     label.set_size(1.5)
     self.pack_start(widgetutil.align_center(label, left_pad=20, top_pad=50,
                                           bottom_pad=20))
     self.device_text = widgetset.Label()
     self.device_text.set_size(1.5)
     self.device_text.set_wrap(True)
     self.pack_start(widgetutil.align_center(self.device_text, left_pad=20))
开发者ID:cool-RR,项目名称:Miro,代码行数:12,代码来源:devicecontroller.py

示例7: __init__

 def __init__(self):
     RoundedVBox.__init__(self)
     self._background = widgetset.Background()
     self.pack_start(widgetutil.align_center(self._background,
                                             20, 20, 20, 20))
     self.boxes = {}
     self.device = None
开发者ID:CodeforEvolution,项目名称:miro,代码行数:7,代码来源:devicecontroller.py

示例8: __init__

    def __init__(self, done_firsttime_callback):
        widgetset.Window.__init__(
            self, _("%(name)s First Time Setup",
                    {'name': app.config.get(prefs.SHORT_APP_NAME)}),
            widgetset.Rect(100, 100, 475, 500))

        # the directory panel 3 searches for files in
        self.search_directory = None

        self.finder = None

        self.cancelled = False

        self.gathered_media_files = None

        self._done_firsttime_callback = done_firsttime_callback

        self._page_box = widgetset.VBox()
        self._pages = self.build_pages()
        self._page_index = -1

        self.set_content_widget(widgetutil.align_center(self._page_box,
                top_pad=20, bottom_pad=20, left_pad=20, right_pad=20))

        self.on_close_handler = self.connect('will-close', self.on_close)
开发者ID:cool-RR,项目名称:Miro,代码行数:25,代码来源:firsttimedialog.py

示例9: __init__

 def __init__(self, url):
     dialogs.MainDialog.__init__(self, _("Update Available"))
     self.browser = UpdateAvailableBrowser(url)
     label = widgetset.Label()
     label.set_text(
         _('A new version of %(appname)s is available for download.',
           {"appname": app.config.get(prefs.SHORT_APP_NAME)}))
     label2 = widgetset.Label()
     label2.set_text(
         _('Do you want to download it now?'))
     self.vbox = widgetset.VBox(spacing=6)
     self.vbox.pack_end(widgetutil.align_center(label2))
     self.vbox.pack_end(self.browser, expand=True)
     self.vbox.pack_end(widgetutil.align_center(label))
     self.set_extra_widget(self.vbox)
     self.add_button(dialogs.BUTTON_YES.text)
     self.add_button(dialogs.BUTTON_NO.text)
开发者ID:cool-RR,项目名称:Miro,代码行数:17,代码来源:update.py

示例10: __init__

 def __init__(self, title):
     MainDialog.__init__(self, title, description='')
     self.progress_bar = widgetset.ProgressBar()
     self.label = widgetset.Label()
     self.label.set_size(1.2)
     self.vbox = widgetset.VBox(spacing=6)
     self.vbox.pack_end(widgetutil.align_center(self.label))
     self.vbox.pack_end(self.progress_bar)
     self.set_extra_widget(self.vbox)
开发者ID:codito,项目名称:miro,代码行数:9,代码来源:dialogs.py

示例11: __init__

 def __init__(self, title):
     MainDialog.__init__(self, title)
     self.progress_bar = widgetset.ProgressBar()
     self.label = widgetset.Label()
     self.label.set_size(1.2)
     self.vbox = widgetset.VBox(spacing=6)
     self.vbox.pack_end(widgetutil.align_center(self.label))
     self.vbox.pack_end(self.progress_bar)
     height = self.vbox.get_size_request()[1] + 24
     self.set_extra_widget(self.vbox)
开发者ID:cool-RR,项目名称:Miro,代码行数:10,代码来源:dialogs.py

示例12: __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
     tab_list = app.tabs[tab_type]
     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(widgetutil.font_scale_from_osx_points(30))
     label.set_bold(True)
     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)
开发者ID:bluezone,项目名称:miro,代码行数:20,代码来源:displays.py

示例13: _pack_top

    def _pack_top(self):
        """Pack the top row into the VBox; these components are visible in all
        panels.
        """
        self.vbox.pack_start(widgetutil.align_center(self.toggler, top_pad=10))
        items = len(self.items)
        if items > 1:
            # text1 is included because ngettext requires text1 to have all the
            # same placeholders as text2; it won't be used
            text = ngettext("%(items)d", "%(items)d items selected to edit", items, {"items": items})
            label = widgetset.Label(text)
            label.set_bold(True)
            self.vbox.pack_start(widgetutil.align_center(label, top_pad=10, bottom_pad=3))

            text = _(
                "To change a field for all the selected items, check the "
                "checkbox next to the field you'd like to change."
            )
            label = widgetset.Label(text)
            label.set_size(widgetconst.SIZE_SMALL)
            self.vbox.pack_start(widgetutil.align_center(label, bottom_pad=20))
开发者ID:nerdymcgee,项目名称:miro,代码行数:21,代码来源:itemedit.py

示例14: build_extra_widget

 def build_extra_widget(self, window):
     table = widgetset.Table(2, 2)
     table.set_column_spacing(12)
     table.pack(widgetset.Label(_("Username:")), 0, 0)
     self.username_entry = widgetset.TextEntry(self.dialog.prefill_user)
     self.username_entry.set_width(20)
     table.pack(self.username_entry, 1, 0)
     table.pack(widgetset.Label(_("Password:")), 0, 1)
     self.password_entry = widgetset.SecureTextEntry(
             self.dialog.prefill_password)
     self.password_entry.set_activates_default(True)
     table.pack(self.password_entry, 1, 1)
     window.set_extra_widget(widgetutil.align_center(table))
开发者ID:CodeforEvolution,项目名称:miro,代码行数:13,代码来源:rundialog.py

示例15: build_search_page

    def build_search_page(self):
        vbox = widgetset.VBox(spacing=5)

        self.progress_bar = widgetset.ProgressBar()
        self.progress_bar.set_size_request(400, -1)
        vbox.pack_start(widgetutil.align_center(
                self.progress_bar, top_pad=50))

        self.progress_label = widgetset.Label("")
        vbox.pack_start(
            widgetutil.align_top(
                widgetutil.align_center(self.progress_label),
                top_pad=10))

        self.cancel_search_button = widgetset.Button(_("Cancel Search"))
        self.cancel_search_button.connect(
            'clicked', self.handle_search_cancel_clicked)

        vbox.pack_start(widgetutil.align_right(self.cancel_search_button, right_pad=5))

        vbox.pack_start(self._force_space_label(), expand=True)

        self.search_prev_button = widgetset.Button(_("< Previous"))
        self.search_prev_button.connect('clicked', lambda x: self.prev_page())

        self.search_next_button = widgetset.Button(_("Finish"))
        self.search_next_button.connect('clicked',
                                        lambda x: self.destroy())

        vbox.pack_start(
            widgetutil.align_bottom(widgetutil.align_right(
                    widgetutil.build_hbox((self.search_prev_button,
                                           self.search_next_button)))),
            expand=True)

        vbox = widgetutil.pad(vbox)
        vbox.run_me_on_switch = self.start_search

        return vbox
开发者ID:codito,项目名称:miro,代码行数:39,代码来源:firsttimedialog.py


注:本文中的miro.frontends.widgets.widgetutil.align_center函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。