remove custom size for custom style so that text can scale, scale the remaining node icons from the node picker, scale node's name

This commit is contained in:
Huy Pham 2020-02-12 14:13:28 -08:00
parent 7fbbfa8c63
commit 3a466fd463
5 changed files with 50 additions and 56 deletions

View file

@ -176,27 +176,27 @@ def style_listbox(widget: tk.Widget):
def theme_change(event: tk.Event):
style = ttk.Style()
style.configure(Styles.picker_button, font=("TkDefaultFont", 8, "normal"))
style.configure(Styles.picker_button, font="TkSmallCaptionFont")
style.configure(
Styles.green_alert,
background="green",
padding=0,
relief=tk.NONE,
font=("TkDefaultFont", 8, "normal"),
font="TkSmallCaptionFont",
)
style.configure(
Styles.yellow_alert,
background="yellow",
padding=0,
relief=tk.NONE,
font=("TkDefaultFont", 8, "normal"),
font="TkSmallCaptionFont",
)
style.configure(
Styles.red_alert,
background="red",
padding=0,
relief=tk.NONE,
font=("TkDefaultFont", 8, "normal"),
font="TkSmallCaptionFont",
)
@ -204,4 +204,7 @@ def scale_fonts(fonts_size, scale):
for name in font.names():
f = font.nametofont(name)
if name in fonts_size:
f.config(size=int(fonts_size[name] * scale))
if name == "TkSmallCaptionFont":
f.config(size=int(fonts_size[name] * scale * 8 / 9))
else:
f.config(size=int(fonts_size[name] * scale))