Skip to content

Commit

Permalink
prettier tabs in Presenter
Browse files Browse the repository at this point in the history
Change is global (Tk-wide) for all Presenters, hence modification of gui.py
  • Loading branch information
Noiredd committed Dec 15, 2019
1 parent ab5fe5f commit dd4d728
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions filmatyk/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ def __init__(self, debugMode=False, isOnLinux=False):
# construct the window: first the notebook for tabbed view
self.notebook = ttk.Notebook(root)
self.notebook.grid(row=0, column=0, padx=5, pady=5, sticky=tk.NW)
# set padding for notebook tabs
self.setStyle()
# version string
tk.Label(root, text='v{}'.format(VERSION)).grid(row=0, column=0, padx=5, pady=3, sticky=tk.NE)
# then the control panel
Expand Down Expand Up @@ -211,6 +213,14 @@ def __init__(self, debugMode=False, isOnLinux=False):
root.wm_attributes('-topmost', 0)
tk.mainloop()

def setStyle(self):
self.style = ttk.Style()
current = self.style.theme_use()
self.style.theme_settings(current, {
'TNotebook.Tab': {
'configure': {'width': 20, 'anchor': 'center'}
}
})
def centerWindow(self):
self.root.update()
ws = self.root.winfo_screenwidth()
Expand Down

0 comments on commit dd4d728

Please sign in to comment.