From ff590165d5595d67ba84e4a7d1a599c6e9d3a960 Mon Sep 17 00:00:00 2001 From: Sebastian Morr Date: Tue, 22 Sep 2020 21:56:22 +0200 Subject: [PATCH] Fix a few problems for the "git replace" demo, scale up sandbox UI --- repository.gd | 9 ++++++--- repository.tscn | 3 ++- sandbox.gd | 2 ++ sandbox.tscn | 13 +++++-------- terminal.gd | 1 + 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/repository.gd b/repository.gd index 1029faa..2ad044a 100644 --- a/repository.gd +++ b/repository.gd @@ -18,7 +18,6 @@ var mouse_inside = false var _simplified_view = false func _ready(): - nodes.rect_pivot_offset = nodes.rect_size / 2 file_browser.shell = shell # Trigger these again because nodes were not ready before. @@ -26,6 +25,7 @@ func _ready(): set_file_browser_active(file_browser_active) func _process(_delta): + nodes.rect_pivot_offset = nodes.rect_size / 2 if path: apply_forces() @@ -48,7 +48,10 @@ func update_everything(): update_objects() remove_gone_stuff() else: - index.text = "" + index.text = "" + for o in objects: + objects[o].queue_free() + objects = {} func set_path(new_path): @@ -159,7 +162,7 @@ func find_position(n): return n.position func git(args, splitlines = false): - var o = shell.run("git " + args) + var o = shell.run("git --no-replace-objects " + args) if splitlines: o = o.split("\n") diff --git a/repository.tscn b/repository.tscn index 488fe29..a9ed01f 100644 --- a/repository.tscn +++ b/repository.tscn @@ -18,11 +18,12 @@ __meta__ = { [node name="VSplitContainer" type="VSplitContainer" parent="."] anchor_right = 1.0 anchor_bottom = 1.0 +mouse_filter = 1 [node name="RepoVis" type="Control" parent="VSplitContainer"] margin_right = 1920.0 margin_bottom = 894.0 -rect_clip_content = true +mouse_filter = 1 size_flags_vertical = 3 __meta__ = { "_edit_use_anchors_": false diff --git a/sandbox.gd b/sandbox.gd index 6499973..bebcac2 100644 --- a/sandbox.gd +++ b/sandbox.gd @@ -2,3 +2,5 @@ extends Control func _ready(): $HSplitContainer/Repository.path = "/tmp/active" + + get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_2D, SceneTree.STRETCH_ASPECT_KEEP, Vector2(1920, 1080), 1.5) diff --git a/sandbox.tscn b/sandbox.tscn index 30524d1..f7e34e5 100644 --- a/sandbox.tscn +++ b/sandbox.tscn @@ -8,9 +8,6 @@ [node name="Sandbox" type="Control"] anchor_right = 1.0 anchor_bottom = 1.0 -margin_right = -960.0 -margin_bottom = -540.0 -rect_scale = Vector2( 2, 2 ) theme = ExtResource( 3 ) script = ExtResource( 4 ) __meta__ = { @@ -40,16 +37,16 @@ __meta__ = { [node name="Repository" parent="HSplitContainer" instance=ExtResource( 2 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_right = 469.0 -margin_bottom = 530.0 +margin_right = 949.0 +margin_bottom = 1070.0 size_flags_horizontal = 3 file_browser_active = false [node name="Terminal" parent="HSplitContainer" instance=ExtResource( 1 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_left = 481.0 -margin_right = 950.0 -margin_bottom = 530.0 +margin_left = 961.0 +margin_right = 1910.0 +margin_bottom = 1070.0 size_flags_horizontal = 3 repository_path = NodePath("../Repository") diff --git a/terminal.gd b/terminal.gd index 0a5a31d..a298d0e 100644 --- a/terminal.gd +++ b/terminal.gd @@ -26,6 +26,7 @@ func _ready(): command_dropdown.get_popup().connect("id_pressed", self, "load_command") $TextEditor.connect("hide", self, "editor_closed") + input.grab_focus() func _input(event): if history.size() > 0: