mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-11-20 03:02:40 +03:00
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.
This commit is contained in:
1 file changed
+18
-2
+18
-2
@@ -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('<Button-1>', 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=(
|
||||
|
||||
Reference in new issue
Block a user