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

Fix 3D layer buttons not having the same offset as the other layer type buttons

This commit is contained in:
Emmanouil Papadeas 2024-04-10 01:25:57 +03:00
parent 1c9c8bf4e3
commit a4f06d8cbe
2 changed files with 18 additions and 13 deletions

View file

@ -45,7 +45,7 @@ func _ready() -> void:
for child in get_children(): for child in get_children():
if not child is Button: if not child is Button:
continue continue
var texture = child.get_child(0) var texture := child.get_child(0)
if not texture is TextureRect: if not texture is TextureRect:
continue continue
texture.modulate = Global.modulate_icon_color texture.modulate = Global.modulate_icon_color

View file

@ -18,7 +18,12 @@ size_flags_horizontal = 3
theme_override_constants/separation = 0 theme_override_constants/separation = 0
script = ExtResource("1_6hlpe") script = ExtResource("1_6hlpe")
[node name="VisibilityButton" type="Button" parent="." groups=["UIButtons"]] [node name="HBoxContainer" type="HBoxContainer" parent="."]
custom_minimum_size = Vector2(84, 0)
layout_mode = 2
theme_override_constants/separation = 0
[node name="VisibilityButton" type="Button" parent="HBoxContainer" groups=["UIButtons"]]
unique_name_in_owner = true unique_name_in_owner = true
custom_minimum_size = Vector2(28, 22) custom_minimum_size = Vector2(28, 22)
layout_mode = 2 layout_mode = 2
@ -26,7 +31,7 @@ tooltip_text = "Toggle layer's visibility"
focus_mode = 0 focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
[node name="TextureRect" type="TextureRect" parent="VisibilityButton"] [node name="TextureRect" type="TextureRect" parent="HBoxContainer/VisibilityButton"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -40,7 +45,7 @@ size_flags_horizontal = 0
size_flags_vertical = 0 size_flags_vertical = 0
texture = ExtResource("2_ef6fb") texture = ExtResource("2_ef6fb")
[node name="LockButton" type="Button" parent="." groups=["UIButtons"]] [node name="LockButton" type="Button" parent="HBoxContainer" groups=["UIButtons"]]
unique_name_in_owner = true unique_name_in_owner = true
custom_minimum_size = Vector2(28, 22) custom_minimum_size = Vector2(28, 22)
layout_mode = 2 layout_mode = 2
@ -48,7 +53,7 @@ tooltip_text = "Lock/unlock layer"
focus_mode = 0 focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
[node name="TextureRect" type="TextureRect" parent="LockButton"] [node name="TextureRect" type="TextureRect" parent="HBoxContainer/LockButton"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -62,7 +67,7 @@ size_flags_horizontal = 0
size_flags_vertical = 0 size_flags_vertical = 0
texture = ExtResource("3_ah1my") texture = ExtResource("3_ah1my")
[node name="LinkButton" type="Button" parent="." groups=["UIButtons"]] [node name="LinkButton" type="Button" parent="HBoxContainer" groups=["UIButtons"]]
unique_name_in_owner = true unique_name_in_owner = true
visible = false visible = false
custom_minimum_size = Vector2(28, 22) custom_minimum_size = Vector2(28, 22)
@ -73,7 +78,7 @@ Linked cels share content across multiple frames"
focus_mode = 0 focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
[node name="TextureRect" type="TextureRect" parent="LinkButton"] [node name="TextureRect" type="TextureRect" parent="HBoxContainer/LinkButton"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -87,7 +92,7 @@ size_flags_horizontal = 0
size_flags_vertical = 0 size_flags_vertical = 0
texture = ExtResource("4_058qm") texture = ExtResource("4_058qm")
[node name="ExpandButton" type="Button" parent="." groups=["UIButtons"]] [node name="ExpandButton" type="Button" parent="HBoxContainer" groups=["UIButtons"]]
unique_name_in_owner = true unique_name_in_owner = true
visible = false visible = false
custom_minimum_size = Vector2(28, 22) custom_minimum_size = Vector2(28, 22)
@ -96,7 +101,7 @@ tooltip_text = "Expand/collapse group"
focus_mode = 0 focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
[node name="TextureRect" type="TextureRect" parent="ExpandButton"] [node name="TextureRect" type="TextureRect" parent="HBoxContainer/ExpandButton"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -170,10 +175,10 @@ item_1/text = "Clipping mask"
item_1/checkable = 1 item_1/checkable = 1
item_1/id = 1 item_1/id = 1
[connection signal="pressed" from="VisibilityButton" to="." method="_on_visibility_button_pressed"] [connection signal="pressed" from="HBoxContainer/VisibilityButton" to="." method="_on_visibility_button_pressed"]
[connection signal="pressed" from="LockButton" to="." method="_on_lock_button_pressed"] [connection signal="pressed" from="HBoxContainer/LockButton" to="." method="_on_lock_button_pressed"]
[connection signal="pressed" from="LinkButton" to="." method="_on_link_button_pressed"] [connection signal="pressed" from="HBoxContainer/LinkButton" to="." method="_on_link_button_pressed"]
[connection signal="pressed" from="ExpandButton" to="." method="_on_expand_button_pressed"] [connection signal="pressed" from="HBoxContainer/ExpandButton" to="." method="_on_expand_button_pressed"]
[connection signal="gui_input" from="LayerMainButton" to="." method="_on_main_button_gui_input"] [connection signal="gui_input" from="LayerMainButton" to="." method="_on_main_button_gui_input"]
[connection signal="focus_exited" from="LayerMainButton/LayerName/LayerNameLineEdit" to="." method="_on_layer_name_line_edit_focus_exited"] [connection signal="focus_exited" from="LayerMainButton/LayerName/LayerNameLineEdit" to="." method="_on_layer_name_line_edit_focus_exited"]
[connection signal="id_pressed" from="PopupMenu" to="." method="_on_popup_menu_id_pressed"] [connection signal="id_pressed" from="PopupMenu" to="." method="_on_popup_menu_id_pressed"]