Skip to content

Commit

Permalink
Tuck the root tag editor in the scrollable area
Browse files Browse the repository at this point in the history
  • Loading branch information
MewPurPur committed Apr 27, 2024
1 parent df5bfd4 commit 68e36eb
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 36 deletions.
5 changes: 2 additions & 3 deletions src/ui_parts/inspector.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ extends VBoxContainer

const TagFrame = preload("tag_frame.tscn")

@onready var tags_container: VBoxContainer = %ScrollContainer/Tags
@onready var svg_tag_editor: CenterContainer = $MarginContainer/SVGTagEditor
@onready var add_button: Button = $VBoxContainer/AddButton
@onready var tags_container: VBoxContainer = %Tags
@onready var add_button: Button = $AddButton

func _ready() -> void:
SVG.root_tag.tag_layout_changed.connect(full_rebuild)
Expand Down
40 changes: 21 additions & 19 deletions src/ui_parts/inspector.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,10 @@ offset_right = 392.0
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/separation = 8
theme_override_constants/separation = 6
script = ExtResource("1_16ggy")

[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 2
theme_override_constants/margin_bottom = 6

[node name="SVGTagEditor" parent="MarginContainer" instance=ExtResource("2_jnl50")]
layout_mode = 2

[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
size_flags_vertical = 3

[node name="AddButton" type="Button" parent="VBoxContainer"]
[node name="AddButton" type="Button" parent="."]
layout_mode = 2
size_flags_horizontal = 0
focus_mode = 0
Expand All @@ -49,7 +38,7 @@ theme_override_constants/h_separation = 4
text = "Add new tag"
icon = ExtResource("3_vo6hf")

[node name="TagContainer" type="PanelContainer" parent="VBoxContainer"]
[node name="TagContainer" type="PanelContainer" parent="."]
clip_contents = true
custom_minimum_size = Vector2(0, 200)
layout_mode = 2
Expand All @@ -58,22 +47,35 @@ size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_4j4hv")
script = ExtResource("4_i4hc2")

[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/TagContainer"]
unique_name_in_owner = true
[node name="ScrollContainer" type="ScrollContainer" parent="TagContainer"]
layout_mode = 2
size_flags_vertical = 3
horizontal_scroll_mode = 0

[node name="Tags" type="VBoxContainer" parent="VBoxContainer/TagContainer/ScrollContainer"]
[node name="MarginContainer" type="MarginContainer" parent="TagContainer/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/margin_top = 3
theme_override_constants/margin_bottom = 3

[node name="AllTags" type="VBoxContainer" parent="TagContainer/ScrollContainer/MarginContainer"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 8

[node name="RootTagEditor" parent="TagContainer/ScrollContainer/MarginContainer/AllTags" instance=ExtResource("2_jnl50")]
layout_mode = 2

[node name="Tags" type="VBoxContainer" parent="TagContainer/ScrollContainer/MarginContainer/AllTags"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/separation = 5

[node name="MoveToOverlay" type="Control" parent="VBoxContainer/TagContainer"]
[node name="MoveToOverlay" type="Control" parent="TagContainer"]
visible = false
layout_mode = 2
script = ExtResource("5_otlmf")

[connection signal="pressed" from="VBoxContainer/AddButton" to="." method="_on_add_button_pressed"]
[connection signal="pressed" from="AddButton" to="." method="_on_add_button_pressed"]
2 changes: 1 addition & 1 deletion src/ui_parts/main_scene.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ size_flags_horizontal = 3

[node name="MainContainer" type="VSplitContainer" parent="HSplitContainer/PanelContainer"]
layout_mode = 2
theme_override_constants/separation = 8
theme_override_constants/separation = 10
split_offset = -400

[node name="CodeEditor" parent="HSplitContainer/PanelContainer/MainContainer" instance=ExtResource("1_0jgh3")]
Expand Down
18 changes: 9 additions & 9 deletions src/ui_parts/root_tag_editor.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ const coupled_icon = preload("res://visual/icons/Coupled.svg")
const decoupled_icon = preload("res://visual/icons/Decoupled.svg")

@onready var couple_button: Button = $Edits/CoupleButton
@onready var width_button: Button = $Edits/Size/Width/WidthButton
@onready var height_button: Button = $Edits/Size/Height/HeightButton
@onready var viewbox_button: Button = $Edits/Viewbox/ViewboxButton
@onready var width_edit: NumberEditType = $Edits/Size/Width/WidthEdit
@onready var height_edit: NumberEditType = $Edits/Size/Height/HeightEdit
@onready var viewbox_edit_x: NumberEditType = $Edits/Viewbox/Rect/ViewboxEditX
@onready var viewbox_edit_y: NumberEditType = $Edits/Viewbox/Rect/ViewboxEditY
@onready var viewbox_edit_w: NumberEditType = $Edits/Viewbox/Rect/ViewboxEditW
@onready var viewbox_edit_h: NumberEditType = $Edits/Viewbox/Rect/ViewboxEditH
@onready var width_button: Button = %Size/Width/WidthButton
@onready var height_button: Button = %Size/Height/HeightButton
@onready var viewbox_button: Button = %Viewbox/ViewboxButton
@onready var width_edit: NumberEditType = %Size/Width/WidthEdit
@onready var height_edit: NumberEditType = %Size/Height/HeightEdit
@onready var viewbox_edit_x: NumberEditType = %Viewbox/Rect/ViewboxEditX
@onready var viewbox_edit_y: NumberEditType = %Viewbox/Rect/ViewboxEditY
@onready var viewbox_edit_w: NumberEditType = %Viewbox/Rect/ViewboxEditW
@onready var viewbox_edit_h: NumberEditType = %Viewbox/Rect/ViewboxEditH

func _ready() -> void:
SVG.root_tag.resized.connect(_on_resized)
Expand Down
8 changes: 5 additions & 3 deletions src/ui_parts/root_tag_editor.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5

[node name="SVGTagEditor" type="CenterContainer"]
offset_right = 100.0
offset_bottom = 35.0
[node name="RootTagEditor" type="CenterContainer"]
offset_right = 470.0
offset_bottom = 56.0
script = ExtResource("1_xgyg0")

[node name="Edits" type="HBoxContainer" parent="."]
layout_mode = 2
theme_override_constants/separation = 12

[node name="Size" type="HBoxContainer" parent="Edits"]
unique_name_in_owner = true
layout_mode = 2
theme_override_constants/separation = 8

Expand Down Expand Up @@ -82,6 +83,7 @@ script = ExtResource("4_7r848")
hover_pressed_stylebox = SubResource("StyleBoxFlat_u8h0i")

[node name="Viewbox" type="VBoxContainer" parent="Edits"]
unique_name_in_owner = true
layout_mode = 2
theme_override_constants/separation = 0

Expand Down
2 changes: 1 addition & 1 deletion visual/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 68e36eb

Please sign in to comment.