From 3c39e28d72fdb8dfad700f11ef640eb4e571af33 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Wed, 6 May 2020 01:36:14 +0300 Subject: [PATCH] Change selected frame label color based on theme --- assets/themes/dark/theme.tres | 10 ++++++++++ assets/themes/godot/theme.tres | 1 + assets/themes/gold/theme.tres | 1 + assets/themes/gray/theme.tres | 10 ++++++++++ assets/themes/light/theme.tres | 1 + src/Autoload/Global.gd | 2 +- 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/assets/themes/dark/theme.tres b/assets/themes/dark/theme.tres index 0f8af6707..36b58ccf9 100644 --- a/assets/themes/dark/theme.tres +++ b/assets/themes/dark/theme.tres @@ -426,6 +426,16 @@ HSplitContainer/constants/autohide = 1 HSplitContainer/constants/separation = 6 HSplitContainer/icons/grabber = ExtResource( 4 ) HSplitContainer/styles/bg = SubResource( 19 ) +"Label/colors/Selected Color" = Color( 0.235294, 0.364706, 0.458824, 1 ) +Label/colors/font_color = Color( 1, 1, 1, 1 ) +Label/colors/font_color_shadow = Color( 0, 0, 0, 0 ) +Label/colors/font_outline_modulate = Color( 1, 1, 1, 1 ) +Label/constants/line_spacing = 3 +Label/constants/shadow_as_outline = 0 +Label/constants/shadow_offset_x = 1 +Label/constants/shadow_offset_y = 1 +Label/fonts/font = null +Label/styles/normal = null LineEdit/colors/clear_button_color = Color( 0.878431, 0.878431, 0.878431, 1 ) LineEdit/colors/clear_button_color_pressed = Color( 1, 1, 1, 1 ) LineEdit/colors/cursor_color = Color( 0.941176, 0.941176, 0.941176, 1 ) diff --git a/assets/themes/godot/theme.tres b/assets/themes/godot/theme.tres index adf4cae03..9b88c3ac9 100644 --- a/assets/themes/godot/theme.tres +++ b/assets/themes/godot/theme.tres @@ -10418,6 +10418,7 @@ ItemList/styles/cursor = SubResource( 1408 ) ItemList/styles/cursor_unfocused = SubResource( 1408 ) ItemList/styles/selected = SubResource( 1409 ) ItemList/styles/selected_focus = SubResource( 1410 ) +"Label/colors/Selected Color" = Color( 0.545098, 0.619608, 0.788235, 1 ) Label/colors/font_color = Color( 0.8, 0.8075, 0.8275, 1 ) Label/colors/font_color_shadow = Color( 0, 0, 0, 0 ) Label/constants/line_spacing = 2 diff --git a/assets/themes/gold/theme.tres b/assets/themes/gold/theme.tres index 1a61dbc5d..cb2cb5945 100644 --- a/assets/themes/gold/theme.tres +++ b/assets/themes/gold/theme.tres @@ -366,6 +366,7 @@ HSplitContainer/constants/autohide = 1 HSplitContainer/constants/separation = 6 HSplitContainer/icons/grabber = ExtResource( 1 ) HSplitContainer/styles/bg = null +"Label/colors/Selected Color" = Color( 0.235294, 0.364706, 0.458824, 1 ) Label/colors/font_color = Color( 0, 0, 0, 1 ) Label/colors/font_color_shadow = Color( 0, 0, 0, 0 ) Label/colors/font_outline_modulate = Color( 0, 0, 0, 1 ) diff --git a/assets/themes/gray/theme.tres b/assets/themes/gray/theme.tres index e91145a60..f29b1bc79 100644 --- a/assets/themes/gray/theme.tres +++ b/assets/themes/gray/theme.tres @@ -377,6 +377,16 @@ HSplitContainer/constants/autohide = 1 HSplitContainer/constants/separation = 6 HSplitContainer/icons/grabber = SubResource( 20 ) HSplitContainer/styles/bg = null +"Label/colors/Selected Color" = Color( 0.235294, 0.364706, 0.458824, 1 ) +Label/colors/font_color = Color( 1, 1, 1, 1 ) +Label/colors/font_color_shadow = Color( 0, 0, 0, 0 ) +Label/colors/font_outline_modulate = Color( 1, 1, 1, 1 ) +Label/constants/line_spacing = 3 +Label/constants/shadow_as_outline = 0 +Label/constants/shadow_offset_x = 1 +Label/constants/shadow_offset_y = 1 +Label/fonts/font = null +Label/styles/normal = null LineEdit/colors/clear_button_color = Color( 0.878431, 0.878431, 0.878431, 1 ) LineEdit/colors/clear_button_color_pressed = Color( 1, 1, 1, 1 ) LineEdit/colors/cursor_color = Color( 0.941176, 0.941176, 0.941176, 1 ) diff --git a/assets/themes/light/theme.tres b/assets/themes/light/theme.tres index 6c5fc87e7..7fbe8209c 100644 --- a/assets/themes/light/theme.tres +++ b/assets/themes/light/theme.tres @@ -376,6 +376,7 @@ HSplitContainer/constants/autohide = 1 HSplitContainer/constants/separation = 6 HSplitContainer/icons/grabber = ExtResource( 1 ) HSplitContainer/styles/bg = null +"Label/colors/Selected Color" = Color( 0.545098, 0.619608, 0.788235, 1 ) Label/colors/font_color = Color( 0, 0, 0, 1 ) Label/colors/font_color_shadow = Color( 0, 0, 0, 0 ) Label/colors/font_outline_modulate = Color( 0, 0, 0, 1 ) diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index 099673652..2ad93d873 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -644,7 +644,7 @@ func frame_changed(value : int) -> void: # Select the new canvas/frame canvas = canvases[current_frame] canvas.visible = true - frame_ids.get_child(current_frame).add_color_override("font_color", Color("#3c5d75")) + frame_ids.get_child(current_frame).add_color_override("font_color", control.theme.get_color("Selected Color", "Label")) if current_frame < layers[current_layer][3].get_child_count(): layers[current_layer][3].get_child(current_frame).pressed = true