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

Put add/remove swatch color on the same horizontal container as the palette select and add/edit palette buttons

This allows for horizontal placement of the palette panel without any wasted space
This commit is contained in:
Emmanouil Papadeas 2023-12-16 23:13:11 +02:00
parent 9034b32d44
commit be2245ca76

View file

@ -1,8 +1,10 @@
[gd_scene load_steps=12 format=3 uid="uid://wplk62pbgih4"] [gd_scene load_steps=14 format=3 uid="uid://wplk62pbgih4"]
[ext_resource type="PackedScene" uid="uid://c0p84w7umxwt1" path="res://src/Palette/EditPaletteDialog.tscn" id="1"] [ext_resource type="PackedScene" uid="uid://c0p84w7umxwt1" path="res://src/Palette/EditPaletteDialog.tscn" id="1"]
[ext_resource type="Texture2D" uid="uid://biyn51upnlxle" path="res://assets/graphics/palette/edit.png" id="2"] [ext_resource type="Texture2D" uid="uid://biyn51upnlxle" path="res://assets/graphics/palette/edit.png" id="2"]
[ext_resource type="Texture2D" uid="uid://d1urikaf1lxwl" path="res://assets/graphics/timeline/new_frame.png" id="2_j1lig"]
[ext_resource type="Texture2D" uid="uid://b7ydn1tt37rcl" path="res://assets/graphics/palette/add.png" id="3"] [ext_resource type="Texture2D" uid="uid://b7ydn1tt37rcl" path="res://assets/graphics/palette/add.png" id="3"]
[ext_resource type="Texture2D" uid="uid://bt72662c3gp2f" path="res://assets/graphics/timeline/remove_frame.png" id="3_0e27e"]
[ext_resource type="PackedScene" uid="uid://68aakj2l6ee1" path="res://src/Palette/CreatePaletteDialog.tscn" id="4"] [ext_resource type="PackedScene" uid="uid://68aakj2l6ee1" path="res://src/Palette/CreatePaletteDialog.tscn" id="4"]
[ext_resource type="Script" path="res://src/Palette/PaletteGrid.gd" id="5"] [ext_resource type="Script" path="res://src/Palette/PaletteGrid.gd" id="5"]
[ext_resource type="Script" path="res://src/Palette/PaletteScroll.gd" id="6"] [ext_resource type="Script" path="res://src/Palette/PaletteScroll.gd" id="6"]
@ -27,11 +29,58 @@ script = ExtResource("8")
[node name="PaletteVBoxContainer" type="VBoxContainer" parent="."] [node name="PaletteVBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3
[node name="PaletteButtons" type="HBoxContainer" parent="PaletteVBoxContainer"] [node name="PaletteButtons" type="HBoxContainer" parent="PaletteVBoxContainer"]
layout_mode = 2 layout_mode = 2
[node name="AddColor" type="Button" parent="PaletteVBoxContainer/PaletteButtons" groups=["UIButtons"]]
unique_name_in_owner = true
custom_minimum_size = Vector2(24, 24)
layout_mode = 2
tooltip_text = "Add a new color"
mouse_default_cursor_shape = 2
[node name="TextureRect" type="TextureRect" parent="PaletteVBoxContainer/PaletteButtons/AddColor"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -6.0
offset_top = -6.0
offset_right = 6.0
offset_bottom = 6.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource("2_j1lig")
[node name="DeleteColor" type="Button" parent="PaletteVBoxContainer/PaletteButtons" groups=["UIButtons"]]
unique_name_in_owner = true
custom_minimum_size = Vector2(24, 0)
layout_mode = 2
tooltip_text = "Remove a selected color"
mouse_default_cursor_shape = 2
[node name="TextureRect" type="TextureRect" parent="PaletteVBoxContainer/PaletteButtons/DeleteColor"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -6.0
offset_top = -1.0
offset_right = 6.0
offset_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource("3_0e27e")
[node name="PaletteSelect" type="OptionButton" parent="PaletteVBoxContainer/PaletteButtons"] [node name="PaletteSelect" type="OptionButton" parent="PaletteVBoxContainer/PaletteButtons"]
unique_name_in_owner = true unique_name_in_owner = true
custom_minimum_size = Vector2(100, 0) custom_minimum_size = Vector2(100, 0)
@ -39,6 +88,7 @@ layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
tooltip_text = "Choose a palette" tooltip_text = "Choose a palette"
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
alignment = 1
clip_text = true clip_text = true
[node name="EditPalette" type="Button" parent="PaletteVBoxContainer/PaletteButtons" groups=["UIButtons"]] [node name="EditPalette" type="Button" parent="PaletteVBoxContainer/PaletteButtons" groups=["UIButtons"]]
@ -49,18 +99,16 @@ mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_jl8vt") shortcut = SubResource("Shortcut_jl8vt")
[node name="TextureRect" type="TextureRect" parent="PaletteVBoxContainer/PaletteButtons/EditPalette"] [node name="TextureRect" type="TextureRect" parent="PaletteVBoxContainer/PaletteButtons/EditPalette"]
layout_mode = 0 layout_mode = 1
anchor_left = 0.5 anchors_preset = 15
anchor_top = 0.5 anchor_right = 1.0
anchor_right = 0.5 anchor_bottom = 1.0
anchor_bottom = 0.5 grow_horizontal = 2
offset_left = -11.0 grow_vertical = 2
offset_top = -11.0
offset_right = 11.0
offset_bottom = 11.0
size_flags_horizontal = 0 size_flags_horizontal = 0
size_flags_vertical = 0 size_flags_vertical = 0
texture = ExtResource("2") texture = ExtResource("2")
stretch_mode = 3
[node name="AddPalette" type="Button" parent="PaletteVBoxContainer/PaletteButtons" groups=["UIButtons"]] [node name="AddPalette" type="Button" parent="PaletteVBoxContainer/PaletteButtons" groups=["UIButtons"]]
custom_minimum_size = Vector2(22, 22) custom_minimum_size = Vector2(22, 22)
@ -70,18 +118,16 @@ mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_6f4gc") shortcut = SubResource("Shortcut_6f4gc")
[node name="TextureRect" type="TextureRect" parent="PaletteVBoxContainer/PaletteButtons/AddPalette"] [node name="TextureRect" type="TextureRect" parent="PaletteVBoxContainer/PaletteButtons/AddPalette"]
layout_mode = 0 layout_mode = 1
anchor_left = 0.5 anchors_preset = 15
anchor_top = 0.5 anchor_right = 1.0
anchor_right = 0.5 anchor_bottom = 1.0
anchor_bottom = 0.5 grow_horizontal = 2
offset_left = -11.0 grow_vertical = 2
offset_top = -11.0
offset_right = 11.0
offset_bottom = 11.0
size_flags_horizontal = 0 size_flags_horizontal = 0
size_flags_vertical = 0 size_flags_vertical = 0
texture = ExtResource("3") texture = ExtResource("3")
stretch_mode = 3
[node name="HSeparator" type="HSeparator" parent="PaletteVBoxContainer"] [node name="HSeparator" type="HSeparator" parent="PaletteVBoxContainer"]
layout_mode = 2 layout_mode = 2
@ -91,25 +137,6 @@ layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="ColorButtons" type="VBoxContainer" parent="PaletteVBoxContainer/SwatchesContainer"]
layout_mode = 2
[node name="AddColor" type="Button" parent="PaletteVBoxContainer/SwatchesContainer/ColorButtons"]
unique_name_in_owner = true
custom_minimum_size = Vector2(24, 24)
layout_mode = 2
tooltip_text = "Add a new color"
mouse_default_cursor_shape = 2
text = "+"
[node name="DeleteColor" type="Button" parent="PaletteVBoxContainer/SwatchesContainer/ColorButtons"]
unique_name_in_owner = true
custom_minimum_size = Vector2(24, 24)
layout_mode = 2
tooltip_text = "Remove a selected color"
mouse_default_cursor_shape = 2
text = "-"
[node name="PaletteScroll" type="VBoxContainer" parent="PaletteVBoxContainer/SwatchesContainer"] [node name="PaletteScroll" type="VBoxContainer" parent="PaletteVBoxContainer/SwatchesContainer"]
unique_name_in_owner = true unique_name_in_owner = true
layout_mode = 2 layout_mode = 2
@ -174,11 +201,11 @@ unique_name_in_owner = true
visible = false visible = false
layout_mode = 2 layout_mode = 2
[connection signal="gui_input" from="PaletteVBoxContainer/PaletteButtons/AddColor" to="." method="_on_AddColor_gui_input"]
[connection signal="gui_input" from="PaletteVBoxContainer/PaletteButtons/DeleteColor" to="." method="_on_DeleteColor_gui_input"]
[connection signal="item_selected" from="PaletteVBoxContainer/PaletteButtons/PaletteSelect" to="." method="_on_PaletteSelect_item_selected"] [connection signal="item_selected" from="PaletteVBoxContainer/PaletteButtons/PaletteSelect" to="." method="_on_PaletteSelect_item_selected"]
[connection signal="pressed" from="PaletteVBoxContainer/PaletteButtons/EditPalette" to="." method="_on_EditPalette_pressed"] [connection signal="pressed" from="PaletteVBoxContainer/PaletteButtons/EditPalette" to="." method="_on_EditPalette_pressed"]
[connection signal="pressed" from="PaletteVBoxContainer/PaletteButtons/AddPalette" to="." method="_on_AddPalette_pressed"] [connection signal="pressed" from="PaletteVBoxContainer/PaletteButtons/AddPalette" to="." method="_on_AddPalette_pressed"]
[connection signal="gui_input" from="PaletteVBoxContainer/SwatchesContainer/ColorButtons/AddColor" to="." method="_on_AddColor_gui_input"]
[connection signal="gui_input" from="PaletteVBoxContainer/SwatchesContainer/ColorButtons/DeleteColor" to="." method="_on_DeleteColor_gui_input"]
[connection signal="gui_input" from="PaletteVBoxContainer/SwatchesContainer/PaletteScroll" to="PaletteVBoxContainer/SwatchesContainer/PaletteScroll" method="_on_PaletteScroll_gui_input"] [connection signal="gui_input" from="PaletteVBoxContainer/SwatchesContainer/PaletteScroll" to="PaletteVBoxContainer/SwatchesContainer/PaletteScroll" method="_on_PaletteScroll_gui_input"]
[connection signal="resized" from="PaletteVBoxContainer/SwatchesContainer/PaletteScroll" to="PaletteVBoxContainer/SwatchesContainer/PaletteScroll" method="_on_PaletteScroll_resized"] [connection signal="resized" from="PaletteVBoxContainer/SwatchesContainer/PaletteScroll" to="PaletteVBoxContainer/SwatchesContainer/PaletteScroll" method="_on_PaletteScroll_resized"]
[connection signal="gui_input" from="PaletteVBoxContainer/SwatchesContainer/PaletteScroll/HBoxContainer/VBoxContainer/ScrollContainer/PaletteGrid" to="PaletteVBoxContainer/SwatchesContainer/PaletteScroll" method="_on_PaletteGrid_gui_input"] [connection signal="gui_input" from="PaletteVBoxContainer/SwatchesContainer/PaletteScroll/HBoxContainer/VBoxContainer/ScrollContainer/PaletteGrid" to="PaletteVBoxContainer/SwatchesContainer/PaletteScroll" method="_on_PaletteGrid_gui_input"]