• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python widgetutil.align_center函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: __init__

    def __init__(self):
        self.device = None
        widgetset.VBox.__init__(self)

        self.button_row = segmented.SegmentedButtonsRow()
        for name in ('Main', 'Video', 'Audio', 'Playlists', 'Settings'):
            button = DeviceTabButtonSegment(name.lower(), name,
                                            self._tab_clicked)
            self.button_row.add_button(name.lower(), button)

        self.button_row.set_active('main')
        self.pack_start(widgetutil.align_center(
                        self.button_row.make_widget()))

        self.tabs = {}
        self.tab_container = widgetset.SolidBackground((1, 1, 1))
        self.pack_start(self.tab_container, expand=True)

        vbox = widgetset.VBox()
        label = widgetset.Label(_("To copy media onto the device, drag it "
                                  "onto the sidebar."))
        label.set_size(1.5)
        vbox.pack_start(widgetutil.align_center(label, top_pad=50))

        self.sync_container = widgetset.Background()
        sync_vbox = widgetset.VBox()
        self.sync_button = widgetset.Button('Sync Now')
        self.sync_button.set_size(1.5)
        self.sync_button.connect('clicked', self.sync_clicked)
        sync_vbox.pack_start(self.sync_button)
        self.sync_state = widgetset.Label()
        sync_vbox.pack_start(self.sync_state)
        self.sync_container.set_child(widgetutil.align_center(sync_vbox))
        vbox.pack_start(widgetutil.align_center(self.sync_container,
                                                top_pad=50))

        self.device_size = SizeWidget()
        alignment = widgetset.Alignment(0.5, 1, 0, 0, bottom_pad=15,
                                        right_pad=20)
        alignment.add(self.device_size)
        vbox.pack_end(alignment)

        self.add_tab('main', vbox)
        self.add_tab('video', widgetutil.align_center(VideoFeedSyncWidget()))
        self.add_tab('audio', widgetutil.align_center(AudioFeedSyncWidget()))
        self.add_tab('playlists',
                     widgetutil.align_center(PlaylistSyncWidget()))
        self.add_tab('settings',
                     widgetutil.align_center(DeviceSettingsWidget()))
开发者ID:nxmirrors,项目名称:miro,代码行数:49,代码来源:devicecontroller.py


示例17: 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))

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

        cancel_button = widgetset.Button(_("Cancel Search"))
        cancel_button.connect('clicked', self.on_cancel)

        vbox.pack_start(widgetutil.align_right(cancel_button))

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


示例18: redraw

 def redraw(self):
     if self._width is None:
         # Haven't seen a size-allocated signal yet.  Wait until we get one
         # to draw ourselves
         return
     self.clear()
     available = self._width
     right_padding = 0
     if self.download_shown:
         self.pack_start(self.download)
         available -= self.DOWNLOAD_WIDTH
         right_padding = self.DOWNLOAD_WIDTH
     if (self.throbber_shown and
         available >= (self.THROBBER_WIDTH + right_padding)):
         self.pack_start(widgetutil.align_center(self.get_throbber(),
                                                 right_pad=right_padding),
                         expand=True)
开发者ID:codito,项目名称:miro,代码行数:17,代码来源:browser.py


示例19: build_widgets

    def build_widgets(self):
        self.vlayout = widgetset.VBox(spacing=5)
        grid = dialogwidgets.ControlGrid()

        donate_nothanks_textentry = widgetset.TextEntry()
        donate_nothanks_textentry.set_width(5)
        prefpanel.attach_integer(
            donate_nothanks_textentry,
            prefs.DONATE_NOTHANKS,
            prefpanel.build_error_image(),
            prefpanel.create_value_checker(min_=0),
        )

        last_donate_time_textentry = widgetset.TextEntry()
        last_donate_time_textentry.set_width(16)
        prefpanel.attach_integer(
            last_donate_time_textentry,
            prefs.LAST_DONATE_TIME,
            prefpanel.build_error_image(),
            prefpanel.create_value_checker(min_=0),
        )

        donate_counter_textentry = widgetset.TextEntry()
        donate_counter_textentry.set_width(5)
        prefpanel.attach_integer(
            donate_counter_textentry,
            prefs.DONATE_COUNTER,
            prefpanel.build_error_image(),
            prefpanel.create_value_checker(min_=0),
        )

        set_ratelimit_button = widgetset.Button("Force ratelimit")
        set_ratelimit_button.connect("clicked", self.on_set_ratelimit_clicked)

        reset_ratelimit_button = widgetset.Button("Force no ratelimit")
        reset_ratelimit_button.connect("clicked", self.on_reset_ratelimit_clicked)

        reset_button = widgetset.Button("Reset counters to factory defaults")
        reset_button.connect("clicked", self.on_reset_clicked)

        reset_donate_url_button = widgetset.Button("Reset")
        reset_donate_url_button.connect("clicked", self.on_reset_donate_url_clicked)

        reset_payment_url_button = widgetset.Button("Reset")
        reset_payment_url_button.connect("clicked", self.on_reset_payment_url_clicked)

        self.donate_url_textentry = widgetset.TextEntry()
        self.donate_url_textentry.set_width(16)

        self.payment_url_textentry = widgetset.TextEntry()
        self.payment_url_textentry.set_width(16)

        run_button = widgetset.Button("Run dialog")
        run_button.connect("clicked", self.on_run_clicked)

        grid.pack_label("Set DONATE_NOTHANKS", grid.ALIGN_RIGHT)
        grid.pack(donate_nothanks_textentry, span=2)
        grid.end_line(spacing=4)

        grid.pack_label("Set LAST_DONATE_TIME", grid.ALIGN_RIGHT)
        grid.pack(last_donate_time_textentry, span=2)
        grid.end_line(spacing=4)

        grid.pack_label("Set DONATE_COUNTER", grid.ALIGN_RIGHT)
        grid.pack(donate_counter_textentry, span=2)
        grid.end_line(spacing=4)

        grid.pack(reset_button, grid.FILL, span=3)
        grid.end_line(spacing=4)

        hbox = widgetset.HBox()
        hbox.pack_start(set_ratelimit_button)
        hbox.pack_start(reset_ratelimit_button)

        grid.pack(widgetutil.align_center(hbox), grid.FILL, span=3)
        grid.end_line(spacing=4)
        grid.pack_label("Use donate url", grid.ALIGN_RIGHT)
        grid.pack(self.donate_url_textentry)
        grid.pack(reset_donate_url_button, grid.FILL)
        grid.end_line(spacing=4)

        grid.pack_label("Use payment donate url", grid.ALIGN_RIGHT)
        grid.pack(self.payment_url_textentry)
        grid.pack(reset_payment_url_button, grid.FILL)
        grid.end_line(spacing=4)

        grid.pack(run_button, grid.FILL, span=3)
        grid.end_line(spacing=12)

        alignment = widgetset.Alignment(xalign=0.5, yalign=0.5)
        alignment.set_padding(20, 20, 20, 20)
        alignment.add(grid.make_table())

        return alignment
开发者ID:ktan2020,项目名称:miro,代码行数:94,代码来源:donate.py


示例20: create_table

 def create_table(self):
     self._background.remove()
     def _get_conversion_name(id_):
         if id_ == 'copy':
             return _('Copy')
         else:
             return conversion_manager.lookup_converter(id_).name
     conversion_details = {
         'audio': _get_conversion_name(self.device.info.audio_conversion),
         'video': _get_conversion_name(self.device.info.video_conversion)
         }
     audio_conversion_names = [_('Device Default (%(audio)s)',
                                 conversion_details), _('Copy')]
     self.audio_conversion_values = [None, 'copy']
     video_conversion_names = [_('Device Default (%(video)s)',
                                 conversion_details), _('Copy')]
     self.video_conversion_values = [None, 'copy']
     for section_name, converters in conversion_manager.get_converters():
         for converter in converters:
             if converter.mediatype == 'video':
                 video_conversion_names.append(converter.name)
                 self.video_conversion_values.append(converter.identifier)
             elif converter.mediatype == 'audio':
                 audio_conversion_names.append(converter.name)
                 self.audio_conversion_values.append(converter.identifier)
     widgets = []
     for text, setting, type_ in (
         (_("Name of Device"), u'name', 'text'),
         (_("Video Conversion"), u'video_conversion', 'video_conversion'),
         (_("Audio Conversion"), u'audio_conversion', 'audio_conversion'),
         (_("Store video in this directory"), u'video_path', 'text'),
         (_("Store audio in this directory"), u'audio_path', 'text'),
         (_("Always show this device, even if "
            "'show all devices' is turned off"), u'always_show', 'bool'),
         (_("Always convert videos before copying to this device, even "
            "if the video can play without conversion\n(may reduce video "
            "file sizes, but makes syncing much slower)"),
          u"always_sync_videos", 'bool')):
         if type_ == 'text':
             widget = widgetset.TextEntry()
             widget.set_size_request(260, -1)
         elif type_.endswith('conversion'):
             if type_ == 'video_conversion':
                 options = video_conversion_names
             elif type_ == 'audio_conversion':
                 options = audio_conversion_names
             widget = widgetset.OptionMenu(options)
             widget.set_size_request(260, -1)
         elif type_== 'bool':
             widget = widgetset.Checkbox(text)
             widget.set_size_request(400, -1)
         else:
             raise RuntimeError('unknown settings widget: %r' % type_)
         self.boxes[setting] = widget
         if type_ != 'bool': # has a label already
             widgets.append((widgetset.Label(text), widget))
             if type_ == 'text':
                 widget.connect('focus-out', self.setting_changed, setting)
             else:
                 widget.connect('changed', self.setting_changed, setting)
         else:
             widgets.append((widget,))
             widget.connect('toggled', self.setting_changed, setting)
     table = widgetset.Table(2, len(widgets))
     for row, widget in enumerate(widgets):
         if len(widget) == 1: # checkbox
             table.pack(widget[0], 0, row, column_span=2)
         else:
             table.pack(widgetutil.align_right(widget[0]), 0, row)
             table.pack(widgetutil.align_left(widget[1]), 1, row)
     table.set_column_spacing(20)
     table.set_row_spacing(20)
     self._background.set_child(widgetutil.align_center(table,
                                                        20, 20, 20, 20))
开发者ID:CodeforEvolution,项目名称:miro,代码行数:74,代码来源:devicecontroller.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python widgetutil.align_left函数代码示例发布时间:2022-05-27
下一篇:
Python widgetstatestore.WidgetStateStore类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap