Cosmetic UI tweaks
authorJakob Cornell <jakob@jcornell.net>
Tue, 7 Jan 2020 02:29:52 +0000 (20:29 -0600)
committerJakob Cornell <jakob@jcornell.net>
Tue, 7 Jan 2020 02:29:52 +0000 (20:29 -0600)
main.py

diff --git a/main.py b/main.py
index ac2e236f0a9923152bd8e8b74d015b71dce52732..41448c19e77afce0e0948271bdf1a04538ce7da7 100644 (file)
--- a/main.py
+++ b/main.py
@@ -177,6 +177,7 @@ class MainView(View):
                self.propagate = defaultdict(lambda: True)
                self.root = tk.Tk()
                self.root.title("Tutoring Tool")
+               self.root.resizable(False, False)
 
                def on_close():
                        if self.editor_views:
@@ -237,6 +238,8 @@ class MainView(View):
                        dialog = tk.Toplevel(self.root)
                        dialog.title("Generate plot")
                        dialog.minsize(250, 0)
+                       dialog.resizable(False, False)
+                       dialog.bind('<Escape>', lambda *_: dialog.destroy())
                        type_var = tk.StringVar(self.root)
                        select_frame = tk.Frame(dialog)
                        type_select = ttk.OptionMenu(select_frame, type_var)
@@ -389,6 +392,7 @@ class DataEditView(View):
                        if do:
                                self.finish()
                self.root = tk.Toplevel(parent)
+               self.root.resizable(False, False)
                self.root.protocol('WM_DELETE_WINDOW', on_close)
                scroll_frame = VertScrollingFrame(self.root)
                self.grid = scroll_frame.content_frame
@@ -420,7 +424,7 @@ class DataEditView(View):
                cancel_btn.pack(side = 'left', **TK_PAD)
                buttons.pack()
 
-               label_for = lambda name: tk.Label(self.grid, text = name, width = 10)
+               label_for = lambda name: tk.Label(self.grid, text = name, width = 15)
                labels = list(map(label_for, DataEditModel.Record.DISPLAY_NAMES))
                for (col, label) in enumerate(labels):
                        label.grid(row = 0, column = col)
@@ -477,7 +481,7 @@ class DataEditView(View):
 
        def install_row(self, ord_, controls):
                for (col, control) in enumerate(controls):
-                       control.grid(row = ord_, column = col)
+                       control.grid(row = ord_, column = col, sticky = 'EW')
 
        class DataError(Exception):
                def __init__(self, row, column):