mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-20 12:33:14 +00:00
Theme preferences now get saved in the config_cache file
This commit is contained in:
parent
2fc9711788
commit
c3e75496d6
3 changed files with 15 additions and 3 deletions
|
@ -199,6 +199,9 @@ var palette_import_file_dialog : FileDialog
|
|||
var error_dialog : AcceptDialog
|
||||
|
||||
func _ready() -> void:
|
||||
# Load settings from the config file
|
||||
config_cache.load("user://cache.ini")
|
||||
|
||||
undo_redo = UndoRedo.new()
|
||||
image_clipboard = Image.new()
|
||||
|
||||
|
|
|
@ -33,9 +33,6 @@ func _ready() -> void:
|
|||
# Make sure locales are always sorted, in the same order
|
||||
Global.loaded_locales.sort()
|
||||
|
||||
# Load settings from the config file
|
||||
Global.config_cache.load("user://cache.ini")
|
||||
|
||||
# Restore the window position/size if values are present in the configuration cache
|
||||
if Global.config_cache.has_section_key("window", "screen"):
|
||||
OS.current_screen = Global.config_cache.get_value("window", "screen")
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
extends AcceptDialog
|
||||
|
||||
func _ready() -> void:
|
||||
if Global.config_cache.has_section_key("preferences", "theme"):
|
||||
var theme_id = Global.config_cache.get_value("preferences", "theme")
|
||||
change_theme(theme_id)
|
||||
$VBoxContainer/OptionsContainer/ThemeOption.selected = theme_id
|
||||
|
||||
func _on_LanguageOption_item_selected(ID : int) -> void:
|
||||
if ID == 0:
|
||||
TranslationServer.set_locale(OS.get_locale())
|
||||
|
@ -14,6 +20,12 @@ func _on_LanguageOption_item_selected(ID : int) -> void:
|
|||
Global.config_cache.save("user://cache.ini")
|
||||
|
||||
func _on_ThemeOption_item_selected(ID : int) -> void:
|
||||
change_theme(ID)
|
||||
|
||||
Global.config_cache.set_value("preferences", "theme", ID)
|
||||
Global.config_cache.save("user://cache.ini")
|
||||
|
||||
func change_theme(ID : int) -> void:
|
||||
var main_theme
|
||||
var top_menu_style
|
||||
var ruler_style
|
||||
|
|
Loading…
Add table
Reference in a new issue