make inline rename work

This commit is contained in:
2023-05-27 03:46:46 +03:00
parent ba3e2751dd
commit fee4edce61
9 changed files with 44 additions and 21 deletions

View File

@ -25,12 +25,9 @@ func add_new_group() -> void:
func():
var gm := group_edit_dialog.get_group_metadata()
# TODO: hack, redo later
var group_name := group_edit_dialog.name_line_edit.text
var group_menu: GroupMenu = GROUP_MENU_SCENE.instantiate()
group_menus_container.add_child(group_menu)
group_menu.setup_from_metadata(group_name, gm)
group_menu.setup_from_metadata(gm)
group_menu.edit_group_button_pressed.connect(edit_group.bind(group_menu))
@ -43,13 +40,12 @@ func edit_group(group_menu: GroupMenu) -> void:
group_edit_dialog.clear()
group_edit_dialog.ok_button_text = "OK"
var group_name := group_menu.get_text()
group_edit_dialog.group_metadata = group_menu.group_metadata
group_edit_dialog.fill_from_group_metadata(group_name)
group_edit_dialog.fill_from_group_metadata()
group_edit_dialog.confirmed.connect(
func():
group_menu.setup_from_metadata(group_name, group_edit_dialog.get_group_metadata())
group_menu.setup_from_metadata(group_edit_dialog.get_group_metadata())
, CONNECT_ONE_SHOT)
group_edit_dialog.show()

27
UI/Main/Main.tscn Normal file
View File

@ -0,0 +1,27 @@
[gd_scene load_steps=3 format=3 uid="uid://0wv6qt367nml"]
[ext_resource type="PackedScene" uid="uid://bf464y0q4l67h" path="res://UI/Main/GroupsView.tscn" id="1_qdj8e"]
[ext_resource type="PackedScene" uid="uid://irfav51b5hf6" path="res://UI/Main/ReleasesView.tscn" id="2_sif55"]
[node name="Main" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="HSplitContainer" type="HSplitContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
split_offset = 400
[node name="ReleasesView" parent="HSplitContainer" instance=ExtResource("2_sif55")]
layout_mode = 2
[node name="GroupsView" parent="HSplitContainer" instance=ExtResource("1_qdj8e")]
layout_mode = 2