diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2022-08-26 19:37:29 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2022-08-26 19:37:29 -0400 |
commit | 5756a8f8ed23f0af88b9a351fbbde7417ac82c2f (patch) | |
tree | 483d564f7868a74276a930784f18b3271d6abbcc /screens | |
parent | c96db866eaa188ea73548a58716f3c0a46bc011c (diff) | |
download | Planner-5756a8f8ed23f0af88b9a351fbbde7417ac82c2f.tar.gz Planner-5756a8f8ed23f0af88b9a351fbbde7417ac82c2f.zip |
Add Prototype Task Manager Screen
Diffstat (limited to 'screens')
-rw-r--r-- | screens/TaskManager/Body.gd | 10 | ||||
-rw-r--r-- | screens/TaskManager/Body.tscn | 48 | ||||
-rw-r--r-- | screens/TaskManager/Header.gd | 7 | ||||
-rw-r--r-- | screens/TaskManager/Header.tscn | 33 | ||||
-rw-r--r-- | screens/TaskManager/TaskCategory.gd | 10 | ||||
-rw-r--r-- | screens/TaskManager/TaskCategory.tscn | 18 | ||||
-rw-r--r-- | screens/TaskManager/TaskItem.gd | 11 | ||||
-rw-r--r-- | screens/TaskManager/TaskItem.tscn | 48 | ||||
-rw-r--r-- | screens/TimeSlot/TaskItem.tscn | 6 |
9 files changed, 188 insertions, 3 deletions
diff --git a/screens/TaskManager/Body.gd b/screens/TaskManager/Body.gd new file mode 100644 index 0000000..9f783fc --- /dev/null +++ b/screens/TaskManager/Body.gd @@ -0,0 +1,10 @@ +extends VBoxContainer + +func populate(_data): + var TaskCategory = load("res://screens/TaskManager/TaskCategory.tscn") + var tabs = $"%Tabs" + for i in range(DataHelpers.Frequency.SIZE): + var cat = TaskCategory.instance() + cat.name = DataHelpers.frequency(i).replace("\n", " ") + cat.populate(i) + tabs.add_child(cat) diff --git a/screens/TaskManager/Body.tscn b/screens/TaskManager/Body.tscn new file mode 100644 index 0000000..7d7e4f2 --- /dev/null +++ b/screens/TaskManager/Body.tscn @@ -0,0 +1,48 @@ +[gd_scene load_steps=10 format=2] + +[ext_resource path="res://fonts/DroidSans.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://screens/TaskManager/Body.gd" type="Script" id=2] +[ext_resource path="res://icons/arrow-right.png" type="Texture" id=4] +[ext_resource path="res://icons/arrow-left-hi.png" type="Texture" id=5] +[ext_resource path="res://icons/arrow-left.png" type="Texture" id=6] +[ext_resource path="res://icons/arrow-right-hi.png" type="Texture" id=7] + +[sub_resource type="DynamicFont" id=1] +size = 60 +font_data = ExtResource( 1 ) + +[sub_resource type="StyleBoxFlat" id=2] +bg_color = Color( 0.239216, 0.231373, 0.27451, 1 ) +border_width_right = 40 +border_color = Color( 0, 0, 0, 0 ) +expand_margin_left = 10.0 +expand_margin_right = 10.0 + +[sub_resource type="StyleBoxFlat" id=3] +bg_color = Color( 0.176471, 0.168627, 0.2, 1 ) +border_width_right = 40 +border_color = Color( 0, 0, 0, 0 ) +expand_margin_left = 10.0 +expand_margin_right = 10.0 + +[node name="TaskManagerBody" type="VBoxContainer"] +margin_left = 20.0 +margin_top = 20.0 +margin_right = 1060.0 +margin_bottom = 1676.0 +script = ExtResource( 2 ) + +[node name="Tabs" type="TabContainer" parent="."] +unique_name_in_owner = true +margin_right = 1040.0 +margin_bottom = 1656.0 +size_flags_vertical = 3 +custom_constants/side_margin = 20 +custom_fonts/font = SubResource( 1 ) +custom_icons/increment_highlight = ExtResource( 7 ) +custom_icons/increment = ExtResource( 4 ) +custom_icons/decrement_highlight = ExtResource( 5 ) +custom_icons/decrement = ExtResource( 6 ) +custom_styles/tab_fg = SubResource( 2 ) +custom_styles/tab_bg = SubResource( 3 ) +tab_align = 0 diff --git a/screens/TaskManager/Header.gd b/screens/TaskManager/Header.gd new file mode 100644 index 0000000..f47048b --- /dev/null +++ b/screens/TaskManager/Header.gd @@ -0,0 +1,7 @@ +extends HBoxContainer + +func populate(_data): + pass + +func _on_Back_button_up(): + $"/root/Main".nav_back() diff --git a/screens/TaskManager/Header.tscn b/screens/TaskManager/Header.tscn new file mode 100644 index 0000000..747d3b5 --- /dev/null +++ b/screens/TaskManager/Header.tscn @@ -0,0 +1,33 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://fonts/DroidSans.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://screens/TaskManager/Header.gd" type="Script" id=2] + +[sub_resource type="DynamicFont" id=2] +size = 100 +font_data = ExtResource( 1 ) + +[node name="TaskManagerHeader" type="HBoxContainer"] +margin_left = 20.0 +margin_top = 20.0 +margin_right = 1060.0 +margin_bottom = 200.0 +script = ExtResource( 2 ) + +[node name="Title" type="Label" parent="."] +margin_top = 31.0 +margin_right = 813.0 +margin_bottom = 148.0 +size_flags_horizontal = 3 +custom_fonts/font = SubResource( 2 ) +text = "Task Manager" +clip_text = true + +[node name="Back" type="Button" parent="."] +margin_left = 817.0 +margin_right = 1040.0 +margin_bottom = 180.0 +custom_fonts/font = SubResource( 2 ) +text = "Back" + +[connection signal="button_up" from="Back" to="." method="_on_Back_button_up"] diff --git a/screens/TaskManager/TaskCategory.gd b/screens/TaskManager/TaskCategory.gd new file mode 100644 index 0000000..ef97c3b --- /dev/null +++ b/screens/TaskManager/TaskCategory.gd @@ -0,0 +1,10 @@ +extends ScrollContainer + +func populate(data): + var tasks = Task.get_by_frequency(data) + var TaskItem = load("res://screens/TaskManager/TaskItem.tscn") + var task_list = $"%TaskList" + for task in tasks: + var item = TaskItem.instance() + item.populate(task) + task_list.add_child(item)
\ No newline at end of file diff --git a/screens/TaskManager/TaskCategory.tscn b/screens/TaskManager/TaskCategory.tscn new file mode 100644 index 0000000..34c4752 --- /dev/null +++ b/screens/TaskManager/TaskCategory.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://screens/TaskManager/TaskCategory.gd" type="Script" id=1] + +[node name="TaskCategory" type="ScrollContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 4.0 +margin_top = 67.0 +margin_right = -4.0 +margin_bottom = -4.0 +size_flags_vertical = 3 +script = ExtResource( 1 ) + +[node name="TaskList" type="VBoxContainer" parent="."] +unique_name_in_owner = true +margin_right = 1072.0 +size_flags_horizontal = 3 diff --git a/screens/TaskManager/TaskItem.gd b/screens/TaskManager/TaskItem.gd new file mode 100644 index 0000000..ce9dd75 --- /dev/null +++ b/screens/TaskManager/TaskItem.gd @@ -0,0 +1,11 @@ +extends MarginContainer + +var task_id + +func populate(data): + task_id = data.id + $"%Name".text = data.name + $"%Length".text = "%d min" % data.estimated_length + +func _on_Button_button_up(): + $"/root/Main".nav_screen("Task", Task, "get_by_id", [task_id]) diff --git a/screens/TaskManager/TaskItem.tscn b/screens/TaskManager/TaskItem.tscn new file mode 100644 index 0000000..ef223ee --- /dev/null +++ b/screens/TaskManager/TaskItem.tscn @@ -0,0 +1,48 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://fonts/DroidSans.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://screens/TaskManager/TaskItem.gd" type="Script" id=2] + +[sub_resource type="DynamicFont" id=3] +size = 72 +font_data = ExtResource( 1 ) + +[node name="TaskItem" type="MarginContainer"] +margin_right = 1026.0 +margin_bottom = 110.0 +custom_constants/margin_top = 5 +custom_constants/margin_bottom = 5 +script = ExtResource( 2 ) + +[node name="Button" type="Button" parent="."] +margin_top = 5.0 +margin_right = 1026.0 +margin_bottom = 105.0 +rect_min_size = Vector2( 0, 100 ) + +[node name="HBoxContainer" type="HBoxContainer" parent="Button"] +margin_right = 1026.0 +margin_bottom = 100.0 +alignment = 2 + +[node name="Name" type="Label" parent="Button/HBoxContainer"] +unique_name_in_owner = true +margin_top = 8.0 +margin_right = 797.0 +margin_bottom = 92.0 +size_flags_horizontal = 3 +custom_fonts/font = SubResource( 3 ) +text = "Stretching" +clip_text = true + +[node name="Length" type="Label" parent="Button/HBoxContainer"] +unique_name_in_owner = true +margin_left = 801.0 +margin_top = 8.0 +margin_right = 1026.0 +margin_bottom = 92.0 +custom_fonts/font = SubResource( 3 ) +text = "10 min" +align = 2 + +[connection signal="button_up" from="Button" to="." method="_on_Button_button_up"] diff --git a/screens/TimeSlot/TaskItem.tscn b/screens/TimeSlot/TaskItem.tscn index 1a9948d..5c33386 100644 --- a/screens/TimeSlot/TaskItem.tscn +++ b/screens/TimeSlot/TaskItem.tscn @@ -3,7 +3,7 @@ [ext_resource path="res://fonts/DroidSans.ttf" type="DynamicFontData" id=1] [ext_resource path="res://screens/TimeSlot/TaskItem.gd" type="Script" id=2] -[sub_resource type="DynamicFont" id=1] +[sub_resource type="DynamicFont" id=3] size = 72 font_data = ExtResource( 1 ) @@ -35,7 +35,7 @@ margin_top = 8.0 margin_right = 493.0 margin_bottom = 92.0 size_flags_horizontal = 3 -custom_fonts/font = SubResource( 1 ) +custom_fonts/font = SubResource( 3 ) text = "Stretching" clip_text = true @@ -45,7 +45,7 @@ margin_left = 497.0 margin_top = 8.0 margin_right = 722.0 margin_bottom = 92.0 -custom_fonts/font = SubResource( 1 ) +custom_fonts/font = SubResource( 3 ) text = "10 min" align = 2 |