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

Use notifications for theme and translation changes to update ValueSlider

This commit is contained in:
Emmanouil Papadeas 2022-10-01 01:51:01 +03:00
parent 52b3eae418
commit 9adf74392a
2 changed files with 7 additions and 6 deletions

View file

@ -1,7 +1,5 @@
extends Node
signal theme_changed
var theme_index := 0
var theme_button_group := ButtonGroup.new()
@ -100,7 +98,6 @@ func change_theme(id: int) -> void:
# Sets disabled theme color on palette swatches
Global.palette_panel.reset_empty_palette_swatches_color()
emit_signal("theme_changed")
func change_clear_color() -> void:

View file

@ -26,9 +26,11 @@ onready var line_edit: LineEdit = $LineEdit
func _ready() -> void:
reset_display()
if not Engine.editor_hint:
yield(get_tree(), "idle_frame")
Global.preferences_dialog.themes.connect("theme_changed", self, "reset_display")
func _notification(what: int) -> void:
if what == NOTIFICATION_THEME_CHANGED or what == NOTIFICATION_TRANSLATION_CHANGED:
reset_display()
func _gui_input(event: InputEvent) -> void:
@ -133,6 +135,8 @@ func _confirm_text(confirm := true) -> void:
func reset_display() -> void:
if not line_edit:
return
line_edit.selecting_enabled = false # Remove the selection
line_edit.editable = false
tint_under = get_color("under_color", "ValueSlider")