diff --git a/repository.gd b/repository.gd index 40ce745..2a5626d 100644 --- a/repository.gd +++ b/repository.gd @@ -4,12 +4,14 @@ onready var index = $Rows/RepoVis/Index onready var nodes = $Rows/RepoVis/Nodes onready var file_browser = $Rows/FileBrowser onready var label_node = $Rows/RepoVis/Label +onready var path_node = $Rows/RepoVis/Path onready var simplify_checkbox = $Rows/RepoVis/SimplifyCheckbox export var label: String setget set_label export var path: String setget set_path, get_path export var file_browser_active = true setget set_file_browser_active export var simplified_view = false setget set_simplified_view +export var editable_path = false setget set_editable_path var node = preload("res://node.tscn") @@ -24,6 +26,7 @@ func _ready(): set_label(label) set_file_browser_active(file_browser_active) set_simplified_view(simplified_view) + set_editable_path(editable_path) func _process(_delta): nodes.rect_pivot_offset = nodes.rect_size / 2 @@ -52,11 +55,11 @@ func update_everything(): index.text = "" for o in objects: objects[o].queue_free() - objects = {} - + objects = {} func set_path(new_path): path = new_path + path_node.text = path shell.cd(new_path) for o in objects.values(): o.queue_free() @@ -270,6 +273,13 @@ func set_simplified_view(simplify): if simplify_checkbox: simplify_checkbox.pressed = simplify +func set_editable_path(editable): + editable_path = editable + if label_node: + label_node.visible = not editable + if path_node: + path_node.visible = editable + func remove_gone_stuff(): # FIXME: Cache the result of all_objects. var all = {} diff --git a/repository.tscn b/repository.tscn index 4a996ff..1fb365f 100644 --- a/repository.tscn +++ b/repository.tscn @@ -98,6 +98,15 @@ __meta__ = { "_edit_use_anchors_": false } +[node name="Path" type="LineEdit" parent="Rows/RepoVis"] +margin_left = 23.3361 +margin_top = 12.3197 +margin_right = 574.336 +margin_bottom = 61.3197 +__meta__ = { +"_edit_use_anchors_": false +} + [node name="FileBrowser" parent="Rows" instance=ExtResource( 4 )] anchor_right = 0.0 anchor_bottom = 0.0 @@ -110,3 +119,4 @@ size_flags_stretch_ratio = 0.08 [connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"] [connection signal="pressed" from="Rows/RepoVis/Button" to="." method="update_everything"] [connection signal="toggled" from="Rows/RepoVis/SimplifyCheckbox" to="." method="simplify_view"] +[connection signal="text_entered" from="Rows/RepoVis/Path" to="." method="set_path"] diff --git a/sandbox.tscn b/sandbox.tscn index fe1a1f3..7132750 100644 --- a/sandbox.tscn +++ b/sandbox.tscn @@ -40,6 +40,7 @@ anchor_bottom = 0.0 margin_right = 949.0 margin_bottom = 1070.0 size_flags_horizontal = 3 +editable_path = true [node name="Terminal" parent="HSplitContainer" instance=ExtResource( 1 )] anchor_right = 0.0 diff --git a/terminal.tscn b/terminal.tscn index 5b585f3..58dc53d 100644 --- a/terminal.tscn +++ b/terminal.tscn @@ -117,6 +117,9 @@ margin_left = 18.0 margin_top = 39.0 margin_right = -687.0 margin_bottom = -48.0 +__meta__ = { +"_edit_use_anchors_": false +} [node name="Text" type="RichTextLabel" parent="Pager"] anchor_right = 1.0