Font Size Selector (#245)
This commit is contained in:
parent
da8ba4db93
commit
98cb3ef743
@ -134,6 +134,12 @@ class KlipperScreenConfig:
|
|||||||
{"24htime": {"section": "main", "name": _("24 Hour Time"), "type": "binary", "value": "True"}},
|
{"24htime": {"section": "main", "name": _("24 Hour Time"), "type": "binary", "value": "True"}},
|
||||||
{"side_macro_shortcut": {"section": "main", "name": _("Macro shortcut on sidebar"), "type": "binary",
|
{"side_macro_shortcut": {"section": "main", "name": _("Macro shortcut on sidebar"), "type": "binary",
|
||||||
"value": "True", "callback": screen.toggle_macro_shortcut}},
|
"value": "True", "callback": screen.toggle_macro_shortcut}},
|
||||||
|
{"font_size": {"section": "main", "name": _("Font Size"), "type": "dropdown",
|
||||||
|
"value": "medium", "callback": screen.restart_warning, "options":[
|
||||||
|
{"name": _("Small"), "value": "small"},
|
||||||
|
{"name": _("Medium (default)"), "value": "medium"},
|
||||||
|
{"name": _("Large"), "value": "large"},
|
||||||
|
]}},
|
||||||
#{"": {"section": "main", "name": _(""), "type": ""}}
|
#{"": {"section": "main", "name": _(""), "type": ""}}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -430,7 +430,14 @@ class KlipperScreen(Gtk.Window):
|
|||||||
css = open(klipperscreendir + "/styles/%s/style.css" % (self.theme))
|
css = open(klipperscreendir + "/styles/%s/style.css" % (self.theme))
|
||||||
css_data = css.read()
|
css_data = css.read()
|
||||||
css.close()
|
css.close()
|
||||||
|
|
||||||
self.font_size = self.gtk.get_font_size()
|
self.font_size = self.gtk.get_font_size()
|
||||||
|
fontsize_type = self._config.get_main_config_option("font_size","medium")
|
||||||
|
if fontsize_type != "medium":
|
||||||
|
if fontsize_type == "small":
|
||||||
|
self.font_size = round(self.font_size * 0.91)
|
||||||
|
elif (fontsize_type == "large"):
|
||||||
|
self.font_size = round(self.font_size * 1.09)
|
||||||
css_data = css_data.replace("KS_FONT_SIZE",str(self.font_size))
|
css_data = css_data.replace("KS_FONT_SIZE",str(self.font_size))
|
||||||
|
|
||||||
style_provider = Gtk.CssProvider()
|
style_provider = Gtk.CssProvider()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user