Properly sync simplify view checkbox

This commit is contained in:
Sebastian Morr 2020-10-12 18:29:15 +02:00
parent 86e4af0cdf
commit 613b1b9852

View file

@ -101,9 +101,6 @@ func update_objects():
continue continue
var type = object_type(o) var type = object_type(o)
if simplified_view:
if type == "tree" or type == "blob":
continue
var n = node.instance() var n = node.instance()
n.id = o n.id = o
@ -126,7 +123,7 @@ func update_objects():
_commit_count += 1 _commit_count += 1
if _commit_count >= 3 and not simplified_view: if _commit_count >= 3 and not simplified_view:
simplified_view = true set_simplified_view(true)
"tag": "tag":
n.children = tag_target(o) n.children = tag_target(o)
@ -134,6 +131,10 @@ func update_objects():
nodes.add_child(n) nodes.add_child(n)
objects[o] = n objects[o] = n
if simplified_view:
if type == "tree" or type == "blob":
n.hide()
func update_node_positions(): func update_node_positions():
if there_is_a_git(): if there_is_a_git():
var graph_text = shell.run("git log --graph --oneline --all --no-abbrev") var graph_text = shell.run("git log --graph --oneline --all --no-abbrev")
@ -309,9 +310,6 @@ func set_simplified_view(simplify):
var obj = objects[o] var obj = objects[o]
if obj.type == "tree" or obj.type == "blob": if obj.type == "tree" or obj.type == "blob":
obj.visible = not simplify obj.visible = not simplify
if there_is_a_git():
update_objects()
func set_editable_path(editable): func set_editable_path(editable):
editable_path = editable editable_path = editable