From b968b3e2b38f75b7a8cc00fc8c66e1deb9c295d1 Mon Sep 17 00:00:00 2001 From: faroukbmiled Date: Sat, 23 Sep 2023 13:04:43 +0100 Subject: [PATCH] added description line in details --- boiiiwd_package/src/library_tab.py | 7 ++++--- boiiiwd_package/src/main.py | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/boiiiwd_package/src/library_tab.py b/boiiiwd_package/src/library_tab.py index e3cbe4d..6856375 100644 --- a/boiiiwd_package/src/library_tab.py +++ b/boiiiwd_package/src/library_tab.py @@ -648,9 +648,10 @@ class LibraryTab(ctk.CTkScrollableFrame): shortened_description = f"{description[:30]}... (View)" if len(description) > 30 else description description_lab = ctk.CTkLabel(info_frame, text=f"Description: {shortened_description.strip()}") description_lab.grid(row=1, column=0, columnspan=2, sticky="w", padx=20, pady=5) - description_lab_tooltip = CTkToolTip(description_lab, message="View description", topmost=True) - description_lab.configure(cursor="hand2") - description_lab.bind("", lambda e: show_description(e)) + if len(description) > 30: + description_lab_tooltip = CTkToolTip(description_lab, message="View description", topmost=True) + description_lab.configure(cursor="hand2") + description_lab.bind("", lambda e: show_description(e)) id_label = ctk.CTkLabel(info_frame, text=f"ID: {workshop_id} | Folder: {os.path.basename(folder)}") id_label.grid(row=2, column=0, columnspan=2, sticky="w", padx=20, pady=5) diff --git a/boiiiwd_package/src/main.py b/boiiiwd_package/src/main.py index fe9421a..75091ba 100644 --- a/boiiiwd_package/src/main.py +++ b/boiiiwd_package/src/main.py @@ -708,9 +708,10 @@ class BOIIIWD(ctk.CTk): shortened_description = f"{description[:30]}... (View)" if len(description) > 30 else description description_lab = ctk.CTkLabel(info_frame, text=f"Description: {shortened_description.strip()}") description_lab.grid(row=1, column=0, columnspan=2, sticky="w", padx=20, pady=5) - description_lab_tooltip = CTkToolTip(description_lab, message="View description", topmost=True) - description_lab.configure(cursor="hand2") - description_lab.bind("", lambda e: show_description(e)) + if len(description) > 30: + description_lab_tooltip = CTkToolTip(description_lab, message="View description", topmost=True) + description_lab.configure(cursor="hand2") + description_lab.bind("", lambda e: show_description(e)) type_label = ctk.CTkLabel(info_frame, text=f"Type: {map_mod_type}") type_label.grid(row=2, column=0, columnspan=2, sticky="w", padx=20, pady=5)