From d46d3a4e687b72c991d8e6a8fb5ba37f4987829d Mon Sep 17 00:00:00 2001 From: Gabriel Couture Date: Fri, 23 Jul 2021 12:34:40 -0400 Subject: [PATCH] Fix window size issue for lower resolution (may need improvement) --- spectrominer/ui/app.py | 4 ++-- spectrominer/ui/main_frame.py | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/spectrominer/ui/app.py b/spectrominer/ui/app.py index 57d1420..58edf83 100644 --- a/spectrominer/ui/app.py +++ b/spectrominer/ui/app.py @@ -8,9 +8,9 @@ class App(tkinter.Tk): def __init__(self): super().__init__() - self.geometry('1400x900') self.winfo_toplevel().title('Spectrominer') # Title - MainFrame(self) + mainframe = MainFrame(self) + self.geometry(f'1400x{230 + mainframe.table_height}') def start(): diff --git a/spectrominer/ui/main_frame.py b/spectrominer/ui/main_frame.py index c941104..df6b1aa 100644 --- a/spectrominer/ui/main_frame.py +++ b/spectrominer/ui/main_frame.py @@ -24,6 +24,8 @@ def __init__(self, root: tkinter.Tk, **kw): self.theoretical_correction_applied: bool = False self.relative_result = tkinter.IntVar() + self.table_height = 500 + # Widgets self.cb_molecule = ttk.Combobox(self.root, values=[], state='readonly') self.cb_molecule.bind('<>', self.recalculate_results) @@ -61,16 +63,16 @@ def __init__(self, root: tkinter.Tk, **kw): command=self.recalculate_results, ).place(x=630, y=125, width=130, height=25) self.btn_apply_experimental_corrections.place(x=780, y=125, width=300, height=25) - self.cb_m_value.place(x=50, y=840, width=115, height=30) - self.btn_show_histogram.place(x=200, y=840, width=150, height=30) - self.btn_export.place(x=1050, y=840, width=180, height=30) - self.btn_export_all.place(x=1250, y=840, width=115, height=30) + self.cb_m_value.place(x=50, y=self.table_height+180, width=115, height=30) + self.btn_show_histogram.place(x=200, y=self.table_height+180, width=150, height=30) + self.btn_export.place(x=1050, y=self.table_height+180, width=180, height=30) + self.btn_export_all.place(x=1250, y=self.table_height+180, width=115, height=30) def _set_table(self): del self.scrollbar self.scrollbar = ttk.Scrollbar(self.root) - self.scrollbar.place(x=1350, y=160, width=20, height=660) - self.table.place(x=50, y=160, width=1300, height=660) + self.scrollbar.place(x=1350, y=160, width=20, height=self.table_height) + self.table.place(x=50, y=160, width=1300, height=self.table_height) self.scrollbar.config(command=self.table.yview) self.table.config(yscrollcommand=self.scrollbar.set)