1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Let users change left and right tool colors

This commit is contained in:
Emmanouil Papadeas 2022-07-08 03:25:17 +03:00
parent a705f848c9
commit 29d590f2c2
3 changed files with 63 additions and 14 deletions

View file

@ -555,6 +555,12 @@ msgstr ""
msgid "Icon color:"
msgstr ""
msgid "Left tool color:"
msgstr ""
msgid "Right tool color:"
msgstr ""
msgid "Tool button size:"
msgstr ""

View file

@ -8,6 +8,8 @@ var preferences := [
Preference.new("dim_on_popup", "Interface/DimPopup/CheckBox", "pressed"),
Preference.new("icon_color_from", "Interface/IconColorFrom/IconColorOptionButton", "selected"),
Preference.new("custom_icon_color", "Interface/IconColorFrom/IconColorButton", "color"),
Preference.new("left_tool_color", "Interface/IconColorFrom/LeftToolColorButton", "color"),
Preference.new("right_tool_color", "Interface/IconColorFrom/RightToolColorButton", "color"),
Preference.new(
"tool_button_size", "Interface/ToolButtonSize/ToolButtonSizeOptionButton", "selected"
),
@ -266,6 +268,16 @@ func preference_update(prop: String) -> void:
Global.modulate_icon_color = Global.custom_icon_color
themes.change_icon_colors()
if prop == "left_tool_color":
for child in Tools._tool_buttons.get_children():
var left_background: NinePatchRect = child.get_node("BackgroundLeft")
left_background.modulate = Global.left_tool_color
if prop == "right_tool_color":
for child in Tools._tool_buttons.get_children():
var left_background: NinePatchRect = child.get_node("BackgroundRight")
left_background.modulate = Global.right_tool_color
if prop == "tool_button_size":
Tools.set_button_size(Global.tool_button_size)

View file

@ -130,9 +130,9 @@ text = "System Language"
[node name="Interface" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
visible = false
margin_top = 28.0
margin_top = 56.0
margin_right = 498.0
margin_bottom = 198.0
margin_bottom = 250.0
[node name="ShrinkContainer" type="HBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface"]
margin_right = 498.0
@ -232,7 +232,7 @@ margin_bottom = 90.0
[node name="IconColorFrom" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface"]
margin_top = 94.0
margin_right = 498.0
margin_bottom = 138.0
margin_bottom = 162.0
columns = 3
[node name="Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/IconColorFrom"]
@ -243,7 +243,7 @@ text = "Icon color from:"
[node name="IconColorOptionButton" type="OptionButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/IconColorFrom"]
margin_left = 106.0
margin_right = 179.0
margin_right = 199.0
margin_bottom = 20.0
mouse_default_cursor_shape = 2
text = "Theme"
@ -251,9 +251,9 @@ items = [ "Theme", null, false, 0, null, "Custom", null, false, 1, null ]
selected = 0
[node name="Label2" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/IconColorFrom"]
margin_left = 183.0
margin_left = 203.0
margin_top = 3.0
margin_right = 251.0
margin_right = 271.0
margin_bottom = 17.0
text = "Icon color:"
@ -266,15 +266,48 @@ mouse_default_cursor_shape = 2
size_flags_horizontal = 0
color = Color( 0.75, 0.75, 0.75, 1 )
[node name="HSeparator3" type="HSeparator" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface"]
margin_top = 142.0
margin_right = 498.0
margin_bottom = 146.0
[node name="Label3" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/IconColorFrom"]
margin_left = 106.0
margin_top = 27.0
margin_right = 199.0
margin_bottom = 41.0
text = "Left tool color:"
[node name="ToolButtonSize" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface"]
margin_top = 150.0
[node name="LeftToolColorButton" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/IconColorFrom"]
margin_left = 203.0
margin_top = 24.0
margin_right = 267.0
margin_bottom = 44.0
rect_min_size = Vector2( 64, 20 )
mouse_default_cursor_shape = 2
size_flags_horizontal = 0
color = Color( 0, 0.52549, 0.811765, 1 )
[node name="Label4" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/IconColorFrom"]
margin_top = 51.0
margin_right = 102.0
margin_bottom = 65.0
text = "Right tool color:"
[node name="RightToolColorButton" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/IconColorFrom"]
margin_left = 106.0
margin_top = 48.0
margin_right = 170.0
margin_bottom = 68.0
rect_min_size = Vector2( 64, 20 )
mouse_default_cursor_shape = 2
size_flags_horizontal = 0
color = Color( 0.992157, 0.427451, 0.0784314, 1 )
[node name="HSeparator3" type="HSeparator" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface"]
margin_top = 166.0
margin_right = 498.0
margin_bottom = 170.0
[node name="ToolButtonSize" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface"]
margin_top = 174.0
margin_right = 498.0
margin_bottom = 194.0
columns = 3
[node name="Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Interface/ToolButtonSize"]
@ -1174,8 +1207,6 @@ mode = 1
access = 2
filters = PoolStringArray( "*.pck ; Godot Resource Pack File", "*.zip ;" )
show_hidden_files = true
current_dir = "/home/emmanouil/Documents/Orama/Pixelorama"
current_path = "/home/emmanouil/Documents/Orama/Pixelorama/"
[connection signal="about_to_show" from="." to="." method="_on_PreferencesDialog_about_to_show"]
[connection signal="popup_hide" from="." to="." method="_on_PreferencesDialog_popup_hide"]