fix(gui): make admin config responsive and mask editor usable

This commit is contained in:
2026-06-15 09:53:56 +02:00
parent 269b9e0e13
commit 696f6bf27c
4 changed files with 949 additions and 232 deletions

View File

@@ -2,8 +2,9 @@
Reproduit l'identité de ``docs/ui_mockup_v6.html`` : shell étroit, header avec
identité produit + version + statut licence + liseré accent, barre d'onglets
custom (pas CTkTabview brut), navigation par recréation du contenu, changement
de thème à chaud. La logique (runner moteur, config, licence) est inchangée.
custom (pas CTkTabview brut), navigation par panneaux mis en cache après leur
première ouverture visible, changement de thème à chaud. La logique (runner
moteur, config, licence) est inchangée.
La fenêtre n'est créée qu'à l'instanciation de :class:`AnonymisationApp`.
"""
@@ -41,6 +42,8 @@ class AnonymisationApp(ctk.CTk):
self._config = ConfigState()
self._active = "use"
self._tab_buttons: dict = {}
self._tab_frames: dict = {}
self._visible_tab = None
self.title("Pseudonymisation de vos documents")
self.geometry("820x880")
@@ -130,29 +133,33 @@ class AnonymisationApp(ctk.CTk):
# -- contenu ----------------------------------------------------------
def _show(self, key: str) -> None:
self._active = key
self._refresh_tabbar()
for child in self._content.winfo_children():
child.destroy()
def _create_tab(self, key: str):
p = self._palette
status = self._safe_local_status()
if key == "use":
tab = UsageTab(
return UsageTab(
self._content,
palette=p,
config_provider=lambda: self._config,
on_theme_change=self.set_theme,
current_theme=self._theme_name,
)
elif key == "cfg":
tab = ConfigTab(self._content, palette=p, state=self._config)
else:
tab = AboutTab(
self._content,
palette=p,
status=status,
theme_name=self._theme_name,
license_client=self._license_client,
)
tab.pack(fill="both", expand=True)
if key == "cfg":
return ConfigTab(self._content, palette=p, state=self._config)
return AboutTab(
self._content,
palette=p,
status=status,
theme_name=self._theme_name,
license_client=self._license_client,
)
def _show(self, key: str) -> None:
self._active = key
self._refresh_tabbar()
if self._visible_tab is not None:
self._tab_frames[self._visible_tab].pack_forget()
if key not in self._tab_frames:
self._tab_frames[key] = self._create_tab(key)
self._tab_frames[key].pack(fill="both", expand=True)
self._visible_tab = key