bootstack 0.1.0a1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bootstack/__init__.py +249 -0
- bootstack/__main__.py +5 -0
- bootstack/api/__init__.py +127 -0
- bootstack/api/app.py +30 -0
- bootstack/api/constants.py +3 -0
- bootstack/api/data.py +23 -0
- bootstack/api/dialogs.py +44 -0
- bootstack/api/i18n.py +17 -0
- bootstack/api/localization.py +16 -0
- bootstack/api/menu.py +7 -0
- bootstack/api/style.py +23 -0
- bootstack/api/utils.py +24 -0
- bootstack/api/widgets.py +137 -0
- bootstack/assets/__init__.py +24 -0
- bootstack/assets/bootstack-transparent.png +0 -0
- bootstack/assets/bootstack.ico +0 -0
- bootstack/assets/bootstack.png +0 -0
- bootstack/assets/elements/__init__.py +0 -0
- bootstack/assets/elements/badge-pill.png +0 -0
- bootstack/assets/elements/badge-square.png +0 -0
- bootstack/assets/elements/border.png +0 -0
- bootstack/assets/elements/button-compact.png +0 -0
- bootstack/assets/elements/button-default.png +0 -0
- bootstack/assets/elements/button-group-horizontal-after-compact.png +0 -0
- bootstack/assets/elements/button-group-horizontal-after-default.png +0 -0
- bootstack/assets/elements/button-group-horizontal-before-compact.png +0 -0
- bootstack/assets/elements/button-group-horizontal-before-default.png +0 -0
- bootstack/assets/elements/button-group-horizontal-center-compact.png +0 -0
- bootstack/assets/elements/button-group-horizontal-center-default.png +0 -0
- bootstack/assets/elements/button-group-vertical-after-compact.png +0 -0
- bootstack/assets/elements/button-group-vertical-after-default.png +0 -0
- bootstack/assets/elements/button-group-vertical-before-compact.png +0 -0
- bootstack/assets/elements/button-group-vertical-before-default.png +0 -0
- bootstack/assets/elements/button-group-vertical-center-compact.png +0 -0
- bootstack/assets/elements/button-group-vertical-center-default.png +0 -0
- bootstack/assets/elements/checkbox-checked.png +0 -0
- bootstack/assets/elements/checkbox-indeterminate.png +0 -0
- bootstack/assets/elements/checkbox-unchecked.png +0 -0
- bootstack/assets/elements/field.png +0 -0
- bootstack/assets/elements/input-after-compact.png +0 -0
- bootstack/assets/elements/input-after-default.png +0 -0
- bootstack/assets/elements/input-before-compact.png +0 -0
- bootstack/assets/elements/input-before-default.png +0 -0
- bootstack/assets/elements/input-compact.png +0 -0
- bootstack/assets/elements/input-default.png +0 -0
- bootstack/assets/elements/list-item-separated.png +0 -0
- bootstack/assets/elements/list-item.png +0 -0
- bootstack/assets/elements/manifest.toml +480 -0
- bootstack/assets/elements/menu-item.png +0 -0
- bootstack/assets/elements/nav-button-compact.png +0 -0
- bootstack/assets/elements/nav-button-default.png +0 -0
- bootstack/assets/elements/nav-icon-button-compact.png +0 -0
- bootstack/assets/elements/nav-icon-button-default.png +0 -0
- bootstack/assets/elements/notebook-client-border.png +0 -0
- bootstack/assets/elements/notebook-tab-active.png +0 -0
- bootstack/assets/elements/notebook-tab-bar.png +0 -0
- bootstack/assets/elements/notebook-tab-normal.png +0 -0
- bootstack/assets/elements/notebook-tab-pill.png +0 -0
- bootstack/assets/elements/progress-bar-horizontal-striped.png +0 -0
- bootstack/assets/elements/progress-bar-solid.png +0 -0
- bootstack/assets/elements/progress-bar-thin.png +0 -0
- bootstack/assets/elements/progress-bar-vertical-striped.png +0 -0
- bootstack/assets/elements/radio-selected.png +0 -0
- bootstack/assets/elements/radio-unselected.png +0 -0
- bootstack/assets/elements/scrollbar-horizontal.png +0 -0
- bootstack/assets/elements/scrollbar-vertical.png +0 -0
- bootstack/assets/elements/slider-handle-focus.png +0 -0
- bootstack/assets/elements/slider-handle.png +0 -0
- bootstack/assets/elements/slider-track-horizontal.png +0 -0
- bootstack/assets/elements/slider-track-vertical.png +0 -0
- bootstack/assets/elements/switch-off.png +0 -0
- bootstack/assets/elements/switch-on.png +0 -0
- bootstack/assets/elements/tabs-bar-horizontal.png +0 -0
- bootstack/assets/elements/tabs-bar-vertical.png +0 -0
- bootstack/assets/elements/tabs-pill.png +0 -0
- bootstack/assets/locales/ar/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/ar/LC_MESSAGES/bootstack.po +853 -0
- bootstack/assets/locales/bg/LC_MESSAGES/bootstack.po +875 -0
- bootstack/assets/locales/cs/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/cs/LC_MESSAGES/bootstack.po +853 -0
- bootstack/assets/locales/da/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/da/LC_MESSAGES/bootstack.po +853 -0
- bootstack/assets/locales/de/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/de/LC_MESSAGES/bootstack.po +853 -0
- bootstack/assets/locales/en/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/en/LC_MESSAGES/bootstack.po +875 -0
- bootstack/assets/locales/es/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/es/LC_MESSAGES/bootstack.po +853 -0
- bootstack/assets/locales/fr/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/fr/LC_MESSAGES/bootstack.po +853 -0
- bootstack/assets/locales/he/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/he/LC_MESSAGES/bootstack.po +851 -0
- bootstack/assets/locales/hi/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/hi/LC_MESSAGES/bootstack.po +842 -0
- bootstack/assets/locales/it/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/it/LC_MESSAGES/bootstack.po +841 -0
- bootstack/assets/locales/ja/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/ja/LC_MESSAGES/bootstack.po +914 -0
- bootstack/assets/locales/ko/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/ko/LC_MESSAGES/bootstack.po +842 -0
- bootstack/assets/locales/nb/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/nb/LC_MESSAGES/bootstack.po +841 -0
- bootstack/assets/locales/nl/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/nl/LC_MESSAGES/bootstack.po +841 -0
- bootstack/assets/locales/pl/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/pl/LC_MESSAGES/bootstack.po +842 -0
- bootstack/assets/locales/pt/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/pt/LC_MESSAGES/bootstack.po +842 -0
- bootstack/assets/locales/pt_BR/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/pt_BR/LC_MESSAGES/bootstack.po +842 -0
- bootstack/assets/locales/sl/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/sl/LC_MESSAGES/bootstack.po +842 -0
- bootstack/assets/locales/sv/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/sv/LC_MESSAGES/bootstack.po +842 -0
- bootstack/assets/locales/tr/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/tr/LC_MESSAGES/bootstack.po +842 -0
- bootstack/assets/locales/zh_CN/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/zh_CN/LC_MESSAGES/bootstack.po +842 -0
- bootstack/assets/locales/zh_TW/LC_MESSAGES/bootstack.mo +0 -0
- bootstack/assets/locales/zh_TW/LC_MESSAGES/bootstack.po +842 -0
- bootstack/assets/themes/__init__.py +0 -0
- bootstack/assets/themes/amber-dark.json +32 -0
- bootstack/assets/themes/amber-light.json +32 -0
- bootstack/assets/themes/aurora-dark.json +32 -0
- bootstack/assets/themes/aurora-light.json +32 -0
- bootstack/assets/themes/bootstrap-dark.json +32 -0
- bootstack/assets/themes/bootstrap-light.json +32 -0
- bootstack/assets/themes/classic-dark.json +32 -0
- bootstack/assets/themes/classic-light.json +32 -0
- bootstack/assets/themes/docs-dark.json +32 -0
- bootstack/assets/themes/docs-light.json +32 -0
- bootstack/assets/themes/forest-dark.json +32 -0
- bootstack/assets/themes/forest-light.json +32 -0
- bootstack/assets/themes/ocean-dark.json +32 -0
- bootstack/assets/themes/ocean-light.json +32 -0
- bootstack/assets/themes/rose-dark.json +32 -0
- bootstack/assets/themes/rose-light.json +32 -0
- bootstack/assets/widgets/__init__.py +0 -0
- bootstack/assets/widgets/badge-default.png +0 -0
- bootstack/assets/widgets/badge-pill.png +0 -0
- bootstack/assets/widgets/border.png +0 -0
- bootstack/assets/widgets/button-group-horizontal-after.png +0 -0
- bootstack/assets/widgets/button-group-horizontal-before.png +0 -0
- bootstack/assets/widgets/button-group-horizontal-center.png +0 -0
- bootstack/assets/widgets/button-group-vertical-after.png +0 -0
- bootstack/assets/widgets/button-group-vertical-before.png +0 -0
- bootstack/assets/widgets/button-group-vertical-center.png +0 -0
- bootstack/assets/widgets/button.png +0 -0
- bootstack/assets/widgets/checkbox-checked.png +0 -0
- bootstack/assets/widgets/checkbox-indeterminate.png +0 -0
- bootstack/assets/widgets/checkbox-unchecked.png +0 -0
- bootstack/assets/widgets/field.png +0 -0
- bootstack/assets/widgets/icon-button.png +0 -0
- bootstack/assets/widgets/input-inner.png +0 -0
- bootstack/assets/widgets/input-prefix.png +0 -0
- bootstack/assets/widgets/input-suffix.png +0 -0
- bootstack/assets/widgets/input.png +0 -0
- bootstack/assets/widgets/list-item-focus.png +0 -0
- bootstack/assets/widgets/list-item-separated.png +0 -0
- bootstack/assets/widgets/menu-item-separated.png +0 -0
- bootstack/assets/widgets/notebook-client-border.png +0 -0
- bootstack/assets/widgets/notebook-pill-active.png +0 -0
- bootstack/assets/widgets/notebook-pill-inactive.png +0 -0
- bootstack/assets/widgets/notebook-tab-active.png +0 -0
- bootstack/assets/widgets/notebook-tab-border.png +0 -0
- bootstack/assets/widgets/notebook-tab-normal.png +0 -0
- bootstack/assets/widgets/notebook-underline.png +0 -0
- bootstack/assets/widgets/progress-bar-horizontal-default.png +0 -0
- bootstack/assets/widgets/progress-bar-horizontal-striped.png +0 -0
- bootstack/assets/widgets/progress-bar-vertical-default.png +0 -0
- bootstack/assets/widgets/progress-bar-vertical-striped.png +0 -0
- bootstack/assets/widgets/progress-trough-horizontal.png +0 -0
- bootstack/assets/widgets/progress-trough-vertical.png +0 -0
- bootstack/assets/widgets/radio-selected.png +0 -0
- bootstack/assets/widgets/radio-unselected.png +0 -0
- bootstack/assets/widgets/scrollbar-horizontal-rounded.png +0 -0
- bootstack/assets/widgets/scrollbar-vertical-rounded.png +0 -0
- bootstack/assets/widgets/separator-horizontal.png +0 -0
- bootstack/assets/widgets/separator-vertical.png +0 -0
- bootstack/assets/widgets/slider-handle-focus.png +0 -0
- bootstack/assets/widgets/slider-handle.png +0 -0
- bootstack/assets/widgets/slider-track-horizontal.png +0 -0
- bootstack/assets/widgets/slider-track-vertical.png +0 -0
- bootstack/assets/widgets/switch-off.png +0 -0
- bootstack/assets/widgets/switch-on.png +0 -0
- bootstack/assets/widgets/tabs-bar-horizontal.png +0 -0
- bootstack/assets/widgets/tabs-bar-vertical.png +0 -0
- bootstack/assets/widgets/tabs-pill.png +0 -0
- bootstack/cli/__init__.py +124 -0
- bootstack/cli/__main__.py +6 -0
- bootstack/cli/add.py +439 -0
- bootstack/cli/build.py +115 -0
- bootstack/cli/config.py +287 -0
- bootstack/cli/demo.py +1267 -0
- bootstack/cli/doctor.py +195 -0
- bootstack/cli/list_cmd.py +71 -0
- bootstack/cli/promote.py +120 -0
- bootstack/cli/pyinstaller.py +246 -0
- bootstack/cli/run.py +99 -0
- bootstack/cli/start.py +105 -0
- bootstack/cli/templates/__init__.py +861 -0
- bootstack/constants.py +325 -0
- bootstack/core/__init__.py +34 -0
- bootstack/core/capabilities/__init__.py +45 -0
- bootstack/core/capabilities/after.py +103 -0
- bootstack/core/capabilities/bind.py +154 -0
- bootstack/core/capabilities/bindtags.py +112 -0
- bootstack/core/capabilities/busy.py +61 -0
- bootstack/core/capabilities/clipboard.py +88 -0
- bootstack/core/capabilities/focus.py +118 -0
- bootstack/core/capabilities/grab.py +65 -0
- bootstack/core/capabilities/grid.py +188 -0
- bootstack/core/capabilities/localization.py +231 -0
- bootstack/core/capabilities/pack.py +119 -0
- bootstack/core/capabilities/place.py +92 -0
- bootstack/core/capabilities/selection.py +136 -0
- bootstack/core/capabilities/signals.py +242 -0
- bootstack/core/capabilities/winfo.py +315 -0
- bootstack/core/colorutils.py +234 -0
- bootstack/core/exceptions.py +95 -0
- bootstack/core/images.py +283 -0
- bootstack/core/localization/README.md +90 -0
- bootstack/core/localization/__init__.py +13 -0
- bootstack/core/localization/intl_format.py +580 -0
- bootstack/core/localization/msgcat.py +425 -0
- bootstack/core/localization/specs.py +143 -0
- bootstack/core/mixins/__init__.py +1 -0
- bootstack/core/mixins/ttk_state.py +35 -0
- bootstack/core/mixins/widget.py +132 -0
- bootstack/core/publisher.py +147 -0
- bootstack/core/signals/README.md +112 -0
- bootstack/core/signals/__init__.py +8 -0
- bootstack/core/signals/integration.py +100 -0
- bootstack/core/signals/signal.py +317 -0
- bootstack/core/signals/types.py +4 -0
- bootstack/core/validation/__init__.py +5 -0
- bootstack/core/validation/types.py +13 -0
- bootstack/core/validation/validation_result.py +17 -0
- bootstack/core/validation/validation_rules.py +112 -0
- bootstack/core/variables.py +62 -0
- bootstack/datasource/README.md +607 -0
- bootstack/datasource/__init__.py +51 -0
- bootstack/datasource/base.py +474 -0
- bootstack/datasource/file_source.py +541 -0
- bootstack/datasource/memory_source.py +482 -0
- bootstack/datasource/sqlite_source.py +453 -0
- bootstack/datasource/types.py +259 -0
- bootstack/dialogs/__init__.py +56 -0
- bootstack/dialogs/colorchooser.py +674 -0
- bootstack/dialogs/colordropper.py +257 -0
- bootstack/dialogs/datedialog.py +404 -0
- bootstack/dialogs/dialog.py +514 -0
- bootstack/dialogs/filterdialog.py +358 -0
- bootstack/dialogs/fontdialog.py +339 -0
- bootstack/dialogs/formdialog.py +541 -0
- bootstack/dialogs/message.py +489 -0
- bootstack/dialogs/query.py +561 -0
- bootstack/py.typed +1 -0
- bootstack/runtime/__init__.py +3 -0
- bootstack/runtime/app.py +879 -0
- bootstack/runtime/base_window.py +786 -0
- bootstack/runtime/events.py +399 -0
- bootstack/runtime/menu.py +510 -0
- bootstack/runtime/shortcuts.py +423 -0
- bootstack/runtime/tk_patch.py +31 -0
- bootstack/runtime/toplevel.py +131 -0
- bootstack/runtime/utility.py +371 -0
- bootstack/runtime/visual_focus.py +228 -0
- bootstack/runtime/window_utilities.py +1043 -0
- bootstack/style/__init__.py +5498 -0
- bootstack/style/bootstyle.py +507 -0
- bootstack/style/bootstyle_builder_base.py +752 -0
- bootstack/style/bootstyle_builder_mixed.py +93 -0
- bootstack/style/bootstyle_builder_tk.py +109 -0
- bootstack/style/bootstyle_builder_ttk.py +354 -0
- bootstack/style/builders/__init__.py +51 -0
- bootstack/style/builders/badge.py +44 -0
- bootstack/style/builders/button.py +453 -0
- bootstack/style/builders/buttongroup.py +344 -0
- bootstack/style/builders/calendar.py +271 -0
- bootstack/style/builders/checkbutton.py +95 -0
- bootstack/style/builders/combobox.py +112 -0
- bootstack/style/builders/contextmenu.py +268 -0
- bootstack/style/builders/entry.py +83 -0
- bootstack/style/builders/expander.py +171 -0
- bootstack/style/builders/field.py +312 -0
- bootstack/style/builders/frame.py +27 -0
- bootstack/style/builders/label.py +28 -0
- bootstack/style/builders/labelframe.py +41 -0
- bootstack/style/builders/listview.py +267 -0
- bootstack/style/builders/menubar.py +74 -0
- bootstack/style/builders/menubutton.py +408 -0
- bootstack/style/builders/notebook.py +316 -0
- bootstack/style/builders/panedwindow.py +25 -0
- bootstack/style/builders/progressbar.py +71 -0
- bootstack/style/builders/radiobutton.py +68 -0
- bootstack/style/builders/scale.py +66 -0
- bootstack/style/builders/scrollbar.py +360 -0
- bootstack/style/builders/separator.py +45 -0
- bootstack/style/builders/sidenav.py +313 -0
- bootstack/style/builders/sizegrip.py +15 -0
- bootstack/style/builders/spinbox.py +119 -0
- bootstack/style/builders/switch.py +67 -0
- bootstack/style/builders/tabitem.py +205 -0
- bootstack/style/builders/toolbutton.py +260 -0
- bootstack/style/builders/tooltip.py +26 -0
- bootstack/style/builders/treeview.py +269 -0
- bootstack/style/builders/utils.py +404 -0
- bootstack/style/builders_tk/__init__.py +16 -0
- bootstack/style/builders_tk/defaults.py +229 -0
- bootstack/style/element.py +173 -0
- bootstack/style/style.py +499 -0
- bootstack/style/theme_provider.py +449 -0
- bootstack/style/tk_patch.py +5 -0
- bootstack/style/token_maps.py +42 -0
- bootstack/style/types.py +32 -0
- bootstack/style/typography.py +527 -0
- bootstack/style/utility.py +696 -0
- bootstack/themes/__init__.py +12 -0
- bootstack/themes/standard.py +415 -0
- bootstack/themes/user.py +45 -0
- bootstack/widgets/__init__.py +53 -0
- bootstack/widgets/composites/__init__.py +38 -0
- bootstack/widgets/composites/accordion.py +385 -0
- bootstack/widgets/composites/appshell.py +445 -0
- bootstack/widgets/composites/buttongroup.py +391 -0
- bootstack/widgets/composites/calendar.py +914 -0
- bootstack/widgets/composites/compositeframe.py +282 -0
- bootstack/widgets/composites/contextmenu.py +1754 -0
- bootstack/widgets/composites/dateentry.py +261 -0
- bootstack/widgets/composites/dropdownbutton.py +190 -0
- bootstack/widgets/composites/expander.py +508 -0
- bootstack/widgets/composites/field.py +448 -0
- bootstack/widgets/composites/floodgauge.py +434 -0
- bootstack/widgets/composites/form.py +983 -0
- bootstack/widgets/composites/labeledscale.py +209 -0
- bootstack/widgets/composites/list/__init__.py +15 -0
- bootstack/widgets/composites/list/listitem.py +733 -0
- bootstack/widgets/composites/list/listview.py +1507 -0
- bootstack/widgets/composites/menubar.py +303 -0
- bootstack/widgets/composites/meter.py +882 -0
- bootstack/widgets/composites/numericentry.py +183 -0
- bootstack/widgets/composites/pagestack.py +330 -0
- bootstack/widgets/composites/passwordentry.py +149 -0
- bootstack/widgets/composites/pathentry.py +223 -0
- bootstack/widgets/composites/radiogroup.py +466 -0
- bootstack/widgets/composites/scrolledtext.py +388 -0
- bootstack/widgets/composites/scrolledtext.pyi +186 -0
- bootstack/widgets/composites/scrollview.py +675 -0
- bootstack/widgets/composites/selectbox.py +544 -0
- bootstack/widgets/composites/sidenav/__init__.py +24 -0
- bootstack/widgets/composites/sidenav/group.py +485 -0
- bootstack/widgets/composites/sidenav/header.py +83 -0
- bootstack/widgets/composites/sidenav/item.py +413 -0
- bootstack/widgets/composites/sidenav/separator.py +51 -0
- bootstack/widgets/composites/sidenav/view.py +919 -0
- bootstack/widgets/composites/spinnerentry.py +232 -0
- bootstack/widgets/composites/tableview/__init__.py +5 -0
- bootstack/widgets/composites/tableview/tableview.py +2254 -0
- bootstack/widgets/composites/tableview/types.py +169 -0
- bootstack/widgets/composites/tabs/__init__.py +6 -0
- bootstack/widgets/composites/tabs/tabitem.py +372 -0
- bootstack/widgets/composites/tabs/tabs.py +478 -0
- bootstack/widgets/composites/tabs/tabview.py +352 -0
- bootstack/widgets/composites/textentry.py +90 -0
- bootstack/widgets/composites/timeentry.py +189 -0
- bootstack/widgets/composites/toast.py +364 -0
- bootstack/widgets/composites/togglegroup.py +382 -0
- bootstack/widgets/composites/toolbar.py +393 -0
- bootstack/widgets/composites/tooltip.py +404 -0
- bootstack/widgets/internal/__init__.py +0 -0
- bootstack/widgets/internal/wrapper_base.py +304 -0
- bootstack/widgets/mixins/__init__.py +25 -0
- bootstack/widgets/mixins/configure_mixin.py +186 -0
- bootstack/widgets/mixins/entry_mixin.py +70 -0
- bootstack/widgets/mixins/font_mixin.py +346 -0
- bootstack/widgets/mixins/icon_mixin.py +38 -0
- bootstack/widgets/mixins/localization_mixin.py +255 -0
- bootstack/widgets/mixins/signal_mixin.py +272 -0
- bootstack/widgets/mixins/validation_mixin.py +204 -0
- bootstack/widgets/parts/__init__.py +11 -0
- bootstack/widgets/parts/numberentry_part.py +345 -0
- bootstack/widgets/parts/spinnerentry_part.py +394 -0
- bootstack/widgets/parts/textentry_part.py +344 -0
- bootstack/widgets/primitives/__init__.py +55 -0
- bootstack/widgets/primitives/badge.py +44 -0
- bootstack/widgets/primitives/button.py +89 -0
- bootstack/widgets/primitives/card.py +66 -0
- bootstack/widgets/primitives/checkbutton.py +124 -0
- bootstack/widgets/primitives/checktoggle.py +53 -0
- bootstack/widgets/primitives/combobox.py +165 -0
- bootstack/widgets/primitives/entry.py +98 -0
- bootstack/widgets/primitives/frame.py +206 -0
- bootstack/widgets/primitives/gridframe.py +479 -0
- bootstack/widgets/primitives/label.py +95 -0
- bootstack/widgets/primitives/labelframe.py +63 -0
- bootstack/widgets/primitives/menubutton.py +118 -0
- bootstack/widgets/primitives/notebook.py +551 -0
- bootstack/widgets/primitives/optionmenu.py +248 -0
- bootstack/widgets/primitives/packframe.py +228 -0
- bootstack/widgets/primitives/panedwindow.py +58 -0
- bootstack/widgets/primitives/progressbar.py +95 -0
- bootstack/widgets/primitives/radiobutton.py +115 -0
- bootstack/widgets/primitives/radiotoggle.py +50 -0
- bootstack/widgets/primitives/scale.py +85 -0
- bootstack/widgets/primitives/scrollbar.py +56 -0
- bootstack/widgets/primitives/separator.py +56 -0
- bootstack/widgets/primitives/sizegrip.py +47 -0
- bootstack/widgets/primitives/spinbox.py +91 -0
- bootstack/widgets/primitives/switch.py +41 -0
- bootstack/widgets/primitives/treeview.py +77 -0
- bootstack/widgets/types.py +20 -0
- bootstack-0.1.0a1.dist-info/METADATA +196 -0
- bootstack-0.1.0a1.dist-info/RECORD +419 -0
- bootstack-0.1.0a1.dist-info/WHEEL +5 -0
- bootstack-0.1.0a1.dist-info/entry_points.txt +2 -0
- bootstack-0.1.0a1.dist-info/licenses/LICENSE +22 -0
- bootstack-0.1.0a1.dist-info/licenses/NOTICE +10 -0
- bootstack-0.1.0a1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
"""Notebook widget style builders.
|
|
2
|
+
|
|
3
|
+
This module contains style builders for ttk.Notebook widget and variants.
|
|
4
|
+
|
|
5
|
+
# TODO add styles in the future that are geared towards left direction navigation
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from bootstack.style.bootstyle_builder_ttk import BootstyleBuilderTTk
|
|
11
|
+
from bootstack.style.element import Element, ElementImage
|
|
12
|
+
from bootstack.style.utility import recolor_element_image
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _client_border_image(surface: str, accent: str, show_border: bool):
|
|
16
|
+
border_accent = accent if show_border else surface
|
|
17
|
+
return recolor_element_image(
|
|
18
|
+
"notebook_client_border",
|
|
19
|
+
surface,
|
|
20
|
+
border_accent,
|
|
21
|
+
surface,
|
|
22
|
+
surface,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _border_image(surface: str, accent: str, border: str, show_border: bool):
|
|
27
|
+
border_accent = border if show_border else surface
|
|
28
|
+
return recolor_element_image(
|
|
29
|
+
"border",
|
|
30
|
+
accent,
|
|
31
|
+
border_accent,
|
|
32
|
+
surface,
|
|
33
|
+
surface,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _notebook_layout(ttk_style: str) -> Element:
|
|
38
|
+
return Element(f"{ttk_style}.Notebook.border").children(
|
|
39
|
+
[
|
|
40
|
+
Element(f"{ttk_style}.Tab", side="top", expand=True),
|
|
41
|
+
Element(f"{ttk_style}.Notebook.client", sticky="nsew"),
|
|
42
|
+
]
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@BootstyleBuilderTTk.register_builder('default', 'TNotebook')
|
|
47
|
+
@BootstyleBuilderTTk.register_builder('tab', 'TNotebook')
|
|
48
|
+
def build_tabs_notebook(b: BootstyleBuilderTTk, ttk_style: str, accent: str = None, **options):
|
|
49
|
+
surface_token = options.get('surface') or "background"
|
|
50
|
+
surface = b.color(surface_token)
|
|
51
|
+
border_color = b.border(surface)
|
|
52
|
+
show_border = options.get('show_border', True)
|
|
53
|
+
|
|
54
|
+
# notebook colors
|
|
55
|
+
tab_active_color = surface
|
|
56
|
+
tab_accent_color = b.color(accent or 'background[+1]')
|
|
57
|
+
tab_accent_hover = b.active(tab_accent_color)
|
|
58
|
+
|
|
59
|
+
tab_active_foreground = b.on_color(surface)
|
|
60
|
+
tab_accent_foreground = b.on_color(tab_accent_color)
|
|
61
|
+
tab_disabled_foreground = b.disabled('text')
|
|
62
|
+
tab_active_border = b.border(surface)
|
|
63
|
+
|
|
64
|
+
# notebook border assets, style and layout
|
|
65
|
+
client_border_img = _client_border_image(surface, tab_accent_color, show_border)
|
|
66
|
+
|
|
67
|
+
b.create_style_element_image(
|
|
68
|
+
ElementImage(
|
|
69
|
+
f'{ttk_style}.Notebook.client', client_border_img.image,
|
|
70
|
+
border=client_border_img.meta.border
|
|
71
|
+
)
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
tab_border_img = _border_image(surface, tab_accent_color, border_color, show_border)
|
|
75
|
+
|
|
76
|
+
b.create_style_element_image(
|
|
77
|
+
ElementImage(f"{ttk_style}.Notebook.border", tab_border_img.image, border=tab_border_img.meta.border)
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
b.create_style_layout(
|
|
81
|
+
ttk_style,
|
|
82
|
+
_notebook_layout(ttk_style),
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
tab_active_img = recolor_element_image(
|
|
86
|
+
'notebook_tab_active', tab_active_color, tab_active_border)
|
|
87
|
+
tab_normal_img = recolor_element_image(
|
|
88
|
+
'notebook_tab_normal', tab_accent_color, tab_accent_color, tab_active_border, tab_accent_color)
|
|
89
|
+
tab_hover_img = recolor_element_image(
|
|
90
|
+
'notebook_tab_normal', tab_accent_hover, tab_accent_hover, tab_active_border, tab_accent_color)
|
|
91
|
+
|
|
92
|
+
b.create_style_element_image(
|
|
93
|
+
ElementImage(
|
|
94
|
+
f'{ttk_style}.Notebook.tab', tab_normal_img.image,
|
|
95
|
+
sticky='nsew', padding=tab_normal_img.meta.border, border=tab_normal_img.meta.border,
|
|
96
|
+
height=b.scale(24)).state_specs(
|
|
97
|
+
[
|
|
98
|
+
('selected', tab_active_img.image),
|
|
99
|
+
('active', tab_hover_img.image),
|
|
100
|
+
('', tab_normal_img.image),
|
|
101
|
+
])
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
b.create_style_layout(
|
|
105
|
+
f"{ttk_style}.Tab",
|
|
106
|
+
Element(f"{ttk_style}.Notebook.tab").children(
|
|
107
|
+
[
|
|
108
|
+
Element("Notebook.padding", side="top").children(
|
|
109
|
+
[
|
|
110
|
+
Element("Notebook.label")
|
|
111
|
+
]
|
|
112
|
+
)
|
|
113
|
+
]
|
|
114
|
+
)
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
b.configure_style(
|
|
118
|
+
f"{ttk_style}.Tab",
|
|
119
|
+
font="body",
|
|
120
|
+
foreground=tab_accent_foreground,
|
|
121
|
+
padding=b.scale((14, 0)))
|
|
122
|
+
|
|
123
|
+
b.map_style(
|
|
124
|
+
f"{ttk_style}.Tab",
|
|
125
|
+
foreground=[
|
|
126
|
+
('disabled', tab_disabled_foreground),
|
|
127
|
+
('selected !disabled', tab_active_foreground),
|
|
128
|
+
('active !selected !disabled', tab_accent_foreground),
|
|
129
|
+
('', tab_accent_foreground),
|
|
130
|
+
]
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
# general notebook style
|
|
134
|
+
b.configure_style(ttk_style, padding=b.scale((3, 6, 3, 3)), tabmargins=(*b.scale([6, 4, 0]), -1))
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
@BootstyleBuilderTTk.register_builder('pill', 'TNotebook')
|
|
138
|
+
def build_pill_notebook(b: BootstyleBuilderTTk, ttk_style: str, accent: str = None, **options):
|
|
139
|
+
surface_token = options.get('surface') or "background"
|
|
140
|
+
surface = b.color(surface_token)
|
|
141
|
+
|
|
142
|
+
# notebook pill colors
|
|
143
|
+
pill_active_color = b.color(accent or 'primary')
|
|
144
|
+
pill_active_border_color = b.border(pill_active_color)
|
|
145
|
+
pill_active_foreground = b.on_color(pill_active_color)
|
|
146
|
+
pill_normal_color = surface
|
|
147
|
+
pill_normal_foreground = b.on_color(pill_normal_color)
|
|
148
|
+
pill_disabled_foreground = b.disabled('text', surface)
|
|
149
|
+
pill_normal_hover = b.subtle(accent or 'primary', surface)
|
|
150
|
+
|
|
151
|
+
# notebook border assets & style
|
|
152
|
+
notebook_border = b.border(surface)
|
|
153
|
+
show_border = options.get('show_border', True)
|
|
154
|
+
|
|
155
|
+
notebook_border_img = _border_image(surface, surface, notebook_border, show_border)
|
|
156
|
+
b.create_style_element_image(
|
|
157
|
+
ElementImage(f'{ttk_style}.Notebook.border', notebook_border_img.image, border=notebook_border_img.meta.border)
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
# notebook border assets, style and layout
|
|
161
|
+
client_border_img = _client_border_image(surface, surface, False)
|
|
162
|
+
b.create_style_element_image(
|
|
163
|
+
ElementImage(
|
|
164
|
+
f'{ttk_style}.Notebook.client', client_border_img.image,
|
|
165
|
+
border=client_border_img.meta.border
|
|
166
|
+
)
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
b.create_style_layout(
|
|
170
|
+
ttk_style,
|
|
171
|
+
_notebook_layout(ttk_style),
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
# notebook tab assets & style
|
|
175
|
+
pill_active_img = recolor_element_image(
|
|
176
|
+
'notebook_pill', pill_active_color, pill_active_border_color, surface, surface)
|
|
177
|
+
pill_normal_img = recolor_element_image(
|
|
178
|
+
'notebook_pill', pill_normal_color, pill_normal_color, surface, surface)
|
|
179
|
+
pill_normal_hover_img = recolor_element_image(
|
|
180
|
+
'notebook_pill', pill_normal_hover, pill_normal_hover, surface, surface)
|
|
181
|
+
|
|
182
|
+
b.create_style_element_image(
|
|
183
|
+
ElementImage(
|
|
184
|
+
f'{ttk_style}.Notebook.tab', pill_normal_img.image,
|
|
185
|
+
sticky='nsew', padding=pill_normal_img.meta.border, border=pill_normal_img.meta.border,
|
|
186
|
+
height=b.scale(24)).state_specs(
|
|
187
|
+
[
|
|
188
|
+
('selected', pill_active_img.image),
|
|
189
|
+
('active !selected', pill_normal_hover_img.image),
|
|
190
|
+
('', pill_normal_img.image),
|
|
191
|
+
])
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
b.create_style_layout(
|
|
195
|
+
f'{ttk_style}.Tab',
|
|
196
|
+
Element(f'{ttk_style}.Notebook.tab', sticky="nsew").children(
|
|
197
|
+
[
|
|
198
|
+
Element('Notebook.padding', side='top').children(
|
|
199
|
+
[
|
|
200
|
+
Element('Notebook.label')
|
|
201
|
+
])
|
|
202
|
+
])
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
b.configure_style(
|
|
206
|
+
f"{ttk_style}.Tab",
|
|
207
|
+
foreground=pill_normal_foreground,
|
|
208
|
+
font="body",
|
|
209
|
+
padding=b.scale((14, 0)))
|
|
210
|
+
|
|
211
|
+
b.map_style(
|
|
212
|
+
f"{ttk_style}.Tab",
|
|
213
|
+
foreground=[
|
|
214
|
+
('disabled', pill_disabled_foreground),
|
|
215
|
+
('selected !disabled', pill_active_foreground),
|
|
216
|
+
('active !selected !disabled', pill_normal_foreground),
|
|
217
|
+
('', pill_normal_foreground),
|
|
218
|
+
]
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
b.configure_style(ttk_style, padding=b.scale(3), tabmargins=b.scale((6, 6, 0, 0)))
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
@BootstyleBuilderTTk.register_builder('bar', 'TNotebook')
|
|
225
|
+
def build_bar_notebook(b: BootstyleBuilderTTk, ttk_style: str, accent: str = None, **options):
|
|
226
|
+
surface_token = options.get('surface') or "background"
|
|
227
|
+
surface = b.color(surface_token)
|
|
228
|
+
border_color = b.border(surface)
|
|
229
|
+
show_border = options.get('show_border', True)
|
|
230
|
+
|
|
231
|
+
# notebook colors
|
|
232
|
+
accent_color = b.color(accent or 'primary')
|
|
233
|
+
foreground = b.on_color(surface)
|
|
234
|
+
disabled = b.disabled('text', surface)
|
|
235
|
+
hover = b.subtle(accent or 'primary', surface)
|
|
236
|
+
|
|
237
|
+
client_border_img = _client_border_image(surface, border_color, show_border)
|
|
238
|
+
|
|
239
|
+
b.create_style_element_image(
|
|
240
|
+
ElementImage(
|
|
241
|
+
f"{ttk_style}.Notebook.client",
|
|
242
|
+
client_border_img.image,
|
|
243
|
+
border=client_border_img.meta.border,
|
|
244
|
+
)
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
tab_border_img = _border_image(surface, surface, border_color, show_border)
|
|
248
|
+
|
|
249
|
+
b.create_style_element_image(
|
|
250
|
+
ElementImage(
|
|
251
|
+
f"{ttk_style}.Notebook.border",
|
|
252
|
+
tab_border_img.image,
|
|
253
|
+
border=tab_border_img.meta.border
|
|
254
|
+
)
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
b.create_style_layout(
|
|
258
|
+
ttk_style,
|
|
259
|
+
_notebook_layout(ttk_style),
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
active_img = recolor_element_image("notebook_tab_bar", surface, surface, accent_color, surface)
|
|
263
|
+
active_hover_img = recolor_element_image("notebook_tab_bar", hover, surface, accent_color, surface)
|
|
264
|
+
normal_img = recolor_element_image("notebook_tab_bar", surface, surface, surface, surface)
|
|
265
|
+
hover_img = recolor_element_image("notebook_tab_bar", hover, surface, hover, surface)
|
|
266
|
+
|
|
267
|
+
b.create_style_element_image(
|
|
268
|
+
ElementImage(
|
|
269
|
+
f"{ttk_style}.Notebook.tab", normal_img.image, sticky="nsew",
|
|
270
|
+
padding=normal_img.meta.border, border=normal_img.meta.border, height=b.scale(24)
|
|
271
|
+
).state_specs(
|
|
272
|
+
[
|
|
273
|
+
("selected !disabled", active_img.image),
|
|
274
|
+
("active selected !disabled", active_hover_img.image),
|
|
275
|
+
("active !selected !disabled", hover_img.image),
|
|
276
|
+
("", normal_img.image),
|
|
277
|
+
]
|
|
278
|
+
)
|
|
279
|
+
)
|
|
280
|
+
|
|
281
|
+
b.create_style_layout(
|
|
282
|
+
f"{ttk_style}.Tab",
|
|
283
|
+
Element(f"{ttk_style}.Notebook.tab").children(
|
|
284
|
+
[
|
|
285
|
+
Element("Notebook.padding", side="top").children(
|
|
286
|
+
[
|
|
287
|
+
Element("Notebook.label")
|
|
288
|
+
]
|
|
289
|
+
)
|
|
290
|
+
]
|
|
291
|
+
)
|
|
292
|
+
)
|
|
293
|
+
|
|
294
|
+
b.configure_style(
|
|
295
|
+
f"{ttk_style}.Tab",
|
|
296
|
+
foreground=foreground,
|
|
297
|
+
font="body",
|
|
298
|
+
focuscolor="",
|
|
299
|
+
padding=b.scale((14, 0)),
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
b.map_style(
|
|
303
|
+
f"{ttk_style}.Tab",
|
|
304
|
+
foreground=[
|
|
305
|
+
("disabled", disabled),
|
|
306
|
+
("", foreground),
|
|
307
|
+
],
|
|
308
|
+
)
|
|
309
|
+
|
|
310
|
+
# General notebook style (similar to Forest's: -padding 2 + margins)
|
|
311
|
+
b.configure_style(
|
|
312
|
+
ttk_style,
|
|
313
|
+
background=surface,
|
|
314
|
+
padding=b.scale(3),
|
|
315
|
+
tabmargins=b.scale((4, 6, 0, 0)),
|
|
316
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Panedwindow widget style builders.
|
|
2
|
+
|
|
3
|
+
This module contains style builders for ttk.Panedwindow widget and variants.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from bootstack.style.bootstyle_builder_ttk import BootstyleBuilderTTk
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@BootstyleBuilderTTk.register_builder('default', 'TPanedwindow')
|
|
12
|
+
def build_paned_window_style(b: BootstyleBuilderTTk, ttk_style: str, accent: str = None, **options):
|
|
13
|
+
accent_token = accent or 'border'
|
|
14
|
+
surface_token = options.get('surface', 'content')
|
|
15
|
+
sash_thickness = options.get('sash_thickness', b.scale(6))
|
|
16
|
+
|
|
17
|
+
surface = b.color(surface_token)
|
|
18
|
+
if accent_token == 'border':
|
|
19
|
+
accent_color = b.border(surface)
|
|
20
|
+
else:
|
|
21
|
+
accent_color = b.color(accent_token)
|
|
22
|
+
|
|
23
|
+
# Sash thickness is a global adjustment that affects all paned windows
|
|
24
|
+
b.configure_style("Sash", sashthickness=sash_thickness, gripcount=0)
|
|
25
|
+
b.configure_style(ttk_style, background=accent_color)
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""Progressbar widget style builders.
|
|
2
|
+
|
|
3
|
+
This module contains style builders for ttk.Progressbar widgets and variants.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from bootstack.style.bootstyle_builder_ttk import BootstyleBuilderTTk
|
|
9
|
+
from bootstack.style.element import Element, ElementImage
|
|
10
|
+
from bootstack.style.utility import recolor_element_image
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@BootstyleBuilderTTk.register_builder('default', 'TProgressbar')
|
|
14
|
+
def build_default_progressbar_style(b: BootstyleBuilderTTk, ttk_style: str, accent: str = 'primary', **options):
|
|
15
|
+
build_progressbar_style(b, ttk_style, accent, 'default', **options)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@BootstyleBuilderTTk.register_builder('striped', 'TProgressbar')
|
|
19
|
+
def build_striped_progressbar_style(b: BootstyleBuilderTTk, ttk_style: str, accent: str = 'primary', **options):
|
|
20
|
+
build_progressbar_style(b, ttk_style, accent, 'striped', **options)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@BootstyleBuilderTTk.register_builder('thin', 'TProgressbar')
|
|
24
|
+
def build_thin_progressbar_style(b: BootstyleBuilderTTk, ttk_style: str, accent: str = 'primary', **options):
|
|
25
|
+
build_progressbar_style(b, ttk_style, accent, 'thin', **options)
|
|
26
|
+
|
|
27
|
+
def build_progressbar_style(b: BootstyleBuilderTTk, ttk_style: str, accent: str, variant: str, **options):
|
|
28
|
+
orient = options.get("orient")
|
|
29
|
+
surface_token = options.get("surface", "content")
|
|
30
|
+
|
|
31
|
+
# style colors
|
|
32
|
+
background = b.color(surface_token)
|
|
33
|
+
trough_color = b.border(background)
|
|
34
|
+
trough_disabled = b.disabled("background")
|
|
35
|
+
bar_color = b.color(accent or "primary")
|
|
36
|
+
bar_disabled = b.disabled("text")
|
|
37
|
+
|
|
38
|
+
sticky = "ew" if orient == "horizontal" else "ns"
|
|
39
|
+
side = "left" if orient == "horizontal" else "top"
|
|
40
|
+
|
|
41
|
+
bar_image_key = f'progress_bar_{orient}_{variant}'
|
|
42
|
+
trough_image_key = bar_image_key if variant == 'thin' else f"progress_bar_{orient}_trough"
|
|
43
|
+
|
|
44
|
+
trough_normal_img = recolor_element_image(trough_image_key, trough_color, trough_color)
|
|
45
|
+
trough_disabled_img = recolor_element_image(trough_image_key, trough_disabled, trough_disabled)
|
|
46
|
+
bar_normal_img = recolor_element_image(bar_image_key, background, bar_color)
|
|
47
|
+
bar_disabled_img = recolor_element_image(bar_image_key, background, bar_disabled)
|
|
48
|
+
element_prefix = ttk_style.replace('TProgressbar', 'Progressbar')
|
|
49
|
+
|
|
50
|
+
b.create_style_element_image(
|
|
51
|
+
ElementImage(
|
|
52
|
+
f"{element_prefix}.trough", trough_normal_img.image, sticky='nsew').state_specs(
|
|
53
|
+
[
|
|
54
|
+
('disabled', trough_disabled_img.image)
|
|
55
|
+
]))
|
|
56
|
+
|
|
57
|
+
b.create_style_element_image(
|
|
58
|
+
ElementImage(f"{element_prefix}.pbar", bar_normal_img.image).state_specs(
|
|
59
|
+
[
|
|
60
|
+
('disabled', bar_disabled_img.image)
|
|
61
|
+
]))
|
|
62
|
+
|
|
63
|
+
b.create_style_layout(
|
|
64
|
+
ttk_style,
|
|
65
|
+
Element(f'{element_prefix}.trough', sticky="nsew").children(
|
|
66
|
+
[
|
|
67
|
+
Element(f'{element_prefix}.pbar', sticky=sticky, side=side)
|
|
68
|
+
]))
|
|
69
|
+
|
|
70
|
+
b.configure_style(ttk_style, background=background)
|
|
71
|
+
b.map_style(ttk_style, background=[])
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""Radio Button widget style builders.
|
|
2
|
+
|
|
3
|
+
This module contains style builders for ttk.Radiobutton widgets and variants.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from bootstack.style.bootstyle_builder_ttk import BootstyleBuilderTTk
|
|
9
|
+
from bootstack.style.element import Element, ElementImage
|
|
10
|
+
from bootstack.style.utility import create_transparent_image, recolor_element_image
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@BootstyleBuilderTTk.register_builder('default', 'TRadiobutton')
|
|
14
|
+
def build_radiobutton_style(b: BootstyleBuilderTTk, ttk_style: str, accent: str = 'primary', **options):
|
|
15
|
+
accent_token = accent or 'primary'
|
|
16
|
+
surface_token = options.get('surface', 'content')
|
|
17
|
+
|
|
18
|
+
background = b.color(surface_token)
|
|
19
|
+
background_hover = b.active(background)
|
|
20
|
+
foreground = b.on_color(background)
|
|
21
|
+
foreground_disabled = b.disabled('text', background)
|
|
22
|
+
|
|
23
|
+
normal = b.color(accent_token)
|
|
24
|
+
hovered = b.active(normal)
|
|
25
|
+
border = b.border(background)
|
|
26
|
+
focus = hovered
|
|
27
|
+
focus_ring = b.focus_ring(normal, background)
|
|
28
|
+
|
|
29
|
+
normal_checked_img = recolor_element_image('radio_selected', background, normal, background)
|
|
30
|
+
normal_unchecked_img = recolor_element_image('radio_unselected', background, border, background)
|
|
31
|
+
|
|
32
|
+
focus_checked_img = recolor_element_image('radio_selected', background, focus, focus_ring)
|
|
33
|
+
focus_unchecked_img = recolor_element_image('radio_unselected', background_hover, focus, focus_ring)
|
|
34
|
+
|
|
35
|
+
disabled_checked_img = recolor_element_image('radio_selected', background, foreground_disabled, background)
|
|
36
|
+
disabled_unchecked_img = recolor_element_image('radio_unselected', background, foreground_disabled, background)
|
|
37
|
+
|
|
38
|
+
spacer_img = create_transparent_image(6, 1)
|
|
39
|
+
b.create_style_element_image(ElementImage(f'{ttk_style}.spacer', spacer_img, sticky="ew"))
|
|
40
|
+
|
|
41
|
+
b.create_style_element_image(
|
|
42
|
+
ElementImage(f'{ttk_style}.indicator', normal_unchecked_img.image, sticky="ns", padding=b.scale(4)).state_specs(
|
|
43
|
+
[
|
|
44
|
+
# Disabled states
|
|
45
|
+
('disabled selected', disabled_checked_img.image),
|
|
46
|
+
('disabled !selected !alternate', disabled_unchecked_img.image),
|
|
47
|
+
|
|
48
|
+
# Focused states
|
|
49
|
+
('focus selected', focus_checked_img.image),
|
|
50
|
+
('focus !selected !alternate', focus_unchecked_img.image),
|
|
51
|
+
|
|
52
|
+
# Normal base states
|
|
53
|
+
('selected', normal_checked_img.image),
|
|
54
|
+
('!selected !alternate', normal_unchecked_img.image),
|
|
55
|
+
]
|
|
56
|
+
))
|
|
57
|
+
|
|
58
|
+
b.create_style_layout(
|
|
59
|
+
ttk_style, Element('Radiobutton.padding', sticky="nsew").children(
|
|
60
|
+
[
|
|
61
|
+
Element(f'{ttk_style}.indicator', side="left", sticky=""),
|
|
62
|
+
Element(f'{ttk_style}.spacer', side="left"),
|
|
63
|
+
Element('Radiobutton.label', side="left", sticky="nsew")
|
|
64
|
+
])
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
b.configure_style(ttk_style, background=background, foreground=foreground, font="body")
|
|
68
|
+
b.map_style(ttk_style, background=[], foreground=[('disabled', foreground_disabled), ('', foreground)])
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""Scale widget style builders.
|
|
2
|
+
|
|
3
|
+
This module contains style builders for ttk.Scale widget and variants.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from bootstack.style.bootstyle_builder_ttk import BootstyleBuilderTTk
|
|
9
|
+
from bootstack.style.element import Element, ElementImage
|
|
10
|
+
from bootstack.style.utility import recolor_element_image
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@BootstyleBuilderTTk.register_builder('default', 'TScale')
|
|
14
|
+
def build_scale_style(b: BootstyleBuilderTTk, ttk_style: str, accent: str = 'primary', **options):
|
|
15
|
+
accent_token = accent or 'primary'
|
|
16
|
+
surface_token = options.get('surface', 'content')
|
|
17
|
+
orient = options.get('orient', 'vertical').title()
|
|
18
|
+
|
|
19
|
+
background = b.color(surface_token)
|
|
20
|
+
foreground = b.on_color(background)
|
|
21
|
+
foreground_disabled = b.disabled("text")
|
|
22
|
+
track_color = b.border(background)
|
|
23
|
+
handle_normal = b.color(accent_token)
|
|
24
|
+
handle_pressed = b.pressed(handle_normal)
|
|
25
|
+
handle_disabled = b.disabled("text")
|
|
26
|
+
track_disabled = b.disabled("background")
|
|
27
|
+
|
|
28
|
+
# style images
|
|
29
|
+
handle_normal_img = recolor_element_image("slider_handle", background, handle_normal)
|
|
30
|
+
handle_pressed_img = recolor_element_image("slider_handle_focus", background, handle_normal)
|
|
31
|
+
handle_focus_img = recolor_element_image("slider_handle_focus", background, handle_pressed)
|
|
32
|
+
handle_disabled_img = recolor_element_image("slider_handle", handle_disabled, handle_disabled)
|
|
33
|
+
|
|
34
|
+
track_normal_img = recolor_element_image(f"slider_track_{orient.lower()}", track_color)
|
|
35
|
+
track_disabled_img = recolor_element_image(f"slider_track_{orient.lower()}", track_disabled)
|
|
36
|
+
sticky = "ew" if orient == "Horizontal" else "ns"
|
|
37
|
+
side = "left" if orient == "Horizontal" else "top"
|
|
38
|
+
|
|
39
|
+
b.create_style_element_image(
|
|
40
|
+
ElementImage(f"{ttk_style}.{orient}.Scale.slider", handle_normal_img.image,
|
|
41
|
+
width=handle_normal_img.meta.height,
|
|
42
|
+
height=handle_normal_img.meta.width,
|
|
43
|
+
sticky=''
|
|
44
|
+
).state_specs(
|
|
45
|
+
[
|
|
46
|
+
('disabled', handle_disabled_img.image),
|
|
47
|
+
('background focus', handle_focus_img.image),
|
|
48
|
+
('pressed', handle_pressed_img.image),
|
|
49
|
+
]))
|
|
50
|
+
|
|
51
|
+
b.create_style_element_image(
|
|
52
|
+
ElementImage(f"{ttk_style}.{orient}.Scale.trough", track_normal_img.image,
|
|
53
|
+
padding=track_normal_img.meta.padding,
|
|
54
|
+
border=track_normal_img.meta.border).state_specs(
|
|
55
|
+
[
|
|
56
|
+
('disabled', track_disabled_img.image)
|
|
57
|
+
]))
|
|
58
|
+
|
|
59
|
+
b.create_style_layout(
|
|
60
|
+
ttk_style, Element(f"{orient}.Scale.padding", sticky=sticky).children(
|
|
61
|
+
[
|
|
62
|
+
Element(f'{ttk_style}.{orient}.Scale.trough', sticky=sticky),
|
|
63
|
+
Element(f'{ttk_style}.{orient}.Scale.slider', sticky="", side=side)]))
|
|
64
|
+
|
|
65
|
+
b.configure_style(ttk_style, background=background, foreground=foreground)
|
|
66
|
+
b.map_style(ttk_style, background=[], foreground=[('disabled', foreground_disabled), ('', foreground)])
|