From 8377ab80799a08d70dbcb3b50252fc4448a0ae40 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 7 Sep 2022 14:56:12 +0100 Subject: [PATCH] UI: Attempt to add a ttk.Sizegrip to the main UI * To ensure it goes in the correct place I've changed the self.status text Label to be inside a `status_row` tk.Frame, with the Label in the first column, and added the Sizegrip in the second column. * This works, but there are at least two issues. 1. Due to this being a **ttk** widget the theming doesn't apply to it. 2. When switching themes there are errors due to `Theme.py:_Theme._update_widget()` trying to set `foreground` on things that don't have it. --- EDMarketConnector.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 283c3bf5..fb072601 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -526,19 +526,35 @@ class AppWindow(object): else: appitem.grid(columnspan=2, sticky=tk.EW) + ####################################################################### # LANG: Update button in main window self.button = ttk.Button(frame, text=_('Update'), width=28, default=tk.ACTIVE, state=tk.DISABLED) self.theme_button = tk.Label(frame, width=32 if sys.platform == 'darwin' else 28, state=tk.DISABLED) - self.status = tk.Label(frame, name='status', anchor=tk.W) ui_row = frame.grid_size()[1] self.button.grid(row=ui_row, columnspan=2, sticky=tk.NSEW) self.theme_button.grid(row=ui_row, columnspan=2, sticky=tk.NSEW) theme.register_alternate((self.button, self.theme_button, self.theme_button), {'row': ui_row, 'columnspan': 2, 'sticky': tk.NSEW}) - self.status.grid(columnspan=2, sticky=tk.EW) self.button.bind('', self.capi_request_data) theme.button_bind(self.theme_button, self.capi_request_data) + ####################################################################### + + ####################################################################### + # Status line + self.status_row = tk.Frame(frame, name='status_row') + self.status_row.grid(columnspan=2, sticky=tk.NSEW) + self.status_row.columnconfigure(0, weight=99) + self.status_row.columnconfigure(1, weight=1) + + self.status = tk.Label(self.status_row, name='status', anchor=tk.W) + self.status.grid(row=0, column=0, sticky=tk.W) + + # Make the window resizable + master.resizable(True, False) + ttk_grip = ttk.Sizegrip(self.status_row, name='size_grip') + ttk_grip.grid(row=0, column=1, sticky=tk.SE) + ####################################################################### for child in frame.winfo_children(): child.grid_configure(padx=self.PADX, pady=(