added two blank entries to the list so it always have some more scroll at the end...
authorEduardo <[email protected]>
Sat, 30 Sep 2023 00:52:02 +0000 (02:52 +0200)
committerEduardo <[email protected]>
Sat, 30 Sep 2023 00:52:02 +0000 (02:52 +0200)
custom_elements/todo_list_elements/todo_element.gd
scenes/todo_list/ToDoList.gd
scenes/todo_list/ToDoList.tscn

index d46886820c576fd799e14b0569e1f2e810936541..4aa10247c2f8c3ededea78ccc17699d3b0423e05 100644 (file)
@@ -1,6 +1,7 @@
 extends Control
 
 @onready var check_box = $MarginContainer/CheckBox
+@onready var check_box_square = $MarginContainer/CheckSquare
 
 @onready var one_star = $"1Star"
 @onready var two_star = $"2Star"
@@ -34,5 +35,8 @@ func set_priority(priority: int):
 func set_text(text: String):
        check_box.text = text
 
+func hide_checkBox():
+       check_box_square.queue_free()
+
 func destroy_self():
        queue_free()
index 652c8c2ddec7fe67fe3ed3c7aaf26b637c124fdc..3aeb805b4d2f6da7ee9ed42961c23cd782da6ff5 100644 (file)
@@ -38,14 +38,18 @@ func DEBUG_put_lots_of_tasks(how_many: int):
                el.call_deferred("set_priority", randi_range(1, 3))
                el.call_deferred("set_text", text_arr[randi_range(0, text_arr.size() - 1)])
 
+       _add_empty_entry_at_bottom(3)
+
 func _add_empty_entry_at_bottom(how_many: int):
                for i in range(how_many):
                        var el = load("res://custom_elements/todo_list_elements/todo_element.tscn").instantiate()
                        reorderable_list.call_deferred("add_child", el)
                        el.call_deferred("set_priority", 0)
                        el.call_deferred("set_text", "")
+                       el.call_deferred("hide_checkBox")
+
 
 func _on_ready():
        bg = Thread.new()
-       bg.start(_add_empty_entry_at_bottom.bind(3))
-       #bg.start(DEBUG_put_lots_of_tasks.bind(50))
+       bg.start(DEBUG_put_lots_of_tasks.bind(20))
+
index 3bc71fc1998aec5ba8599e4b523a8371a563dddc..19ea1fe2abd5d4ec59d1c02e4d3d389ae1c49dd7 100644 (file)
@@ -37,6 +37,8 @@ grow_horizontal = 2
 grow_vertical = 2
 size_flags_horizontal = 3
 size_flags_vertical = 3
+horizontal_scroll_mode = 3
+vertical_scroll_mode = 3
 
 [node name="MarginContainer" type="MarginContainer" parent="ScrollContainer"]
 layout_mode = 2
@@ -70,6 +72,7 @@ separation = 100
 is_vertical = true
 scroll_container = NodePath("../../..")
 auto_scroll_range = 0.1
+is_debugging = true
 
 [node name="todo_element" parent="ScrollContainer/MarginContainer/VBoxContainer/ReorderableVBox" instance=ExtResource("4_grm34")]
 layout_mode = 2