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:
parent
52b3eae418
commit
9adf74392a
|
@ -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:
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue