1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 15:57:14 +03:00

UI Scaling: Store pre-fiddling default in theme.default_ui_scale

This is in case anything needs to know the ratio between what was the
default and what we then set it to.
This commit is contained in:
Athanasius 2020-09-09 16:18:23 +01:00
parent c5518cf763
commit 1446796eb8
2 changed files with 2 additions and 0 deletions

View File

@ -1054,6 +1054,7 @@ if __name__ == "__main__":
if not ui_scaling:
ui_scaling = '0.0'
config.set('ui_scaling', ui_scaling)
theme.default_ui_scale = root.tk.call('tk', 'scaling')
if ui_scaling != '0.0':
root.tk.call('tk', 'scaling', float(ui_scaling))
app = AppWindow(root)

View File

@ -115,6 +115,7 @@ class _Theme(object):
self.widgets_pair = []
self.defaults = {}
self.current = {}
self.default_ui_scale = None # None == not yet known
def register(self, widget):
# Note widget and children for later application of a theme. Note if the widget has explicit fg or bg attributes.