diff options
Diffstat (limited to 'screens/TimeSlot/TaskItem.gd')
-rw-r--r-- | screens/TimeSlot/TaskItem.gd | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/screens/TimeSlot/TaskItem.gd b/screens/TimeSlot/TaskItem.gd new file mode 100644 index 0000000..c2ab487 --- /dev/null +++ b/screens/TimeSlot/TaskItem.gd @@ -0,0 +1,17 @@ +extends MarginContainer + +var task_id + +func populate(data): + task_id = data.id + $"%Name".text = data.name + $"%Length".text = "%d min" % data.estimated_length + var freq = $"%Frequency" + freq.text = DataHelpers.frequency(data.frequency) + if freq.text.length() > 10: + freq["custom_fonts/font"] = freq["custom_fonts/font"].duplicate() + freq["custom_fonts/font"].size /= 2 + + +func _on_Button_button_up(): + $"/root/Main".nav_screen("Task", Task, "get_by_id", [task_id]) |