diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 4cfd4985..1898fe83 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -1038,7 +1038,7 @@ argv[0]: {sys.argv[0]} exec_prefix: {sys.exec_prefix} executable: {sys.executable} sys.path: {sys.path}''' - ) +) # TODO: unittests in place of these # logger.debug('Test from __main__') @@ -1056,13 +1056,13 @@ sys.path: {sys.path}''' Translations.install(config.get('language') or None) # Can generate errors so wait til log set up root = tk.Tk(className=appname.lower()) - ui_scaling = config.get('ui_scaling') - if not ui_scaling: - ui_scaling = '0.0' - config.set('ui_scaling', ui_scaling) + ui_scale = config.getint('ui_scale') + if not ui_scale: + ui_scale = 0 + config.set('ui_scale', ui_scale) theme.default_ui_scale = root.tk.call('tk', 'scaling') - if ui_scaling != '0.0': - root.tk.call('tk', 'scaling', float(ui_scaling)) + if ui_scale != 0: + root.tk.call('tk', 'scaling', float(ui_scale) / 100.0) app = AppWindow(root) def messagebox_not_py3(): diff --git a/L10n/en.template b/L10n/en.template index 80449841..1e5b6cb0 100644 --- a/L10n/en.template +++ b/L10n/en.template @@ -527,10 +527,10 @@ "{APP} needs permission to use shortcuts" = "{APP} needs permission to use shortcuts"; /* Label for 'UI Scaling' option [prefs.py] */ -"UI Scaling" = "UI Scaling"; +"UI Scale Percentage" = "UI Scale Percentage"; -/* Text describing that value '0.0' means 'default' [prefs.py] */ -"0.0 means Default" = "0.0 means Default"; +/* Text describing that value '0' means 'default', and changes require a restart [prefs.py] */ +"0 means Default{CR}Restart Required for{CR}changes to take effect!" = "0 means Default{CR}Restart Required for{CR}changes to take effect!"; /* Label for user configured level of logging [prefs.py] */ "Log Level" = "Log Level"; diff --git a/prefs.py b/prefs.py index 0e64f377..7643a8f6 100644 --- a/prefs.py +++ b/prefs.py @@ -340,21 +340,24 @@ class PreferencesDialog(tk.Toplevel): # UI Scaling ttk.Separator(themeframe, orient=tk.HORIZONTAL).grid(columnspan=4, padx=PADX, pady=PADY*4, sticky=tk.EW) - nb.Label(themeframe, text=_('UI Scaling')).grid(row = 23, padx=PADX, pady=2*PADY, sticky=tk.W) - self.ui_scaling = tk.DoubleVar() - self.ui_scaling.set(float(config.get('ui_scaling'))) + nb.Label(themeframe, text=_('UI Scale Percentage')).grid(row=23, padx=PADX, pady=2*PADY, sticky=tk.W) + self.ui_scale = tk.IntVar() + self.ui_scale.set(config.getint('ui_scale')) self.uiscale_bar = tk.Scale( themeframe, - variable=self.ui_scaling, + variable=self.ui_scale, orient=tk.HORIZONTAL, length=300, - from_=0.0, - to=4.0, - tickinterval=0.5, - resolution=0.1, + from_=0, + to=400, + tickinterval=50, + resolution=10, ) self.uiscale_bar.grid(row=23, column=1, sticky=tk.W) - self.ui_scaling_defaultis = nb.Label(themeframe, text=_('0.0 means Default')).grid(row=23, column=3, padx=PADX, pady=2*PADY, sticky=tk.E) + self.ui_scaling_defaultis = nb.Label( + themeframe, + text=_('0 means Default{CR}Restart Required for{CR}changes to take effect!') + ).grid(row=23, column=3, padx=PADX, pady=2*PADY, sticky=tk.E) # Always on top ttk.Separator(themeframe, orient=tk.HORIZONTAL).grid(columnspan=3, padx=PADX, pady=PADY*4, sticky=tk.EW) @@ -648,8 +651,7 @@ class PreferencesDialog(tk.Toplevel): config.set('language', lang_codes.get(self.lang.get()) or '') Translations.install(config.get('language') or None) - config.set('ui_scaling', str(self.ui_scaling.get())) - # self.tk.call('tk', 'scaling', self.ui_scaling.get()) + config.set('ui_scale', self.ui_scale.get()) config.set('always_ontop', self.always_ontop.get()) config.set('theme', self.theme.get()) config.set('dark_text', self.theme_colors[0])