1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

Keep current font when changing theme

This commit is contained in:
OverloadedOrama 2019-12-20 18:44:51 +02:00
parent c3e75496d6
commit 8e20ad995c

View file

@ -26,6 +26,7 @@ func _on_ThemeOption_item_selected(ID : int) -> void:
Global.config_cache.save("user://cache.ini") Global.config_cache.save("user://cache.ini")
func change_theme(ID : int) -> void: func change_theme(ID : int) -> void:
var font = Global.control.theme.default_font
var main_theme var main_theme
var top_menu_style var top_menu_style
var ruler_style var ruler_style
@ -47,6 +48,7 @@ func change_theme(ID : int) -> void:
ruler_style = preload("res://Themes & Styles/Light Theme/LightRulerStyle.tres") ruler_style = preload("res://Themes & Styles/Light Theme/LightRulerStyle.tres")
Global.control.theme = main_theme Global.control.theme = main_theme
Global.control.theme.default_font = font
Global.top_menu_container.add_stylebox_override("panel", top_menu_style) Global.top_menu_container.add_stylebox_override("panel", top_menu_style)
Global.horizontal_ruler.add_stylebox_override("normal", ruler_style) Global.horizontal_ruler.add_stylebox_override("normal", ruler_style)
Global.horizontal_ruler.add_stylebox_override("pressed", ruler_style) Global.horizontal_ruler.add_stylebox_override("pressed", ruler_style)