From 7a2a1c10400098d725aad1e65bcb2200a8975adb Mon Sep 17 00:00:00 2001 From: Maurane GLAUDE Date: Thu, 18 Jul 2024 12:04:10 +0200 Subject: [PATCH] refactor(WelcomeFrame): correct wrapping of the welcome description label --- src/antares_web_installer/gui/view.py | 4 ++-- src/antares_web_installer/gui/widgets/frame.py | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/antares_web_installer/gui/view.py b/src/antares_web_installer/gui/view.py index 8d7427c..5982d50 100644 --- a/src/antares_web_installer/gui/view.py +++ b/src/antares_web_installer/gui/view.py @@ -77,9 +77,9 @@ def initialize_styles(self): current_font = font.nametofont("TkDefaultFont").actual() # titles - ttk.Style().configure("Title.TLabel", padding=(11, 11), wraplength=self.width, font=(current_font, 20)) + ttk.Style().configure("Title.TLabel", padding=(11, 11), wraplength=self.width - 11*2, font=(current_font, 20)) # description - ttk.Style().configure("Description.TLabel", padding=(11, 5), wraplength=self.width, font=(current_font, 10)) + ttk.Style().configure("Description.TLabel", padding=(11, 5), wraplength=self.width - 11*2, font=(current_font, 10)) def change_frame(self): """ diff --git a/src/antares_web_installer/gui/widgets/frame.py b/src/antares_web_installer/gui/widgets/frame.py index 7830feb..17ee2df 100644 --- a/src/antares_web_installer/gui/widgets/frame.py +++ b/src/antares_web_installer/gui/widgets/frame.py @@ -7,10 +7,8 @@ from typing import TYPE_CHECKING from antares_web_installer.shortcuts import get_homedir - from .button import CancelBtn, BackBtn, NextBtn, FinishBtn, InstallBtn - if TYPE_CHECKING: from antares_web_installer.gui.view import WizardView @@ -99,8 +97,6 @@ class WelcomeFrame(BasicFrame): # button control def __init__(self, master: tk.Misc, window: "WizardView", index: int, *args, **kwargs): super().__init__(master, window, index, *args, **kwargs) - # global settings - # header content header_content = ttk.Label(self.header, text="Welcome to Antares Web Installer", style="Title.TLabel") header_content.pack(side="top", fill="x")