Skip to content

Commit

Permalink
Fix window size issue for lower resolution (may need improvement)
Browse files Browse the repository at this point in the history
  • Loading branch information
gacou54 committed Jul 23, 2021
1 parent 55b82d3 commit d46d3a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions spectrominer/ui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
14 changes: 8 additions & 6 deletions spectrominer/ui/main_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('<<ComboboxSelected>>', self.recalculate_results)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d46d3a4

Please sign in to comment.