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

UI Scaling: Option added to Appearance tab of Settings

This commit is contained in:
Athanasius 2020-09-08 12:18:48 +01:00
parent 09add21a1a
commit ea53a60596

View File

@ -337,6 +337,20 @@ class PreferencesDialog(tk.Toplevel):
self.theme_label_1.grid(row=21, padx=PADX, sticky=tk.W)
self.theme_button_1 = nb.ColoredButton(themeframe, text=' Hutton Orbital ', background='grey4', command=lambda:self.themecolorbrowse(1)) # Do not translate
self.theme_button_1.grid(row=21, column=1, padx=PADX, pady=PADY, sticky=tk.NSEW)
# 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) # Select UI scaling
ui_scaling = config.get('ui_scaling')
if not ui_scaling:
ui_scaling = 1.0
self.ui_scaling = tk.StringVar(value=ui_scaling)
ui_scales = ( 0.5, 1.0, 1.5, 2.0, 3.0, 4.0)
self.uiscale_dropdown = nb.OptionMenu(themeframe, self.ui_scaling, self.ui_scaling.get(), *ui_scales)
self.uiscale_dropdown.configure(width=15)
self.uiscale_dropdown.grid(row=23, column=1, sticky=tk.W)
# Always on top
ttk.Separator(themeframe, orient=tk.HORIZONTAL).grid(columnspan=3, padx=PADX, pady=PADY*4, sticky=tk.EW)
self.ontop_button = nb.Checkbutton(themeframe, text=_('Always on top'), variable=self.always_ontop, command=self.themevarchanged)
self.ontop_button.grid(columnspan=3, padx=BUTTONX, sticky=tk.W) # Appearance setting
@ -632,6 +646,7 @@ class PreferencesDialog(tk.Toplevel):
config.set('theme', self.theme.get())
config.set('dark_text', self.theme_colors[0])
config.set('dark_highlight', self.theme_colors[1])
#self.tk.call('tk', 'scaling', 2.0)
theme.apply(self.parent)
# Notify