From 8d030a64f2e16db3400ae4bde30153eefee23525 Mon Sep 17 00:00:00 2001 From: wood chen Date: Sat, 16 Nov 2024 08:35:09 +0800 Subject: [PATCH] =?UTF-8?q?style(gui):=20refine=20drag=20and=20drop=20UI?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gui.py | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/gui.py b/gui.py index f0c6ee4..73051f3 100644 --- a/gui.py +++ b/gui.py @@ -386,23 +386,11 @@ class VideoToGifConverter: self.file_frame = ttk.LabelFrame(self.root, text="选择文件") self.file_frame.pack(padx=10, pady=5, fill="x") - # 添加拖放提示框 + # 添加拖放提示 if SUPPORT_DND: - self.drop_frame = ttk.Frame(self.file_frame, style="Dropzone.TFrame") - self.drop_frame.pack(fill="both", expand=True, padx=10, pady=10) - - ttk.Label(self.drop_frame, text="拖放视频文件到这里", font=("", 12)).pack( - pady=20 - ) - - # 添加拖放效果 - self.drop_frame.bind( - "", - lambda e: self.drop_frame.configure(style="DropzoneHover.TFrame"), - ) - self.drop_frame.bind( - "", lambda e: self.drop_frame.configure(style="Dropzone.TFrame") - ) + ttk.Label( + self.file_frame, text="可以直接拖放视频文件到此处", foreground="blue" + ).pack(pady=5) self.files_list = tk.Listbox(self.file_frame, height=5) self.files_list.pack(padx=5, pady=5, fill="x") @@ -411,9 +399,6 @@ class VideoToGifConverter: if SUPPORT_DND == "macos": self.files_list.bind("<>", self.handle_macos_drop) - self.files_list = tk.Listbox(self.file_frame, height=5) - self.files_list.pack(padx=5, pady=5, fill="x") - btn_frame = ttk.Frame(self.file_frame) btn_frame.pack(fill="x", padx=5, pady=5)