bootstack 0.4.3__py3-none-any.whl → 0.4.4__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.
@@ -3,8 +3,6 @@
3
3
  A single platform-neutral menu *model* (`MenuModel` / `MenuGroup` / `MenuItem`)
4
4
  is the source of truth; platform renderers consume it — a themed in-window strip
5
5
  on Windows/Linux and the native global menu bar on macOS.
6
-
7
- See `docs/_dev/menu-redesign.md` for the design.
8
6
  """
9
7
  from __future__ import annotations
10
8
 
@@ -1,6 +1,6 @@
1
1
  """Internal composites for the clean-slate application shell.
2
2
 
3
- Layered per `docs/_dev/appshell-navigation-spec.md`:
3
+ Layered as:
4
4
 
5
5
  - `layout.ShellLayout` — Layer 1, the dumb region/slot band layout.
6
6
  - `nav_panel.NavPanel` — the static single-select nav list (sidebar).
@@ -23,14 +23,14 @@ only the body row knows whether the rail/sidebar/dock exist. That invariant lets
23
23
  "sidebar + chrome", "chrome only", and "sidebar only" be the same layout with
24
24
  slots toggled rather than separate code paths.
25
25
 
26
- Note: the resizable sidebar/content sash (a `PanedWindow`) is deferred to the
27
- collapse step — for now the body uses fixed-width pack slots. See the build order
28
- in `docs/_dev/appshell-navigation-spec.md`.
26
+ Note: the body uses fixed-width pack slots; a resizable sidebar/content sash
27
+ (a `PanedWindow`) is not built.
29
28
  """
30
29
 
31
30
  from __future__ import annotations
32
31
 
33
32
  import sys
33
+ from tkinter import TclError
34
34
  from typing import Any
35
35
 
36
36
  from bootstack._runtime.app import App
@@ -128,6 +128,7 @@ class ShellLayout(App):
128
128
  self._show_rail = False
129
129
  self._show_sidebar = True
130
130
  self._show_dock = False
131
+ self._recolor_pending = False
131
132
 
132
133
  self._build_regions()
133
134
  self._relayout_window()
@@ -206,6 +207,7 @@ class ShellLayout(App):
206
207
  self._status_sep.pack(side="bottom", fill="x")
207
208
  # Body fills whatever the bands leave; packed last so it claims the middle.
208
209
  self._body.pack(side="top", fill="both", expand=True)
210
+ self._recolor_show_slots()
209
211
 
210
212
  def _relayout_body(self) -> None:
211
213
  """Re-pack the rail / sidebar / content / dock slots left-to-right."""
@@ -221,6 +223,35 @@ class ShellLayout(App):
221
223
  self._content.pack(side="left", fill="both", expand=True)
222
224
  if self._show_dock:
223
225
  self._dock.pack(side="right", fill="y")
226
+ self._recolor_show_slots()
227
+
228
+ def _recolor_show_slots(self):
229
+ """Repaint slots that just became visible after a theme change"""
230
+ if self._recolor_pending:
231
+ return
232
+ self._recolor_pending = True
233
+
234
+ def _recolor():
235
+ self._recolor_pending = False
236
+ from bootstack.style.style import get_style
237
+ style = get_style()
238
+ shown = [self._content]
239
+ if self._show_rail:
240
+ shown.append(self._rail)
241
+ if self._show_sidebar:
242
+ shown.append(self._sidebar)
243
+ if self._show_statusbar:
244
+ shown.append(self._statusbar)
245
+ for slot in shown:
246
+ try:
247
+ style.apply_theme_walk(slot, only_stale=True)
248
+ except TclError:
249
+ pass # destroyed between relayout and the idle callback
250
+
251
+ try:
252
+ self.after_idle(_recolor)
253
+ except (TclError, AttributeError):
254
+ pass
224
255
 
225
256
  # ----- Region sizing -----
226
257
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bootstack
3
- Version: 0.4.3
3
+ Version: 0.4.4
4
4
  Summary: Build desktop GUI apps in pure Python and ship them as a standalone executable — built on Tk, no Tkinter boilerplate.
5
5
  Author-email: Israel Dryer <israel.dryer@gmail.com>
6
6
  License-Expression: MIT
@@ -369,13 +369,13 @@ bootstack/widgets/_impl/composites/tooltip.py,sha256=FN6OKJJc24l2CKWqUDxqbNgCH8r
369
369
  bootstack/widgets/_impl/composites/list/__init__.py,sha256=J-F-Fjj5IcX8EyCwSSNyZ8BN2SMrJIDBYsYSiuNt1C4,365
370
370
  bootstack/widgets/_impl/composites/list/listitem.py,sha256=wqzanMAUSxgbW7GLXgKMZlYFRgbzc_Qmi5Z_DG7Adf0,32484
371
371
  bootstack/widgets/_impl/composites/list/listview.py,sha256=LN_4bCR4XLLQsE01vyFq8G0kwdXyDnxHMDN6cskjczE,55276
372
- bootstack/widgets/_impl/composites/menu/__init__.py,sha256=EMFcYSFwUJCj-e81KZjy8k_iwG7M4WTBQ0xRXMpcGiM,546
372
+ bootstack/widgets/_impl/composites/menu/__init__.py,sha256=1flA1uz2hZE6FJTdfWXWmr1d8OhJdvTeA0ufgshL5so,494
373
373
  bootstack/widgets/_impl/composites/menu/model.py,sha256=bn3B-QqXPRE8cVNhtSWWKC2L_F4I2nQ2NpceHDLAPXU,12742
374
374
  bootstack/widgets/_impl/composites/menu/render_native.py,sha256=VwDLtnWWIlXx8ZKLpJKLK6BEhHz-IVAF1xk_pXOlaDU,4629
375
375
  bootstack/widgets/_impl/composites/menu/render_themed.py,sha256=35CY2wkr2zUtwM69eUhr-Mnr3nh6CxVzWHHp462Mfio,4808
376
- bootstack/widgets/_impl/composites/shell/__init__.py,sha256=6PE1ZskVFbKLjKOXSvV39Ht9YsUeSdZVjA2Hiqf1yn8,1412
376
+ bootstack/widgets/_impl/composites/shell/__init__.py,sha256=IGP4RcKBmz8eoJvE2p86CDPGNxCgRSIro9vMEXKAOH0,1371
377
377
  bootstack/widgets/_impl/composites/shell/content_host.py,sha256=09ebue5Q7i9JEbwlu_A8YLLp2ucuJb3K2HguV_-SFog,2122
378
- bootstack/widgets/_impl/composites/shell/layout.py,sha256=srHQaFGflacTGaotM53StXilEUcFS4D6RD--KijvaYM,14751
378
+ bootstack/widgets/_impl/composites/shell/layout.py,sha256=Uidmwrren6ZAHpuXH8SlCjRiLGkNtaOO_o8MYOimZe0,15787
379
379
  bootstack/widgets/_impl/composites/shell/nav_panel.py,sha256=6am5VuGqtYw-PI88T8B90d7vxSAqTLBZbUEvDIoaK_A,16262
380
380
  bootstack/widgets/_impl/composites/shell/providers.py,sha256=tvy9rXtcf3KnNISlwRzh_ugYzgkOJRjd-niqM4kp0ps,20178
381
381
  bootstack/widgets/_impl/composites/shell/rail.py,sha256=Z9Emy4AlXnivwqDDEtUoqOs1-a0C_l6vC8PW60YCw9Q,4927
@@ -453,10 +453,10 @@ bootstack/widgets/_impl/primitives/sizegrip.py,sha256=uwQRzOEHjNPXtUURhT6k2TNYdy
453
453
  bootstack/widgets/_impl/primitives/spinbox.py,sha256=5m0tZrqCw745nvIiBrJWnZ0q8fZ7bNEvopjROMbQolc,4526
454
454
  bootstack/widgets/_impl/primitives/switch.py,sha256=7dt43uE2P_WdkxZZsGtCFRAQ20nI2jx5VUqGSrWwEmA,2543
455
455
  bootstack/widgets/_impl/primitives/treeview.py,sha256=vnSowgzmtNEWst_i9ZgcacHjdvuheF9xmeTvTWE1bLg,2709
456
- bootstack-0.4.3.dist-info/licenses/LICENSE,sha256=CUeTPUOM8Qc0yuqneJUwuUmDBooET5UfsHjMrkdBeCg,1097
457
- bootstack-0.4.3.dist-info/licenses/NOTICE,sha256=c62TcygUKbXx1V3FEgziroDDry_NwmycqKEg_CRnYBU,1503
458
- bootstack-0.4.3.dist-info/METADATA,sha256=JKJN3UE_7DG1uuWeGPU1ysx3Lhlh7g-PcabMP4cGXHg,16107
459
- bootstack-0.4.3.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
460
- bootstack-0.4.3.dist-info/entry_points.txt,sha256=phOlfRy3Th86IYlNhQiUrTLLLzxie1IG-kMas_5iMdA,49
461
- bootstack-0.4.3.dist-info/top_level.txt,sha256=IsKBAac2vRCegvRFSCzwcBr7TpHp4bLnLFgA75LOkXs,10
462
- bootstack-0.4.3.dist-info/RECORD,,
456
+ bootstack-0.4.4.dist-info/licenses/LICENSE,sha256=CUeTPUOM8Qc0yuqneJUwuUmDBooET5UfsHjMrkdBeCg,1097
457
+ bootstack-0.4.4.dist-info/licenses/NOTICE,sha256=c62TcygUKbXx1V3FEgziroDDry_NwmycqKEg_CRnYBU,1503
458
+ bootstack-0.4.4.dist-info/METADATA,sha256=wvAP1pUf9a0zQWHNnUr2OFMu4P0E2YBkV-ry5FIOssU,16107
459
+ bootstack-0.4.4.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
460
+ bootstack-0.4.4.dist-info/entry_points.txt,sha256=phOlfRy3Th86IYlNhQiUrTLLLzxie1IG-kMas_5iMdA,49
461
+ bootstack-0.4.4.dist-info/top_level.txt,sha256=IsKBAac2vRCegvRFSCzwcBr7TpHp4bLnLFgA75LOkXs,10
462
+ bootstack-0.4.4.dist-info/RECORD,,