From 1446796eb890706190e41005c4a88630b9ad6420 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 9 Sep 2020 16:18:23 +0100 Subject: [PATCH] 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. --- EDMarketConnector.py | 1 + theme.py | 1 + 2 files changed, 2 insertions(+) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 6b65c0ae..7d13346e 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -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) diff --git a/theme.py b/theme.py index ab6d89e9..f1a97721 100644 --- a/theme.py +++ b/theme.py @@ -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.