feat(gui): dropzone cliquable + libellé honnête (P1-1, DnD natif différé)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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("<Button-1>", 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("<Button-1>", 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)
|
||||
|
||||
Reference in New Issue
Block a user