diff --git a/assets/Cairo-VariableFont_slnt,wght.ttf.import b/assets/Cairo-VariableFont_slnt,wght.ttf.import deleted file mode 100644 index 3ab7e3c..0000000 --- a/assets/Cairo-VariableFont_slnt,wght.ttf.import +++ /dev/null @@ -1,33 +0,0 @@ -[remap] - -importer="font_data_dynamic" -type="FontFile" -uid="uid://xixlsyswj6mv" -path="res://.godot/imported/Cairo-VariableFont_slnt,wght.ttf-8e1ad3a3f88c2663b83086e73553b314.fontdata" - -[deps] - -source_file="res://assets/Cairo-VariableFont_slnt,wght.ttf" -dest_files=["res://.godot/imported/Cairo-VariableFont_slnt,wght.ttf-8e1ad3a3f88c2663b83086e73553b314.fontdata"] - -[params] - -Rendering=null -antialiasing=1 -generate_mipmaps=false -multichannel_signed_distance_field=false -msdf_pixel_range=8 -msdf_size=48 -allow_system_fallback=true -force_autohinter=false -hinting=1 -subpixel_positioning=1 -oversampling=0.0 -Fallbacks=null -fallbacks=[] -Compress=null -compress=true -preload=[] -language_support={} -script_support={} -opentype_features={} diff --git a/assets/Cairo-VariableFont_slnt,wght.ttf b/assets/Cairo.ttf similarity index 100% rename from assets/Cairo-VariableFont_slnt,wght.ttf rename to assets/Cairo.ttf diff --git a/assets/default_theme.theme b/assets/default_theme.theme index 231bc88..e8fb9a5 100644 Binary files a/assets/default_theme.theme and b/assets/default_theme.theme differ diff --git a/assets/toggle_button_up.svg b/assets/toggle_button_up.svg new file mode 100644 index 0000000..773e0e8 --- /dev/null +++ b/assets/toggle_button_up.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + diff --git a/assets/toggle_button_up.svg.import b/assets/toggle_button_up.svg.import new file mode 100644 index 0000000..5940f24 --- /dev/null +++ b/assets/toggle_button_up.svg.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/toggle_button_up.svg-42d50bf036f845a14cc3c73e27b9d2ba.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/toggle_button_up.svg" +dest_files=[ "res://.import/toggle_button_up.svg-42d50bf036f845a14cc3c73e27b9d2ba.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/ui/main.gd b/ui/composed_ui.gd similarity index 87% rename from ui/main.gd rename to ui/composed_ui.gd index 369db2f..62d6f33 100644 --- a/ui/main.gd +++ b/ui/composed_ui.gd @@ -1,4 +1,4 @@ -extends VBoxContainer +extends Control var config: ConfigManager = preload("res://config_manager.tres") @@ -22,7 +22,9 @@ func _on_toggle_tab_container_button_toggled(is_toggled: bool) -> void: func set_window_size() -> void: - OS.window_size = v_box_container_primary.rect_size + var style_box := theme.get_stylebox("panel", "background") as StyleBoxFlat + var margin := style_box.content_margin_bottom * 2 + OS.window_size = v_box_container_primary.rect_size + Vector2.ONE * margin if tab_container.visible: OS.window_size.y += tab_container.rect_size.y diff --git a/ui/composed_ui.tscn b/ui/composed_ui.tscn new file mode 100644 index 0000000..6f70e37 --- /dev/null +++ b/ui/composed_ui.tscn @@ -0,0 +1,76 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://assets/default_theme.theme" type="Theme" id=1] +[ext_resource path="res://ui/tasks_list.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/time_counter.tscn" type="PackedScene" id=3] +[ext_resource path="res://ui/settings.tscn" type="PackedScene" id=4] +[ext_resource path="res://ui/composed_ui.gd" type="Script" id=5] + +[node name="PanelContainer" type="PanelContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +theme = ExtResource( 1 ) +theme_type_variation = "background" +script = ExtResource( 5 ) + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +margin_left = 5.0 +margin_top = 5.0 +margin_right = 355.0 +margin_bottom = 755.0 + +[node name="VBoxContainerPrimary" type="VBoxContainer" parent="VBoxContainer"] +unique_name_in_owner = true +margin_right = 350.0 +margin_bottom = 187.0 + +[node name="TimeCounter" parent="VBoxContainer/VBoxContainerPrimary" instance=ExtResource( 3 )] +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 350.0 +margin_bottom = 141.0 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/VBoxContainerPrimary"] +margin_top = 148.0 +margin_right = 350.0 +margin_bottom = 187.0 +alignment = 2 + +[node name="ToggleTabContainerButton" type="Button" parent="VBoxContainer/VBoxContainerPrimary/HBoxContainer"] +unique_name_in_owner = true +margin_left = 329.0 +margin_right = 350.0 +margin_bottom = 39.0 +theme_type_variation = "panel_toggle_button" +toggle_mode = true + +[node name="TabContainer" type="TabContainer" parent="VBoxContainer"] +unique_name_in_owner = true +margin_top = 194.0 +margin_right = 350.0 +margin_bottom = 750.0 +size_flags_vertical = 3 + +[node name="TasksList" parent="VBoxContainer/TabContainer" instance=ExtResource( 2 )] +margin_left = 5.0 +margin_top = 46.0 +margin_right = -5.0 +margin_bottom = -5.0 +size_flags_horizontal = 3 + +[node name="Settings" type="ScrollContainer" parent="VBoxContainer/TabContainer"] +visible = false +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 4.0 +margin_top = 32.0 +margin_right = -4.0 +margin_bottom = -4.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Settings" parent="VBoxContainer/TabContainer/Settings" instance=ExtResource( 4 )] +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 342.0 +margin_bottom = 520.0 diff --git a/ui/main.tscn b/ui/main.tscn deleted file mode 100644 index 455e399..0000000 --- a/ui/main.tscn +++ /dev/null @@ -1,68 +0,0 @@ -[gd_scene load_steps=6 format=2] - -[ext_resource path="res://ui/time_counter.tscn" type="PackedScene" id=1] -[ext_resource path="res://ui/tasks_list.tscn" type="PackedScene" id=2] -[ext_resource path="res://ui/settings.tscn" type="PackedScene" id=3] -[ext_resource path="res://ui/main.gd" type="Script" id=4] -[ext_resource path="res://assets/default_theme.theme" type="Theme" id=5] - -[node name="Main" type="VBoxContainer"] -anchor_right = 1.0 -anchor_bottom = 1.0 -theme = ExtResource( 5 ) -script = ExtResource( 4 ) - -[node name="VBoxContainerPrimary" type="VBoxContainer" parent="."] -unique_name_in_owner = true -margin_right = 360.0 -margin_bottom = 72.0 - -[node name="TimeCounter" parent="VBoxContainerPrimary" instance=ExtResource( 1 )] -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_right = 360.0 -margin_bottom = 48.0 - -[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainerPrimary"] -margin_top = 52.0 -margin_right = 360.0 -margin_bottom = 72.0 -alignment = 2 - -[node name="ToggleTabContainerButton" type="Button" parent="VBoxContainerPrimary/HBoxContainer"] -unique_name_in_owner = true -margin_left = 348.0 -margin_right = 360.0 -margin_bottom = 20.0 -toggle_mode = true - -[node name="TabContainer" type="TabContainer" parent="."] -unique_name_in_owner = true -margin_top = 76.0 -margin_right = 360.0 -margin_bottom = 760.0 -size_flags_vertical = 3 - -[node name="TasksList" parent="TabContainer" instance=ExtResource( 2 )] -margin_left = 4.0 -margin_top = 32.0 -margin_right = -4.0 -margin_bottom = -4.0 -size_flags_horizontal = 3 - -[node name="Settings" type="ScrollContainer" parent="TabContainer"] -visible = false -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_left = 4.0 -margin_top = 32.0 -margin_right = -4.0 -margin_bottom = -4.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="Settings" parent="TabContainer/Settings" instance=ExtResource( 3 )] -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_right = 352.0 -margin_bottom = 648.0 diff --git a/ui/settings.gd b/ui/settings.gd index 0987d95..f8dfae8 100644 --- a/ui/settings.gd +++ b/ui/settings.gd @@ -7,6 +7,7 @@ onready var file_path_button := $"%FilePathButton" as Button onready var theme_path_button := $"%ThemePathButton" as Button onready var sound_check_box := $"%SoundCheckBox" as CheckBox onready var open_data_dir_button := $"%OpenDataDirButton" as Button +onready var file_path_open_button := $"%FilePathOpenButton" as Button onready var attributions_rich_text_label := $"%AttributionsRichTextLabel" as RichTextLabel onready var file_path_file_dialog := $"%FilePathFileDialog" as FileDialog onready var theme_path_file_dialog := $"%ThemePathFileDialog" as FileDialog @@ -47,7 +48,8 @@ func _ready() -> void: # warning-ignore:return_value_discarded open_data_dir_button.connect("pressed", self, "_on_open_data_dir_button_pressed") - +# warning-ignore:return_value_discarded + file_path_open_button.connect("pressed", self, "_on_file_path_open_button_pressed") _on_current_file_changed() @@ -90,3 +92,8 @@ func _on_attributions_rich_text_label_meta_clicked(meta) -> void: func _on_open_data_dir_button_pressed() -> void: # warning-ignore:return_value_discarded OS.shell_open(OS.get_user_data_dir()) + + +func _on_file_path_open_button_pressed() -> void: + # warning-ignore:return_value_discarded + OS.shell_open(config.current_timesheet_file_path.get_base_dir()) diff --git a/ui/settings.tscn b/ui/settings.tscn index b400c02..9c069bb 100644 --- a/ui/settings.tscn +++ b/ui/settings.tscn @@ -29,7 +29,7 @@ text = "File Path" [node name="FilePathLineEdit" type="LineEdit" parent="VBoxContainer/HBoxContainer"] unique_name_in_owner = true margin_left = 59.0 -margin_right = 332.0 +margin_right = 223.0 margin_bottom = 24.0 size_flags_horizontal = 3 caret_blink = true @@ -37,11 +37,18 @@ caret_blink_speed = 0.5 [node name="FilePathButton" type="Button" parent="VBoxContainer/HBoxContainer"] unique_name_in_owner = true -margin_left = 336.0 -margin_right = 360.0 +margin_left = 227.0 +margin_right = 251.0 margin_bottom = 24.0 text = "..." +[node name="FilePathOpenButton" type="Button" parent="VBoxContainer/HBoxContainer"] +unique_name_in_owner = true +margin_left = 255.0 +margin_right = 360.0 +margin_bottom = 24.0 +text = "open directory" + [node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"] margin_top = 28.0 margin_right = 360.0 @@ -86,6 +93,7 @@ margin_top = 104.0 margin_right = 360.0 margin_bottom = 760.0 size_flags_vertical = 3 +theme_type_variation = "small_text" bbcode_enabled = true bbcode_text = "Font: Cairo, Designed by Mohamed Gaber, Accademia di Belle Arti di Urbino diff --git a/ui/time_counter.tscn b/ui/time_counter.tscn index 1344ebd..5ced5a3 100644 --- a/ui/time_counter.tscn +++ b/ui/time_counter.tscn @@ -11,6 +11,7 @@ script = ExtResource( 1 ) unique_name_in_owner = true margin_right = 360.0 margin_bottom = 24.0 +placeholder_text = "Task Name. Use \"/\" to create subtasks" [node name="HBoxContainer" type="HBoxContainer" parent="."] margin_top = 28.0 @@ -25,12 +26,18 @@ margin_top = 359.0 margin_right = 344.0 margin_bottom = 373.0 size_flags_horizontal = 3 +size_flags_vertical = 6 +theme_type_variation = "time_label" +text = "00:00:00" +align = 1 +valign = 1 [node name="StartButton" type="Button" parent="HBoxContainer"] unique_name_in_owner = true margin_left = 348.0 margin_right = 360.0 margin_bottom = 732.0 +theme_type_variation = "play_button" [node name="Timer" type="Timer" parent="."] unique_name_in_owner = true