From 3a981eb15aeb4fca7ff2815dbd33e0016deeaaef Mon Sep 17 00:00:00 2001 From: Domi31tls Date: Mon, 29 Jun 2026 19:29:12 +0200 Subject: [PATCH] =?UTF-8?q?feat(gui):=20dropzone=20cliquable=20+=20libell?= =?UTF-8?q?=C3=A9=20honn=C3=AAte=20(P1-1,=20DnD=20natif=20diff=C3=A9r?= =?UTF-8?q?=C3=A9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- gui_v6/tabs/tab_usage.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/gui_v6/tabs/tab_usage.py b/gui_v6/tabs/tab_usage.py index d78c782..92d3822 100644 --- a/gui_v6/tabs/tab_usage.py +++ b/gui_v6/tabs/tab_usage.py @@ -129,9 +129,19 @@ class UsageTab(ctk.CTkFrame): docs, fg_color=p["divider"], border_color=p["card_border"], border_width=2, corner_radius=8 ) dz.pack(fill="x", padx=16, pady=(0, 8)) - ctk.CTkLabel(dz, text="⬆️", font=ui_kit.font(30)).pack(pady=(20, 4)) - ctk.CTkLabel(dz, text="Choisissez vos fichiers", text_color=p["text"], font=ui_kit.font(14)).pack() - ctk.CTkLabel(dz, text="PDF · Word · Images · Texte", text_color=p["text_muted"], font=ui_kit.font(12)).pack(pady=(2, 10)) + # Zone réellement cliquable (ouvre le sélecteur de fichier). Le DnD natif + # est différé ; on ne laisse pas une métaphore « déposer » trompeuse. + dz.configure(cursor="hand2") + dz.bind("", lambda _e: self._pick_file()) + for _txt, _color, _size, _pady in ( + ("⬆️", p["text"], 30, (20, 4)), + ("Cliquez pour choisir un fichier", p["text"], 14, 0), + ("PDF · Word · Images · Texte", p["text_muted"], 12, (2, 10)), + ): + _lbl = ctk.CTkLabel(dz, text=_txt, text_color=_color, font=ui_kit.font(_size)) + _lbl.configure(cursor="hand2") + _lbl.bind("", lambda _e: self._pick_file()) + _lbl.pack(pady=_pady) acts = ctk.CTkFrame(dz, fg_color="transparent") acts.pack(pady=(0, 20)) ui_kit.secondary_button(acts, p, "📄 Fichier", command=self._pick_file).pack(side="left", padx=4)