From 9828c4838edeb150a9e01719f7155a84234230b6 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas Date: Fri, 16 Dec 2022 21:34:58 +0200 Subject: [PATCH] Change ValueSlider's text color And use the previous color only when they're disabled. --- src/UI/Nodes/ValueSlider.gd | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/UI/Nodes/ValueSlider.gd b/src/UI/Nodes/ValueSlider.gd index 93d07b0d8..9f6196abe 100644 --- a/src/UI/Nodes/ValueSlider.gd +++ b/src/UI/Nodes/ValueSlider.gd @@ -193,6 +193,12 @@ func _reset_display() -> void: return line_edit.selecting_enabled = false # Remove the selection line_edit.editable = false + var line_edit_color := line_edit.get_color("font_color") + var line_edit_disabled_color: Color = Global.control.theme.get_color("read_only", "LineEdit") + if editable: + line_edit.add_color_override("font_color_uneditable", line_edit_color) + else: + line_edit.add_color_override("font_color_uneditable", line_edit_disabled_color) tint_under = get_color("under_color", "ValueSlider") if show_progress: tint_progress = get_color("progress_color", "ValueSlider")