From f40df1987a35adbc234a1b04b018d92d420b1e92 Mon Sep 17 00:00:00 2001 From: dam Date: Mon, 4 Apr 2022 10:02:13 +0000 Subject: Replaced icons and simplified dialog button labels. --- themes/dark.tres | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 themes/dark.tres (limited to 'themes/dark.tres') diff --git a/themes/dark.tres b/themes/dark.tres new file mode 100644 index 0000000..832b226 --- /dev/null +++ b/themes/dark.tres @@ -0,0 +1,6 @@ +[gd_resource type="Theme" load_steps=2 format=2] + +[ext_resource path="res://fonts/font_regular.tres" type="DynamicFont" id=1] + +[resource] +default_font = ExtResource( 1 ) -- cgit v1.2.3 From 2e70e18f24a14f74c00850bfc88071d23ec66da9 Mon Sep 17 00:00:00 2001 From: dam Date: Tue, 5 Apr 2022 05:33:23 +0000 Subject: WIP creating theme and improving UI/UX. --- dialog/dialog.gd | 2 + fonts/entypo-fontello.ttf | Bin 6832 -> 6560 bytes fonts/font_icons.tres | 2 +- logic/database.gd | 14 ++--- logic/stage.gd | 5 +- main.tscn | 136 ++++++++++++++++++++++++--------------------- option_set/option_set.tscn | 2 +- project.godot | 1 + themes/dark.tres | 61 +++++++++++++++++++- 9 files changed, 147 insertions(+), 76 deletions(-) (limited to 'themes/dark.tres') diff --git a/dialog/dialog.gd b/dialog/dialog.gd index 1cf0e66..71981c7 100644 --- a/dialog/dialog.gd +++ b/dialog/dialog.gd @@ -22,6 +22,7 @@ func _init(): reject.anchor_top = 1.0 reject.anchor_left = 0.0 reject.anchor_right = 0.5 + reject.margin_right = -5.0 reject.grow_vertical = Control.GROW_DIRECTION_BEGIN reject.name = "reject" reject.connect("pressed", self, "_signal_rejected") @@ -31,6 +32,7 @@ func _init(): accept.anchor_top = 1.0 accept.anchor_left = 0.5 accept.anchor_right = 1.0 + accept.margin_left = 5.0 accept.grow_vertical = Control.GROW_DIRECTION_BEGIN accept.name = "accept" accept.connect("pressed", self, "_signal_accepted") diff --git a/fonts/entypo-fontello.ttf b/fonts/entypo-fontello.ttf index 0e95ba4..345bd55 100644 Binary files a/fonts/entypo-fontello.ttf and b/fonts/entypo-fontello.ttf differ diff --git a/fonts/font_icons.tres b/fonts/font_icons.tres index cc86d17..6bc9f3d 100644 --- a/fonts/font_icons.tres +++ b/fonts/font_icons.tres @@ -3,6 +3,6 @@ [ext_resource path="res://fonts/entypo-fontello.ttf" type="DynamicFontData" id=1] [resource] -size = 64 +size = 55 use_filter = true font_data = ExtResource( 1 ) diff --git a/logic/database.gd b/logic/database.gd index ea27ef2..262a18a 100644 --- a/logic/database.gd +++ b/logic/database.gd @@ -44,18 +44,18 @@ func get_entry_view(database_entry: Dictionary) -> String: func item_selected(index: int): selected_idx = index - fade_action_buttons(1.0) + set_buttons_active(true) func clear_selection(): selected_idx = -1 unselect_all() - fade_action_buttons(0.25) + set_buttons_active(false) -func fade_action_buttons(target_alpha: float): - get_node("actions/delete").modulate.a = target_alpha - get_node("actions/edit").modulate.a = target_alpha +func set_buttons_active(active: bool): + (get_node("actions/delete") as Button).disabled = !active + (get_node("actions/edit") as Button).disabled = !active func delete_action(): @@ -83,14 +83,14 @@ func edit_action(): self.visible = false stage.visible = true var staged := (db[staged_idx] as Dictionary).duplicate(true) - stage.set_stage(staged) + stage.set_stage(staged, "Entry #%d" % (staged_idx+1)) func add_action(): self.visible = false stage.visible = true var staged := DatabaseEntry.instance_entry() - stage.set_stage(staged) + stage.set_stage(staged, "New entry") func save_stage(entry: Dictionary): diff --git a/logic/stage.gd b/logic/stage.gd index 104e888..e2248fa 100644 --- a/logic/stage.gd +++ b/logic/stage.gd @@ -23,7 +23,7 @@ const OPTION_SETS_TREE_STRUCTURE := { var staged_entry_hash: int var option_sets: Dictionary - +onready var title := get_node("controls/title") as Label onready var process_id := get_node("controls/process_id") as LineEdit onready var surgery_id := get_node("controls/surgery_id") as LineEdit onready var date := get_node("controls/date_picker") as DatePicker @@ -124,7 +124,8 @@ func discard_action_confirmed(): emit_signal("discard") -func set_stage(entry: Dictionary): +func set_stage(entry: Dictionary, title: String): + self.title.text = title staged_entry_hash = entry.hash() process_id.text = entry.process_id surgery_id.text = entry.surgery_id diff --git a/main.tscn b/main.tscn index 644d393..157f171 100644 --- a/main.tscn +++ b/main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=2] +[gd_scene load_steps=16 format=2] [ext_resource path="res://main.gd" type="Script" id=1] [ext_resource path="res://date_picker/date_picker.tscn" type="PackedScene" id=2] @@ -12,7 +12,6 @@ [ext_resource path="res://logic/popup.gd" type="Script" id=10] [ext_resource path="res://touch_item_list/touch_item_list.tscn" type="PackedScene" id=11] [ext_resource path="res://touch_vertical_container/touch_vertical_container.tscn" type="PackedScene" id=12] -[ext_resource path="res://fonts/font_mono_regular.tres" type="DynamicFont" id=13] [ext_resource path="res://dialog/dialog.gd" type="Script" id=14] [ext_resource path="res://file_picker.gd" type="Script" id=15] @@ -37,7 +36,6 @@ theme = ExtResource( 3 ) script = ExtResource( 1 ) [node name="database" parent="." instance=ExtResource( 11 )] -custom_fonts/font = ExtResource( 13 ) script = ExtResource( 5 ) [node name="menu" type="MenuButton" parent="database"] @@ -63,11 +61,12 @@ grow_horizontal = 0 grow_vertical = 0 [node name="delete" type="Button" parent="database/actions"] -margin_right = 80.0 -margin_bottom = 95.0 +margin_right = 73.0 +margin_bottom = 86.0 focus_mode = 0 custom_fonts/font = ExtResource( 6 ) custom_styles/normal = SubResource( 1 ) +shortcut_in_tooltip = false enabled_focus_mode = 0 text = "" __meta__ = { @@ -75,12 +74,13 @@ __meta__ = { } [node name="edit" type="Button" parent="database/actions"] -margin_top = 99.0 -margin_right = 80.0 -margin_bottom = 194.0 +margin_top = 90.0 +margin_right = 73.0 +margin_bottom = 176.0 focus_mode = 0 custom_fonts/font = ExtResource( 6 ) custom_styles/normal = SubResource( 1 ) +shortcut_in_tooltip = false enabled_focus_mode = 0 text = "" __meta__ = { @@ -88,12 +88,13 @@ __meta__ = { } [node name="add" type="Button" parent="database/actions"] -margin_top = 198.0 -margin_right = 80.0 -margin_bottom = 293.0 +margin_top = 180.0 +margin_right = 73.0 +margin_bottom = 266.0 focus_mode = 0 custom_fonts/font = ExtResource( 6 ) custom_styles/normal = SubResource( 1 ) +shortcut_in_tooltip = false enabled_focus_mode = 0 text = "" __meta__ = { @@ -104,133 +105,140 @@ __meta__ = { visible = false script = ExtResource( 9 ) -[node name="process_id" type="LineEdit" parent="stage/controls" index="0"] +[node name="title" type="Label" parent="stage/controls" index="0"] margin_right = 1080.0 -margin_bottom = 62.0 +margin_bottom = 52.0 +align = 1 + +[node name="process_id" type="LineEdit" parent="stage/controls" index="1"] +margin_top = 56.0 +margin_right = 1080.0 +margin_bottom = 118.0 max_length = 32 -placeholder_text = "Nº Processo" +placeholder_text = "Process #" caret_blink = true caret_blink_speed = 0.5 -[node name="surgery_id" type="LineEdit" parent="stage/controls" index="1"] -margin_top = 66.0 +[node name="surgery_id" type="LineEdit" parent="stage/controls" index="2"] +margin_top = 122.0 margin_right = 1080.0 -margin_bottom = 128.0 +margin_bottom = 184.0 max_length = 32 -placeholder_text = "Nº Cirurgia" +placeholder_text = "Surgery #" caret_blink = true caret_blink_speed = 0.5 -[node name="date_picker" parent="stage/controls" index="2" instance=ExtResource( 2 )] +[node name="date_picker" parent="stage/controls" index="3" instance=ExtResource( 2 )] anchor_right = 0.0 anchor_bottom = 0.0 margin_left = 340.0 -margin_top = 132.0 +margin_top = 188.0 margin_right = 740.0 -margin_bottom = 332.0 +margin_bottom = 388.0 rect_min_size = Vector2( 400, 200 ) size_flags_horizontal = 4 -[node name="place" parent="stage/controls" index="3" instance=ExtResource( 7 )] +[node name="place" parent="stage/controls" index="4" instance=ExtResource( 7 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 336.0 +margin_top = 392.0 margin_right = 1080.0 -margin_bottom = 398.0 +margin_bottom = 454.0 rect_min_size = Vector2( 0, 62 ) -placeholder = "Local" +placeholder = "Place" -[node name="anesthesia" parent="stage/controls" index="4" instance=ExtResource( 7 )] +[node name="anesthesia" parent="stage/controls" index="5" instance=ExtResource( 7 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 402.0 +margin_top = 458.0 margin_right = 1080.0 -margin_bottom = 464.0 +margin_bottom = 520.0 rect_min_size = Vector2( 0, 62 ) -placeholder = "Anestesia" +placeholder = "Anesthesia" -[node name="first_assistant" parent="stage/controls" index="5" instance=ExtResource( 7 )] +[node name="first_assistant" parent="stage/controls" index="6" instance=ExtResource( 7 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 468.0 +margin_top = 524.0 margin_right = 1080.0 -margin_bottom = 530.0 +margin_bottom = 586.0 rect_min_size = Vector2( 0, 62 ) -placeholder = "1º Ajudante" +placeholder = "First assistant" -[node name="type" parent="stage/controls" index="6" instance=ExtResource( 7 )] +[node name="type" parent="stage/controls" index="7" instance=ExtResource( 7 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 534.0 +margin_top = 590.0 margin_right = 1080.0 -margin_bottom = 596.0 +margin_bottom = 652.0 rect_min_size = Vector2( 0, 62 ) -placeholder = "Tipo" +placeholder = "Type" -[node name="sub_type" parent="stage/controls" index="7" instance=ExtResource( 7 )] +[node name="sub_type" parent="stage/controls" index="8" instance=ExtResource( 7 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 600.0 +margin_top = 656.0 margin_right = 1080.0 -margin_bottom = 662.0 +margin_bottom = 718.0 rect_min_size = Vector2( 0, 62 ) -placeholder = "Sub-tipo" +placeholder = "Sub-type" -[node name="sub_sub_type" parent="stage/controls" index="8" instance=ExtResource( 7 )] +[node name="sub_sub_type" parent="stage/controls" index="9" instance=ExtResource( 7 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 666.0 +margin_top = 722.0 margin_right = 1080.0 -margin_bottom = 728.0 +margin_bottom = 784.0 rect_min_size = Vector2( 0, 62 ) -placeholder = "Sub-sub-tipo" +placeholder = "Sub-sub-type" -[node name="pathology" parent="stage/controls" index="9" instance=ExtResource( 7 )] +[node name="pathology" parent="stage/controls" index="10" instance=ExtResource( 7 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 732.0 +margin_top = 788.0 margin_right = 1080.0 -margin_bottom = 794.0 +margin_bottom = 850.0 rect_min_size = Vector2( 0, 62 ) -placeholder = "Patologia" +placeholder = "Pathology" -[node name="intervention" parent="stage/controls" index="10" instance=ExtResource( 7 )] +[node name="intervention" parent="stage/controls" index="11" instance=ExtResource( 7 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 798.0 +margin_top = 854.0 margin_right = 1080.0 -margin_bottom = 860.0 +margin_bottom = 916.0 rect_min_size = Vector2( 0, 62 ) -placeholder = "Intervenção" +placeholder = "Intervention" -[node name="is_urgency" type="CheckBox" parent="stage/controls" index="11"] -margin_top = 864.0 +[node name="is_urgency" type="CheckBox" parent="stage/controls" index="12"] +margin_top = 920.0 margin_right = 1080.0 -margin_bottom = 924.0 +margin_bottom = 972.0 text = "Urgência" -[node name="notes" type="LineEdit" parent="stage/controls" index="12"] -margin_top = 928.0 +[node name="notes" type="LineEdit" parent="stage/controls" index="13"] +margin_top = 976.0 margin_right = 1080.0 -margin_bottom = 990.0 +margin_bottom = 1038.0 max_length = 4096 -placeholder_text = "Notas" +placeholder_text = "Notes" caret_blink = true caret_blink_speed = 0.5 -[node name="buttons" type="Control" parent="stage/controls" index="13"] -margin_top = 994.0 +[node name="buttons" type="Control" parent="stage/controls" index="14"] +margin_top = 1042.0 margin_right = 1080.0 -margin_bottom = 994.0 +margin_bottom = 1042.0 [node name="discard" type="Button" parent="stage/controls/buttons"] anchor_right = 0.5 +margin_right = -5.0 text = "Discard" [node name="save" type="Button" parent="stage/controls/buttons"] anchor_left = 0.5 anchor_right = 1.0 -margin_bottom = 58.0 +margin_left = 5.0 grow_horizontal = 0 text = "Save" diff --git a/option_set/option_set.tscn b/option_set/option_set.tscn index 5499361..3d09674 100644 --- a/option_set/option_set.tscn +++ b/option_set/option_set.tscn @@ -28,7 +28,7 @@ anchor_bottom = 1.0 margin_left = -100.0 grow_horizontal = 0 custom_fonts/font = ExtResource( 2 ) -text = "" +text = "" __meta__ = { "_edit_use_anchors_": false } diff --git a/project.godot b/project.godot index 4a3e1ed..36429fc 100644 --- a/project.godot +++ b/project.godot @@ -115,4 +115,5 @@ common/enable_pause_aware_picking=true [rendering] vram_compression/import_etc=true +environment/default_clear_color=Color( 0, 0, 0, 1 ) environment/default_environment="res://default_env.tres" diff --git a/themes/dark.tres b/themes/dark.tres index 832b226..717b9c2 100644 --- a/themes/dark.tres +++ b/themes/dark.tres @@ -1,6 +1,65 @@ -[gd_resource type="Theme" load_steps=2 format=2] +[gd_resource type="Theme" load_steps=9 format=2] [ext_resource path="res://fonts/font_regular.tres" type="DynamicFont" id=1] +[ext_resource path="res://fonts/font_mono_regular.tres" type="DynamicFont" id=2] + +[sub_resource type="StyleBoxFlat" id=2] +bg_color = Color( 0.11, 0.11, 0.11, 1 ) +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 + +[sub_resource type="StyleBoxFlat" id=8] +bg_color = Color( 0.109804, 0.109804, 0.109804, 1 ) +border_width_left = 3 +border_width_top = 3 +border_width_right = 3 +border_width_bottom = 3 +border_color = Color( 0.223529, 0.352941, 0.501961, 1 ) +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 + +[sub_resource type="StyleBoxFlat" id=4] +bg_color = Color( 0.223529, 0.352941, 0.501961, 1 ) +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 + +[sub_resource type="StyleBoxEmpty" id=5] + +[sub_resource type="StyleBoxFlat" id=9] +content_margin_left = 10.0 +content_margin_right = 10.0 +content_margin_top = 5.0 +content_margin_bottom = 5.0 +bg_color = Color( 0, 0, 0, 0 ) +draw_center = false +border_width_bottom = 3 +border_color = Color( 0.223529, 0.352941, 0.501961, 1 ) + +[sub_resource type="StyleBoxFlat" id=7] +content_margin_left = 10.0 +content_margin_right = 10.0 +content_margin_top = 5.0 +content_margin_bottom = 5.0 +bg_color = Color( 0, 0, 0, 0 ) +draw_center = false +border_width_bottom = 3 +border_color = Color( 0.33, 0.33, 0.33, 1 ) [resource] default_font = ExtResource( 1 ) +Button/styles/disabled = null +Button/styles/focus = SubResource( 2 ) +Button/styles/hover = SubResource( 8 ) +Button/styles/normal = SubResource( 2 ) +Button/styles/pressed = SubResource( 4 ) +ItemList/fonts/font = ExtResource( 2 ) +ItemList/styles/bg = SubResource( 5 ) +LineEdit/styles/focus = SubResource( 9 ) +LineEdit/styles/normal = SubResource( 7 ) +LineEdit/styles/read_only = null -- cgit v1.2.3 From c48a25f810436abf149225020279220dac3b78ec Mon Sep 17 00:00:00 2001 From: dam Date: Tue, 5 Apr 2022 06:18:39 +0000 Subject: Improved is_urgency button layout and visual. Changed font size. --- fonts/font_regular.tres | 2 +- main.tscn | 68 ++++++++++++++++++++++++------------------------- themes/dark.tres | 36 +++++++++++++------------- 3 files changed, 54 insertions(+), 52 deletions(-) (limited to 'themes/dark.tres') diff --git a/fonts/font_regular.tres b/fonts/font_regular.tres index 718443e..1090222 100644 --- a/fonts/font_regular.tres +++ b/fonts/font_regular.tres @@ -3,6 +3,6 @@ [ext_resource path="res://fonts/B612-Regular.ttf" type="DynamicFontData" id=1] [resource] -size = 42 +size = 32 use_filter = true font_data = ExtResource( 1 ) diff --git a/main.tscn b/main.tscn index 157f171..bbb3a13 100644 --- a/main.tscn +++ b/main.tscn @@ -74,9 +74,9 @@ __meta__ = { } [node name="edit" type="Button" parent="database/actions"] -margin_top = 90.0 +margin_top = 96.0 margin_right = 73.0 -margin_bottom = 176.0 +margin_bottom = 182.0 focus_mode = 0 custom_fonts/font = ExtResource( 6 ) custom_styles/normal = SubResource( 1 ) @@ -88,9 +88,9 @@ __meta__ = { } [node name="add" type="Button" parent="database/actions"] -margin_top = 180.0 +margin_top = 192.0 margin_right = 73.0 -margin_bottom = 266.0 +margin_bottom = 278.0 focus_mode = 0 custom_fonts/font = ExtResource( 6 ) custom_styles/normal = SubResource( 1 ) @@ -111,18 +111,18 @@ margin_bottom = 52.0 align = 1 [node name="process_id" type="LineEdit" parent="stage/controls" index="1"] -margin_top = 56.0 +margin_top = 62.0 margin_right = 1080.0 -margin_bottom = 118.0 +margin_bottom = 124.0 max_length = 32 placeholder_text = "Process #" caret_blink = true caret_blink_speed = 0.5 [node name="surgery_id" type="LineEdit" parent="stage/controls" index="2"] -margin_top = 122.0 +margin_top = 134.0 margin_right = 1080.0 -margin_bottom = 184.0 +margin_bottom = 196.0 max_length = 32 placeholder_text = "Surgery #" caret_blink = true @@ -132,103 +132,103 @@ caret_blink_speed = 0.5 anchor_right = 0.0 anchor_bottom = 0.0 margin_left = 340.0 -margin_top = 188.0 +margin_top = 206.0 margin_right = 740.0 -margin_bottom = 388.0 +margin_bottom = 406.0 rect_min_size = Vector2( 400, 200 ) size_flags_horizontal = 4 [node name="place" parent="stage/controls" index="4" instance=ExtResource( 7 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 392.0 +margin_top = 416.0 margin_right = 1080.0 -margin_bottom = 454.0 +margin_bottom = 478.0 rect_min_size = Vector2( 0, 62 ) placeholder = "Place" [node name="anesthesia" parent="stage/controls" index="5" instance=ExtResource( 7 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 458.0 +margin_top = 488.0 margin_right = 1080.0 -margin_bottom = 520.0 +margin_bottom = 550.0 rect_min_size = Vector2( 0, 62 ) placeholder = "Anesthesia" [node name="first_assistant" parent="stage/controls" index="6" instance=ExtResource( 7 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 524.0 +margin_top = 560.0 margin_right = 1080.0 -margin_bottom = 586.0 +margin_bottom = 622.0 rect_min_size = Vector2( 0, 62 ) placeholder = "First assistant" [node name="type" parent="stage/controls" index="7" instance=ExtResource( 7 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 590.0 +margin_top = 632.0 margin_right = 1080.0 -margin_bottom = 652.0 +margin_bottom = 694.0 rect_min_size = Vector2( 0, 62 ) placeholder = "Type" [node name="sub_type" parent="stage/controls" index="8" instance=ExtResource( 7 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 656.0 +margin_top = 704.0 margin_right = 1080.0 -margin_bottom = 718.0 +margin_bottom = 766.0 rect_min_size = Vector2( 0, 62 ) placeholder = "Sub-type" [node name="sub_sub_type" parent="stage/controls" index="9" instance=ExtResource( 7 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 722.0 +margin_top = 776.0 margin_right = 1080.0 -margin_bottom = 784.0 +margin_bottom = 838.0 rect_min_size = Vector2( 0, 62 ) placeholder = "Sub-sub-type" [node name="pathology" parent="stage/controls" index="10" instance=ExtResource( 7 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 788.0 +margin_top = 848.0 margin_right = 1080.0 -margin_bottom = 850.0 +margin_bottom = 910.0 rect_min_size = Vector2( 0, 62 ) placeholder = "Pathology" [node name="intervention" parent="stage/controls" index="11" instance=ExtResource( 7 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 854.0 +margin_top = 920.0 margin_right = 1080.0 -margin_bottom = 916.0 +margin_bottom = 982.0 rect_min_size = Vector2( 0, 62 ) placeholder = "Intervention" -[node name="is_urgency" type="CheckBox" parent="stage/controls" index="12"] -margin_top = 920.0 +[node name="is_urgency" type="CheckButton" parent="stage/controls" index="12"] +margin_top = 992.0 margin_right = 1080.0 -margin_bottom = 972.0 -text = "Urgência" +margin_bottom = 1044.0 +text = "Is urgency" [node name="notes" type="LineEdit" parent="stage/controls" index="13"] -margin_top = 976.0 +margin_top = 1054.0 margin_right = 1080.0 -margin_bottom = 1038.0 +margin_bottom = 1116.0 max_length = 4096 placeholder_text = "Notes" caret_blink = true caret_blink_speed = 0.5 [node name="buttons" type="Control" parent="stage/controls" index="14"] -margin_top = 1042.0 +margin_top = 1126.0 margin_right = 1080.0 -margin_bottom = 1042.0 +margin_bottom = 1126.0 [node name="discard" type="Button" parent="stage/controls/buttons"] anchor_right = 0.5 diff --git a/themes/dark.tres b/themes/dark.tres index 717b9c2..b556b88 100644 --- a/themes/dark.tres +++ b/themes/dark.tres @@ -1,28 +1,33 @@ -[gd_resource type="Theme" load_steps=9 format=2] +[gd_resource type="Theme" load_steps=10 format=2] [ext_resource path="res://fonts/font_regular.tres" type="DynamicFont" id=1] [ext_resource path="res://fonts/font_mono_regular.tres" type="DynamicFont" id=2] -[sub_resource type="StyleBoxFlat" id=2] -bg_color = Color( 0.11, 0.11, 0.11, 1 ) +[sub_resource type="StyleBoxEmpty" id=10] +content_margin_left = 10.0 +content_margin_right = 10.0 + +[sub_resource type="StyleBoxFlat" id=11] +content_margin_left = 10.0 +content_margin_right = 10.0 +bg_color = Color( 0.22, 0.35, 0.5, 0.5 ) corner_radius_top_left = 8 corner_radius_top_right = 8 corner_radius_bottom_right = 8 corner_radius_bottom_left = 8 -[sub_resource type="StyleBoxFlat" id=8] -bg_color = Color( 0.109804, 0.109804, 0.109804, 1 ) -border_width_left = 3 -border_width_top = 3 -border_width_right = 3 -border_width_bottom = 3 -border_color = Color( 0.223529, 0.352941, 0.501961, 1 ) +[sub_resource type="StyleBoxFlat" id=2] +content_margin_left = 10.0 +content_margin_right = 10.0 +bg_color = Color( 0.11, 0.11, 0.11, 1 ) corner_radius_top_left = 8 corner_radius_top_right = 8 corner_radius_bottom_right = 8 corner_radius_bottom_left = 8 [sub_resource type="StyleBoxFlat" id=4] +content_margin_left = 10.0 +content_margin_right = 10.0 bg_color = Color( 0.223529, 0.352941, 0.501961, 1 ) corner_radius_top_left = 8 corner_radius_top_right = 8 @@ -34,8 +39,6 @@ corner_radius_bottom_left = 8 [sub_resource type="StyleBoxFlat" id=9] content_margin_left = 10.0 content_margin_right = 10.0 -content_margin_top = 5.0 -content_margin_bottom = 5.0 bg_color = Color( 0, 0, 0, 0 ) draw_center = false border_width_bottom = 3 @@ -44,8 +47,6 @@ border_color = Color( 0.223529, 0.352941, 0.501961, 1 ) [sub_resource type="StyleBoxFlat" id=7] content_margin_left = 10.0 content_margin_right = 10.0 -content_margin_top = 5.0 -content_margin_bottom = 5.0 bg_color = Color( 0, 0, 0, 0 ) draw_center = false border_width_bottom = 3 @@ -53,9 +54,9 @@ border_color = Color( 0.33, 0.33, 0.33, 1 ) [resource] default_font = ExtResource( 1 ) -Button/styles/disabled = null -Button/styles/focus = SubResource( 2 ) -Button/styles/hover = SubResource( 8 ) +Button/styles/disabled = SubResource( 10 ) +Button/styles/focus = SubResource( 10 ) +Button/styles/hover = SubResource( 11 ) Button/styles/normal = SubResource( 2 ) Button/styles/pressed = SubResource( 4 ) ItemList/fonts/font = ExtResource( 2 ) @@ -63,3 +64,4 @@ ItemList/styles/bg = SubResource( 5 ) LineEdit/styles/focus = SubResource( 9 ) LineEdit/styles/normal = SubResource( 7 ) LineEdit/styles/read_only = null +VBoxContainer/constants/separation = 10 -- cgit v1.2.3 From 14526504570f0a8a4d2e1964388c680819414996 Mon Sep 17 00:00:00 2001 From: dam Date: Tue, 5 Apr 2022 06:19:39 +0000 Subject: Tweaked line edit theme. --- themes/dark.tres | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'themes/dark.tres') diff --git a/themes/dark.tres b/themes/dark.tres index b556b88..19d1da2 100644 --- a/themes/dark.tres +++ b/themes/dark.tres @@ -41,7 +41,7 @@ content_margin_left = 10.0 content_margin_right = 10.0 bg_color = Color( 0, 0, 0, 0 ) draw_center = false -border_width_bottom = 3 +border_width_bottom = 4 border_color = Color( 0.223529, 0.352941, 0.501961, 1 ) [sub_resource type="StyleBoxFlat" id=7] @@ -49,8 +49,8 @@ content_margin_left = 10.0 content_margin_right = 10.0 bg_color = Color( 0, 0, 0, 0 ) draw_center = false -border_width_bottom = 3 -border_color = Color( 0.33, 0.33, 0.33, 1 ) +border_width_bottom = 2 +border_color = Color( 0.329412, 0.329412, 0.329412, 1 ) [resource] default_font = ExtResource( 1 ) -- cgit v1.2.3 From 6abe22e94b29e94bb94abaa44c31d2b806daaafe Mon Sep 17 00:00:00 2001 From: dam Date: Thu, 7 Apr 2022 16:41:40 +0000 Subject: Removed hardcoded database buttons theming; to be defined later. --- main.tscn | 36 +++++++++--------------------------- themes/dark.tres | 34 +++++++++++++++++++++------------- 2 files changed, 30 insertions(+), 40 deletions(-) (limited to 'themes/dark.tres') diff --git a/main.tscn b/main.tscn index 6f08eef..f7a0d0a 100644 --- a/main.tscn +++ b/main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=2] +[gd_scene load_steps=15 format=2] [ext_resource path="res://main.gd" type="Script" id=1] [ext_resource path="res://date_picker/date_picker.tscn" type="PackedScene" id=2] @@ -15,20 +15,6 @@ [ext_resource path="res://dialog/dialog.gd" type="Script" id=14] [ext_resource path="res://file_picker.gd" type="Script" id=15] -[sub_resource type="StyleBoxFlat" id=1] -content_margin_left = 15.0 -content_margin_right = 15.0 -content_margin_top = 15.0 -content_margin_bottom = 15.0 -bg_color = Color( 0, 0, 0, 0.75 ) -border_color = Color( 1, 1, 1, 1 ) -corner_radius_top_left = 50 -corner_radius_top_right = 50 -corner_radius_bottom_right = 50 -corner_radius_bottom_left = 50 -expand_margin_left = 7.0 -expand_margin_right = 7.0 - [node name="main" type="Control"] anchor_right = 1.0 anchor_bottom = 1.0 @@ -45,7 +31,6 @@ margin_top = 32.0 margin_right = -32.0 grow_horizontal = 0 custom_fonts/font = ExtResource( 6 ) -custom_styles/normal = SubResource( 1 ) text = "" flat = false script = ExtResource( 4 ) @@ -61,11 +46,10 @@ grow_horizontal = 0 grow_vertical = 0 [node name="delete" type="Button" parent="database/actions"] -margin_right = 73.0 -margin_bottom = 86.0 +margin_right = 63.0 +margin_bottom = 56.0 focus_mode = 0 custom_fonts/font = ExtResource( 6 ) -custom_styles/normal = SubResource( 1 ) shortcut_in_tooltip = false enabled_focus_mode = 0 text = "" @@ -74,12 +58,11 @@ __meta__ = { } [node name="edit" type="Button" parent="database/actions"] -margin_top = 96.0 -margin_right = 73.0 -margin_bottom = 182.0 +margin_top = 66.0 +margin_right = 63.0 +margin_bottom = 122.0 focus_mode = 0 custom_fonts/font = ExtResource( 6 ) -custom_styles/normal = SubResource( 1 ) shortcut_in_tooltip = false enabled_focus_mode = 0 text = "" @@ -88,12 +71,11 @@ __meta__ = { } [node name="add" type="Button" parent="database/actions"] -margin_top = 192.0 -margin_right = 73.0 -margin_bottom = 278.0 +margin_top = 132.0 +margin_right = 63.0 +margin_bottom = 188.0 focus_mode = 0 custom_fonts/font = ExtResource( 6 ) -custom_styles/normal = SubResource( 1 ) shortcut_in_tooltip = false enabled_focus_mode = 0 text = "" diff --git a/themes/dark.tres b/themes/dark.tres index 19d1da2..e50b548 100644 --- a/themes/dark.tres +++ b/themes/dark.tres @@ -1,4 +1,4 @@ -[gd_resource type="Theme" load_steps=10 format=2] +[gd_resource type="Theme" load_steps=11 format=2] [ext_resource path="res://fonts/font_regular.tres" type="DynamicFont" id=1] [ext_resource path="res://fonts/font_mono_regular.tres" type="DynamicFont" id=2] @@ -11,28 +11,28 @@ content_margin_right = 10.0 content_margin_left = 10.0 content_margin_right = 10.0 bg_color = Color( 0.22, 0.35, 0.5, 0.5 ) -corner_radius_top_left = 8 -corner_radius_top_right = 8 -corner_radius_bottom_right = 8 -corner_radius_bottom_left = 8 +corner_radius_top_left = 15 +corner_radius_top_right = 15 +corner_radius_bottom_right = 15 +corner_radius_bottom_left = 15 [sub_resource type="StyleBoxFlat" id=2] content_margin_left = 10.0 content_margin_right = 10.0 bg_color = Color( 0.11, 0.11, 0.11, 1 ) -corner_radius_top_left = 8 -corner_radius_top_right = 8 -corner_radius_bottom_right = 8 -corner_radius_bottom_left = 8 +corner_radius_top_left = 15 +corner_radius_top_right = 15 +corner_radius_bottom_right = 15 +corner_radius_bottom_left = 15 [sub_resource type="StyleBoxFlat" id=4] content_margin_left = 10.0 content_margin_right = 10.0 bg_color = Color( 0.223529, 0.352941, 0.501961, 1 ) -corner_radius_top_left = 8 -corner_radius_top_right = 8 -corner_radius_bottom_right = 8 -corner_radius_bottom_left = 8 +corner_radius_top_left = 15 +corner_radius_top_right = 15 +corner_radius_bottom_right = 15 +corner_radius_bottom_left = 15 [sub_resource type="StyleBoxEmpty" id=5] @@ -52,6 +52,13 @@ draw_center = false border_width_bottom = 2 border_color = Color( 0.329412, 0.329412, 0.329412, 1 ) +[sub_resource type="StyleBoxFlat" id=12] +bg_color = Color( 0.22, 0.22, 0.22, 1 ) +corner_radius_top_left = 15 +corner_radius_top_right = 15 +corner_radius_bottom_right = 15 +corner_radius_bottom_left = 15 + [resource] default_font = ExtResource( 1 ) Button/styles/disabled = SubResource( 10 ) @@ -64,4 +71,5 @@ ItemList/styles/bg = SubResource( 5 ) LineEdit/styles/focus = SubResource( 9 ) LineEdit/styles/normal = SubResource( 7 ) LineEdit/styles/read_only = null +Panel/styles/panel = SubResource( 12 ) VBoxContainer/constants/separation = 10 -- cgit v1.2.3 From 7dd71a804511146357fc78b10d6b81c9efda1d2e Mon Sep 17 00:00:00 2001 From: dam Date: Sat, 9 Apr 2022 02:13:30 +0000 Subject: Chanted is_urgency button type. Made buttons lighter. --- icons/add.png | Bin 3030 -> 0 bytes icons/add.png.import | 38 --------------------- icons/delete.png | Bin 4410 -> 0 bytes icons/delete.png.import | 38 --------------------- icons/edit.png | Bin 5449 -> 0 bytes icons/edit.png.import | 38 --------------------- main.tscn | 4 ++- readme.md | 4 +-- themes/dark.tres | 6 ++-- .../touch_vertical_container.gd | 2 +- 10 files changed, 9 insertions(+), 121 deletions(-) delete mode 100644 icons/add.png delete mode 100644 icons/add.png.import delete mode 100644 icons/delete.png delete mode 100644 icons/delete.png.import delete mode 100755 icons/edit.png delete mode 100644 icons/edit.png.import (limited to 'themes/dark.tres') diff --git a/icons/add.png b/icons/add.png deleted file mode 100644 index 074a6c1..0000000 Binary files a/icons/add.png and /dev/null differ diff --git a/icons/add.png.import b/icons/add.png.import deleted file mode 100644 index f726327..0000000 --- a/icons/add.png.import +++ /dev/null @@ -1,38 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path.s3tc="res://.import/add.png-21abb41ff0da259ea2ccbb4becce111a.s3tc.stex" -path.etc2="res://.import/add.png-21abb41ff0da259ea2ccbb4becce111a.etc2.stex" -path.etc="res://.import/add.png-21abb41ff0da259ea2ccbb4becce111a.etc.stex" -metadata={ -"imported_formats": [ "s3tc", "etc2", "etc" ], -"vram_texture": true -} - -[deps] - -source_file="res://icons/add.png" -dest_files=[ "res://.import/add.png-21abb41ff0da259ea2ccbb4becce111a.s3tc.stex", "res://.import/add.png-21abb41ff0da259ea2ccbb4becce111a.etc2.stex", "res://.import/add.png-21abb41ff0da259ea2ccbb4becce111a.etc.stex" ] - -[params] - -compress/mode=2 -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=true -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=false -process/premult_alpha=true -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/icons/delete.png b/icons/delete.png deleted file mode 100644 index 2b1f562..0000000 Binary files a/icons/delete.png and /dev/null differ diff --git a/icons/delete.png.import b/icons/delete.png.import deleted file mode 100644 index eaad4c1..0000000 --- a/icons/delete.png.import +++ /dev/null @@ -1,38 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path.s3tc="res://.import/delete.png-48500a9e66ed6e102e89aa5542feee73.s3tc.stex" -path.etc2="res://.import/delete.png-48500a9e66ed6e102e89aa5542feee73.etc2.stex" -path.etc="res://.import/delete.png-48500a9e66ed6e102e89aa5542feee73.etc.stex" -metadata={ -"imported_formats": [ "s3tc", "etc2", "etc" ], -"vram_texture": true -} - -[deps] - -source_file="res://icons/delete.png" -dest_files=[ "res://.import/delete.png-48500a9e66ed6e102e89aa5542feee73.s3tc.stex", "res://.import/delete.png-48500a9e66ed6e102e89aa5542feee73.etc2.stex", "res://.import/delete.png-48500a9e66ed6e102e89aa5542feee73.etc.stex" ] - -[params] - -compress/mode=2 -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=true -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=false -process/premult_alpha=true -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/icons/edit.png b/icons/edit.png deleted file mode 100755 index 01fb607..0000000 Binary files a/icons/edit.png and /dev/null differ diff --git a/icons/edit.png.import b/icons/edit.png.import deleted file mode 100644 index baee812..0000000 --- a/icons/edit.png.import +++ /dev/null @@ -1,38 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path.s3tc="res://.import/edit.png-d9148ff44b5b1c8f3b0a53a3c3c7c1c0.s3tc.stex" -path.etc2="res://.import/edit.png-d9148ff44b5b1c8f3b0a53a3c3c7c1c0.etc2.stex" -path.etc="res://.import/edit.png-d9148ff44b5b1c8f3b0a53a3c3c7c1c0.etc.stex" -metadata={ -"imported_formats": [ "s3tc", "etc2", "etc" ], -"vram_texture": true -} - -[deps] - -source_file="res://icons/edit.png" -dest_files=[ "res://.import/edit.png-d9148ff44b5b1c8f3b0a53a3c3c7c1c0.s3tc.stex", "res://.import/edit.png-d9148ff44b5b1c8f3b0a53a3c3c7c1c0.etc2.stex", "res://.import/edit.png-d9148ff44b5b1c8f3b0a53a3c3c7c1c0.etc.stex" ] - -[params] - -compress/mode=2 -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=true -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=false -process/premult_alpha=true -process/HDR_as_SRGB=false -process/invert_color=false -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=false -svg/scale=1.0 diff --git a/main.tscn b/main.tscn index f7a0d0a..d70be12 100644 --- a/main.tscn +++ b/main.tscn @@ -195,12 +195,14 @@ margin_bottom = 992.0 rect_min_size = Vector2( 0, 62 ) placeholder = "Intervention" -[node name="is_urgency" type="CheckButton" parent="stage/controls" index="12"] +[node name="is_urgency" type="Button" parent="stage/controls" index="12"] margin_top = 1002.0 margin_right = 1080.0 margin_bottom = 1064.0 rect_min_size = Vector2( 0, 62 ) +toggle_mode = true text = "Is urgency" +align = 0 [node name="notes" type="LineEdit" parent="stage/controls" index="13"] margin_top = 1074.0 diff --git a/readme.md b/readme.md index d0992b2..7e7d02b 100644 --- a/readme.md +++ b/readme.md @@ -70,8 +70,8 @@ Surgery Log - [ ] Buttons normal are too dark; - [ ] Dialog buttons and stage items have minimum vertical size set to 62; maybe do this on theme; - [ ] LineEdit: thinner lines on normal; bigger brighter lines on focus; more vertical content margin - - [ ] Smaller font - - [ ] Rounder buttons + - [x] Smaller font + - [x] Rounder buttons - [ ] Increase buttons height - [ ] Make database and stage buttons equal; - [ ] Apply theme on menubutton popup; diff --git a/themes/dark.tres b/themes/dark.tres index e50b548..8ec4e1b 100644 --- a/themes/dark.tres +++ b/themes/dark.tres @@ -10,7 +10,7 @@ content_margin_right = 10.0 [sub_resource type="StyleBoxFlat" id=11] content_margin_left = 10.0 content_margin_right = 10.0 -bg_color = Color( 0.22, 0.35, 0.5, 0.5 ) +bg_color = Color( 0.135, 0.20925, 0.3, 1 ) corner_radius_top_left = 15 corner_radius_top_right = 15 corner_radius_bottom_right = 15 @@ -19,7 +19,7 @@ corner_radius_bottom_left = 15 [sub_resource type="StyleBoxFlat" id=2] content_margin_left = 10.0 content_margin_right = 10.0 -bg_color = Color( 0.11, 0.11, 0.11, 1 ) +bg_color = Color( 0.25, 0.25, 0.25, 1 ) corner_radius_top_left = 15 corner_radius_top_right = 15 corner_radius_bottom_right = 15 @@ -53,7 +53,7 @@ border_width_bottom = 2 border_color = Color( 0.329412, 0.329412, 0.329412, 1 ) [sub_resource type="StyleBoxFlat" id=12] -bg_color = Color( 0.22, 0.22, 0.22, 1 ) +bg_color = Color( 0.15, 0.15, 0.15, 1 ) corner_radius_top_left = 15 corner_radius_top_right = 15 corner_radius_bottom_right = 15 diff --git a/touch_vertical_container/touch_vertical_container.gd b/touch_vertical_container/touch_vertical_container.gd index 4633c64..8f87338 100644 --- a/touch_vertical_container/touch_vertical_container.gd +++ b/touch_vertical_container/touch_vertical_container.gd @@ -99,7 +99,7 @@ func pointer_input_on_click_handler(pointer: PointerInputSensor.PointerInputData continue var control: Control = node - if control is CheckBox || control is CheckButton: + if control is CheckBox || control is CheckButton || (control is Button && control.toggle_mode == true): control.pressed = !control.pressed control.grab_focus() -- cgit v1.2.3 From a084df95867a478d5cb2ddc1ad53322082c52450 Mon Sep 17 00:00:00 2001 From: dam Date: Sat, 9 Apr 2022 02:28:28 +0000 Subject: Increased size of database icons. --- main.tscn | 24 ++++++++++++++++-------- themes/dark.tres | 6 +++--- 2 files changed, 19 insertions(+), 11 deletions(-) (limited to 'themes/dark.tres') diff --git a/main.tscn b/main.tscn index d70be12..4a99142 100644 --- a/main.tscn +++ b/main.tscn @@ -27,9 +27,12 @@ script = ExtResource( 5 ) [node name="menu" type="MenuButton" parent="database"] anchor_left = 1.0 anchor_right = 1.0 +margin_left = -112.0 margin_top = 32.0 margin_right = -32.0 +margin_bottom = 112.0 grow_horizontal = 0 +rect_min_size = Vector2( 90, 90 ) custom_fonts/font = ExtResource( 6 ) text = "" flat = false @@ -44,10 +47,13 @@ margin_right = -32.0 margin_bottom = -32.0 grow_horizontal = 0 grow_vertical = 0 +custom_constants/separation = 30 +alignment = 2 [node name="delete" type="Button" parent="database/actions"] -margin_right = 63.0 -margin_bottom = 56.0 +margin_right = 90.0 +margin_bottom = 80.0 +rect_min_size = Vector2( 80, 80 ) focus_mode = 0 custom_fonts/font = ExtResource( 6 ) shortcut_in_tooltip = false @@ -58,9 +64,10 @@ __meta__ = { } [node name="edit" type="Button" parent="database/actions"] -margin_top = 66.0 -margin_right = 63.0 -margin_bottom = 122.0 +margin_top = 110.0 +margin_right = 90.0 +margin_bottom = 190.0 +rect_min_size = Vector2( 80, 80 ) focus_mode = 0 custom_fonts/font = ExtResource( 6 ) shortcut_in_tooltip = false @@ -71,9 +78,10 @@ __meta__ = { } [node name="add" type="Button" parent="database/actions"] -margin_top = 132.0 -margin_right = 63.0 -margin_bottom = 188.0 +margin_top = 220.0 +margin_right = 90.0 +margin_bottom = 310.0 +rect_min_size = Vector2( 90, 90 ) focus_mode = 0 custom_fonts/font = ExtResource( 6 ) shortcut_in_tooltip = false diff --git a/themes/dark.tres b/themes/dark.tres index 8ec4e1b..92ca706 100644 --- a/themes/dark.tres +++ b/themes/dark.tres @@ -10,7 +10,7 @@ content_margin_right = 10.0 [sub_resource type="StyleBoxFlat" id=11] content_margin_left = 10.0 content_margin_right = 10.0 -bg_color = Color( 0.135, 0.20925, 0.3, 1 ) +bg_color = Color( 0.133333, 0.207843, 0.301961, 0.784314 ) corner_radius_top_left = 15 corner_radius_top_right = 15 corner_radius_bottom_right = 15 @@ -19,7 +19,7 @@ corner_radius_bottom_left = 15 [sub_resource type="StyleBoxFlat" id=2] content_margin_left = 10.0 content_margin_right = 10.0 -bg_color = Color( 0.25, 0.25, 0.25, 1 ) +bg_color = Color( 0.25, 0.25, 0.25, 0.784314 ) corner_radius_top_left = 15 corner_radius_top_right = 15 corner_radius_bottom_right = 15 @@ -28,7 +28,7 @@ corner_radius_bottom_left = 15 [sub_resource type="StyleBoxFlat" id=4] content_margin_left = 10.0 content_margin_right = 10.0 -bg_color = Color( 0.223529, 0.352941, 0.501961, 1 ) +bg_color = Color( 0.225, 0.353333, 0.5, 0.784314 ) corner_radius_top_left = 15 corner_radius_top_right = 15 corner_radius_bottom_right = 15 -- cgit v1.2.3 From e02b6d1e72deaf5f98bc7d78c7f0e6d269174d7b Mon Sep 17 00:00:00 2001 From: dam Date: Sat, 9 Apr 2022 02:42:46 +0000 Subject: Themed database popup menu. --- menu/menu.gd | 2 +- themes/dark.tres | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'themes/dark.tres') diff --git a/menu/menu.gd b/menu/menu.gd index 735f86a..c3e3185 100644 --- a/menu/menu.gd +++ b/menu/menu.gd @@ -8,7 +8,7 @@ const menu_items: Array = [ { label = "Export Database", action = "export_database_action" }, { label = "Clear Database", action = "clear_database_action" }, { label = "About", action = "about_action" }, - { label = "TEST_FAKE_DB", action = "test_fake_db_action" }, +# { label = "TEST_FAKE_DB", action = "test_fake_db_action" }, ] const license_font_b612: String = "res://licenses/font_b612.txt" const license_godot: String = "res://licenses/godot.txt" diff --git a/themes/dark.tres b/themes/dark.tres index 92ca706..3e3fcc2 100644 --- a/themes/dark.tres +++ b/themes/dark.tres @@ -1,4 +1,4 @@ -[gd_resource type="Theme" load_steps=11 format=2] +[gd_resource type="Theme" load_steps=12 format=2] [ext_resource path="res://fonts/font_regular.tres" type="DynamicFont" id=1] [ext_resource path="res://fonts/font_mono_regular.tres" type="DynamicFont" id=2] @@ -59,6 +59,17 @@ corner_radius_top_right = 15 corner_radius_bottom_right = 15 corner_radius_bottom_left = 15 +[sub_resource type="StyleBoxFlat" id=13] +content_margin_left = 20.0 +content_margin_right = 20.0 +content_margin_top = 10.0 +content_margin_bottom = 10.0 +bg_color = Color( 0.15, 0.15, 0.15, 1 ) +corner_radius_top_left = 15 +corner_radius_top_right = 15 +corner_radius_bottom_right = 15 +corner_radius_bottom_left = 15 + [resource] default_font = ExtResource( 1 ) Button/styles/disabled = SubResource( 10 ) @@ -72,4 +83,6 @@ LineEdit/styles/focus = SubResource( 9 ) LineEdit/styles/normal = SubResource( 7 ) LineEdit/styles/read_only = null Panel/styles/panel = SubResource( 12 ) +PopupMenu/constants/vseparation = 20 +PopupMenu/styles/panel = SubResource( 13 ) VBoxContainer/constants/separation = 10 -- cgit v1.2.3 From 125a893ad6afe1347ae36317566270e0f3582611 Mon Sep 17 00:00:00 2001 From: dam Date: Sat, 9 Apr 2022 03:12:32 +0000 Subject: Added vertical separation to OptionSetList. Item selected on database gets highlighted. --- option_set/option_set_list.gd | 34 ++++++++++++++++------------------ readme.md | 14 -------------- themes/dark.tres | 2 ++ 3 files changed, 18 insertions(+), 32 deletions(-) (limited to 'themes/dark.tres') diff --git a/option_set/option_set_list.gd b/option_set/option_set_list.gd index 4a8841f..1ab753b 100644 --- a/option_set/option_set_list.gd +++ b/option_set/option_set_list.gd @@ -5,11 +5,11 @@ const POINTER_VELOCITY_DECAYING_FACTOR: float = PI const POINTER_VELOCITY_BOOST_FACTOR: float = 1.25 const EXACT_SELECTION: bool = false -export var clear_signals_on_hide := true - signal selection_changed # (idx: int, text: String) +export var clear_signals_on_hide := true export var autowrap := true +export var separation := 25 var v_scroll_bar : VScrollBar var sensor : PointerInputSensor @@ -58,17 +58,7 @@ func _init(): sensor.anchor_bottom = 1.0 sensor.name = "sensor" add_child(sensor) - - normal_style = StyleBoxFlat.new() - normal_style.border_width_bottom = border_size - normal_style.border_color = Color.white * 0.333 - normal_style.bg_color = Color.transparent - - selected_style = StyleBoxFlat.new() - selected_style.border_width_bottom = border_size - selected_style.border_color = Color.white * 0.333 - selected_style.bg_color = Color.dimgray - + connect("resized", self, "mark_as_dirty") sensor.connect("on_press", self, "pointer_input_on_press_handler") @@ -78,9 +68,17 @@ func _init(): sensor.connect("on_scroll", self, "pointer_input_on_scroll_handler") -#func _ready(): -# for idx in range(5): -# add_item(">> %d" % idx) +func _ready(): + normal_style = StyleBoxFlat.new() + normal_style.border_width_bottom = border_size + normal_style.border_color = Color.white * 0.333 + normal_style.bg_color = Color.transparent + + selected_style = StyleBoxFlat.new() + var bg_color = get_stylebox("pressed", "Button").bg_color + selected_style.border_width_bottom = border_size + selected_style.border_color = bg_color.lightened(0.333) + selected_style.bg_color = bg_color func mark_as_dirty(): @@ -143,7 +141,7 @@ func build_labels(): var label := Label.new() label.autowrap = autowrap label.anchor_right = 1.0 - label.valign = Label.VALIGN_TOP + label.valign = Label.VALIGN_CENTER labels.add_child(label) delta -= 1 @@ -166,7 +164,7 @@ func build_labels(): for it in items: proto_label.text = it var line_count := proto_label.get_line_count() - var height := line_count * line_height + (line_count - 1) * line_spacing + border_size + var height := line_count * line_height + (line_count - 1) * line_spacing + border_size + separation position += height labels_end_positions.append(position) diff --git a/readme.md b/readme.md index 7e7d02b..c347666 100644 --- a/readme.md +++ b/readme.md @@ -67,21 +67,7 @@ Surgery Log - on database screen, should deselect selected item, otherwise should quit the app; - [x] db entry should be printed as "%9s | %4s | %yyyy-%MM"; - [ ] Adjust theme: - - [ ] Buttons normal are too dark; - - [ ] Dialog buttons and stage items have minimum vertical size set to 62; maybe do this on theme; - - [ ] LineEdit: thinner lines on normal; bigger brighter lines on focus; more vertical content margin - - [x] Smaller font - - [x] Rounder buttons - - [ ] Increase buttons height - - [ ] Make database and stage buttons equal; - - [ ] Apply theme on menubutton popup; - - [ ] Make panels (popup background) rounder; - - [ ] Make all buttons with same style; - - [ ] Maybe include different font with better icons; - - [ ] Make rounded corners - - [ ] LineEdit without fill and only one line below (stage may increase left margin) - [ ] Increase scrollbar width (in content margin property) - - [ ] Improve appearance of database menu; - [ ] Create light theme; - [ ] Create theme entry in menu and save on settings file; - [ ] Cleanup code: diff --git a/themes/dark.tres b/themes/dark.tres index 3e3fcc2..93028ed 100644 --- a/themes/dark.tres +++ b/themes/dark.tres @@ -79,6 +79,8 @@ Button/styles/normal = SubResource( 2 ) Button/styles/pressed = SubResource( 4 ) ItemList/fonts/font = ExtResource( 2 ) ItemList/styles/bg = SubResource( 5 ) +ItemList/styles/selected = SubResource( 4 ) +ItemList/styles/selected_focus = SubResource( 4 ) LineEdit/styles/focus = SubResource( 9 ) LineEdit/styles/normal = SubResource( 7 ) LineEdit/styles/read_only = null -- cgit v1.2.3 From ef1e9b2bb922cf7eeadc9d1de87bb8bf1f44868f Mon Sep 17 00:00:00 2001 From: dam Date: Sat, 9 Apr 2022 03:46:27 +0000 Subject: Themed scrollbar. --- themes/dark.tres | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'themes/dark.tres') diff --git a/themes/dark.tres b/themes/dark.tres index 93028ed..cae45d9 100644 --- a/themes/dark.tres +++ b/themes/dark.tres @@ -1,4 +1,4 @@ -[gd_resource type="Theme" load_steps=12 format=2] +[gd_resource type="Theme" load_steps=16 format=2] [ext_resource path="res://fonts/font_regular.tres" type="DynamicFont" id=1] [ext_resource path="res://fonts/font_mono_regular.tres" type="DynamicFont" id=2] @@ -19,7 +19,7 @@ corner_radius_bottom_left = 15 [sub_resource type="StyleBoxFlat" id=2] content_margin_left = 10.0 content_margin_right = 10.0 -bg_color = Color( 0.25, 0.25, 0.25, 0.784314 ) +bg_color = Color( 0.25098, 0.25098, 0.25098, 0.784314 ) corner_radius_top_left = 15 corner_radius_top_right = 15 corner_radius_bottom_right = 15 @@ -28,7 +28,7 @@ corner_radius_bottom_left = 15 [sub_resource type="StyleBoxFlat" id=4] content_margin_left = 10.0 content_margin_right = 10.0 -bg_color = Color( 0.225, 0.353333, 0.5, 0.784314 ) +bg_color = Color( 0.223529, 0.352941, 0.501961, 0.784314 ) corner_radius_top_left = 15 corner_radius_top_right = 15 corner_radius_bottom_right = 15 @@ -70,6 +70,34 @@ corner_radius_top_right = 15 corner_radius_bottom_right = 15 corner_radius_bottom_left = 15 +[sub_resource type="StyleBoxFlat" id=14] +bg_color = Color( 0.25098, 0.25098, 0.25098, 0.784314 ) +corner_radius_top_left = 10 +corner_radius_top_right = 10 +corner_radius_bottom_right = 10 +corner_radius_bottom_left = 10 + +[sub_resource type="StyleBoxFlat" id=15] +bg_color = Color( 0.133333, 0.207843, 0.301961, 0.784314 ) +corner_radius_top_left = 10 +corner_radius_top_right = 10 +corner_radius_bottom_right = 10 +corner_radius_bottom_left = 10 + +[sub_resource type="StyleBoxFlat" id=16] +bg_color = Color( 0.223529, 0.352941, 0.501961, 0.784314 ) +corner_radius_top_left = 10 +corner_radius_top_right = 10 +corner_radius_bottom_right = 10 +corner_radius_bottom_left = 10 + +[sub_resource type="StyleBoxFlat" id=17] +content_margin_left = 10.0 +corner_radius_top_left = 10 +corner_radius_top_right = 10 +corner_radius_bottom_right = 10 +corner_radius_bottom_left = 10 + [resource] default_font = ExtResource( 1 ) Button/styles/disabled = SubResource( 10 ) @@ -88,3 +116,8 @@ Panel/styles/panel = SubResource( 12 ) PopupMenu/constants/vseparation = 20 PopupMenu/styles/panel = SubResource( 13 ) VBoxContainer/constants/separation = 10 +VScrollBar/styles/grabber = SubResource( 14 ) +VScrollBar/styles/grabber_highlight = SubResource( 15 ) +VScrollBar/styles/grabber_pressed = SubResource( 16 ) +VScrollBar/styles/scroll = SubResource( 17 ) +VScrollBar/styles/scroll_focus = SubResource( 17 ) -- cgit v1.2.3 From bbf6c49365e1169e843b819e05132b52072c6511 Mon Sep 17 00:00:00 2001 From: dam Date: Sat, 9 Apr 2022 03:48:10 +0000 Subject: Themed scrollbar with darker scroll area. --- themes/dark.tres | 1 + 1 file changed, 1 insertion(+) (limited to 'themes/dark.tres') diff --git a/themes/dark.tres b/themes/dark.tres index cae45d9..b4e7195 100644 --- a/themes/dark.tres +++ b/themes/dark.tres @@ -93,6 +93,7 @@ corner_radius_bottom_left = 10 [sub_resource type="StyleBoxFlat" id=17] content_margin_left = 10.0 +bg_color = Color( 0.11, 0.11, 0.11, 1 ) corner_radius_top_left = 10 corner_radius_top_right = 10 corner_radius_bottom_right = 10 -- cgit v1.2.3 From 8146ae8e43a26787159d5840bae876d79112bd44 Mon Sep 17 00:00:00 2001 From: dam Date: Sun, 10 Apr 2022 07:34:40 +0000 Subject: Themed scrollbar. Tweaked theme of option_set_list. --- logic/database.gd | 2 +- option_set/option_set_list.gd | 12 ++++++++--- themes/dark.tres | 46 ++++++++++++++++++++----------------------- 3 files changed, 31 insertions(+), 29 deletions(-) (limited to 'themes/dark.tres') diff --git a/logic/database.gd b/logic/database.gd index 92b707b..2f091b6 100644 --- a/logic/database.gd +++ b/logic/database.gd @@ -260,7 +260,7 @@ func clear_database(): #func DEBUG_create_fake_database(): # clear_database() -# for idx in range(500): +# for idx in range(100): # var today := OS.get_date(true) # var date_year = today.year + int(float(idx) / 30.0 / 12) # var date_month = 1 + int(float(idx) / 30.0) % 12 diff --git a/option_set/option_set_list.gd b/option_set/option_set_list.gd index 1ab753b..21692dd 100644 --- a/option_set/option_set_list.gd +++ b/option_set/option_set_list.gd @@ -75,10 +75,16 @@ func _ready(): normal_style.bg_color = Color.transparent selected_style = StyleBoxFlat.new() - var bg_color = get_stylebox("pressed", "Button").bg_color - selected_style.border_width_bottom = border_size - selected_style.border_color = bg_color.lightened(0.333) + var button_style := get_stylebox("pressed", "Button") + var bg_color := button_style.bg_color as Color + var corner_radius := button_style.corner_radius_top_right as int +# selected_style.border_width_bottom = border_size +# selected_style.border_color = bg_color.lightened(0.333) selected_style.bg_color = bg_color + selected_style.corner_radius_top_left = corner_radius + selected_style.corner_radius_top_right = corner_radius + selected_style.corner_radius_bottom_right = corner_radius + selected_style.corner_radius_bottom_left = corner_radius func mark_as_dirty(): diff --git a/themes/dark.tres b/themes/dark.tres index b4e7195..05de2a0 100644 --- a/themes/dark.tres +++ b/themes/dark.tres @@ -10,7 +10,7 @@ content_margin_right = 10.0 [sub_resource type="StyleBoxFlat" id=11] content_margin_left = 10.0 content_margin_right = 10.0 -bg_color = Color( 0.133333, 0.207843, 0.301961, 0.784314 ) +bg_color = Color( 0.223529, 0.352941, 0.501961, 0.784314 ) corner_radius_top_left = 15 corner_radius_top_right = 15 corner_radius_bottom_right = 15 @@ -19,7 +19,7 @@ corner_radius_bottom_left = 15 [sub_resource type="StyleBoxFlat" id=2] content_margin_left = 10.0 content_margin_right = 10.0 -bg_color = Color( 0.25098, 0.25098, 0.25098, 0.784314 ) +bg_color = Color( 0.25098, 0.25098, 0.25098, 0.870588 ) corner_radius_top_left = 15 corner_radius_top_right = 15 corner_radius_bottom_right = 15 @@ -28,7 +28,7 @@ corner_radius_bottom_left = 15 [sub_resource type="StyleBoxFlat" id=4] content_margin_left = 10.0 content_margin_right = 10.0 -bg_color = Color( 0.223529, 0.352941, 0.501961, 0.784314 ) +bg_color = Color( 0.337255, 0.529412, 0.74902, 0.870588 ) corner_radius_top_left = 15 corner_radius_top_right = 15 corner_radius_bottom_right = 15 @@ -42,7 +42,7 @@ content_margin_right = 10.0 bg_color = Color( 0, 0, 0, 0 ) draw_center = false border_width_bottom = 4 -border_color = Color( 0.223529, 0.352941, 0.501961, 1 ) +border_color = Color( 0.337255, 0.529412, 0.74902, 0.870588 ) [sub_resource type="StyleBoxFlat" id=7] content_margin_left = 10.0 @@ -59,6 +59,13 @@ corner_radius_top_right = 15 corner_radius_bottom_right = 15 corner_radius_bottom_left = 15 +[sub_resource type="StyleBoxFlat" id=20] +bg_color = Color( 0.223529, 0.352941, 0.501961, 0.784314 ) +corner_radius_top_left = 15 +corner_radius_top_right = 15 +corner_radius_bottom_right = 15 +corner_radius_bottom_left = 15 + [sub_resource type="StyleBoxFlat" id=13] content_margin_left = 20.0 content_margin_right = 20.0 @@ -70,35 +77,23 @@ corner_radius_top_right = 15 corner_radius_bottom_right = 15 corner_radius_bottom_left = 15 -[sub_resource type="StyleBoxFlat" id=14] -bg_color = Color( 0.25098, 0.25098, 0.25098, 0.784314 ) -corner_radius_top_left = 10 -corner_radius_top_right = 10 -corner_radius_bottom_right = 10 -corner_radius_bottom_left = 10 - -[sub_resource type="StyleBoxFlat" id=15] -bg_color = Color( 0.133333, 0.207843, 0.301961, 0.784314 ) -corner_radius_top_left = 10 -corner_radius_top_right = 10 -corner_radius_bottom_right = 10 -corner_radius_bottom_left = 10 - -[sub_resource type="StyleBoxFlat" id=16] +[sub_resource type="StyleBoxFlat" id=18] bg_color = Color( 0.223529, 0.352941, 0.501961, 0.784314 ) corner_radius_top_left = 10 corner_radius_top_right = 10 corner_radius_bottom_right = 10 corner_radius_bottom_left = 10 -[sub_resource type="StyleBoxFlat" id=17] -content_margin_left = 10.0 -bg_color = Color( 0.11, 0.11, 0.11, 1 ) +[sub_resource type="StyleBoxFlat" id=19] +bg_color = Color( 0.337255, 0.529412, 0.74902, 0.870588 ) corner_radius_top_left = 10 corner_radius_top_right = 10 corner_radius_bottom_right = 10 corner_radius_bottom_left = 10 +[sub_resource type="StyleBoxEmpty" id=17] +content_margin_left = 20.0 + [resource] default_font = ExtResource( 1 ) Button/styles/disabled = SubResource( 10 ) @@ -115,10 +110,11 @@ LineEdit/styles/normal = SubResource( 7 ) LineEdit/styles/read_only = null Panel/styles/panel = SubResource( 12 ) PopupMenu/constants/vseparation = 20 +PopupMenu/styles/hover = SubResource( 20 ) PopupMenu/styles/panel = SubResource( 13 ) VBoxContainer/constants/separation = 10 -VScrollBar/styles/grabber = SubResource( 14 ) -VScrollBar/styles/grabber_highlight = SubResource( 15 ) -VScrollBar/styles/grabber_pressed = SubResource( 16 ) +VScrollBar/styles/grabber = SubResource( 18 ) +VScrollBar/styles/grabber_highlight = SubResource( 18 ) +VScrollBar/styles/grabber_pressed = SubResource( 19 ) VScrollBar/styles/scroll = SubResource( 17 ) VScrollBar/styles/scroll_focus = SubResource( 17 ) -- cgit v1.2.3 From fd0fa8bebfdcd77177c58e68b8a742ab5a338f17 Mon Sep 17 00:00:00 2001 From: dam Date: Sun, 10 Apr 2022 07:47:01 +0000 Subject: Added content margin on option_set_list items. --- option_set/option_set_list.gd | 16 +++++++++++----- themes/dark.tres | 8 +++++++- 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'themes/dark.tres') diff --git a/option_set/option_set_list.gd b/option_set/option_set_list.gd index 21692dd..fda2c04 100644 --- a/option_set/option_set_list.gd +++ b/option_set/option_set_list.gd @@ -69,22 +69,28 @@ func _init(): func _ready(): + var button_style := get_stylebox("pressed", "Button") + var label_style := get_stylebox("normal", "Label") + normal_style = StyleBoxFlat.new() normal_style.border_width_bottom = border_size normal_style.border_color = Color.white * 0.333 normal_style.bg_color = Color.transparent + normal_style.content_margin_left = label_style.content_margin_left + normal_style.content_margin_top = label_style.content_margin_top + normal_style.content_margin_right = label_style.content_margin_right - selected_style = StyleBoxFlat.new() - var button_style := get_stylebox("pressed", "Button") var bg_color := button_style.bg_color as Color var corner_radius := button_style.corner_radius_top_right as int -# selected_style.border_width_bottom = border_size -# selected_style.border_color = bg_color.lightened(0.333) + selected_style = StyleBoxFlat.new() selected_style.bg_color = bg_color selected_style.corner_radius_top_left = corner_radius selected_style.corner_radius_top_right = corner_radius selected_style.corner_radius_bottom_right = corner_radius selected_style.corner_radius_bottom_left = corner_radius + selected_style.content_margin_left = label_style.content_margin_left + selected_style.content_margin_top = label_style.content_margin_top + selected_style.content_margin_right = label_style.content_margin_right func mark_as_dirty(): @@ -147,7 +153,7 @@ func build_labels(): var label := Label.new() label.autowrap = autowrap label.anchor_right = 1.0 - label.valign = Label.VALIGN_CENTER + label.valign = Label.VALIGN_TOP labels.add_child(label) delta -= 1 diff --git a/themes/dark.tres b/themes/dark.tres index 05de2a0..875ee21 100644 --- a/themes/dark.tres +++ b/themes/dark.tres @@ -1,4 +1,4 @@ -[gd_resource type="Theme" load_steps=16 format=2] +[gd_resource type="Theme" load_steps=17 format=2] [ext_resource path="res://fonts/font_regular.tres" type="DynamicFont" id=1] [ext_resource path="res://fonts/font_mono_regular.tres" type="DynamicFont" id=2] @@ -36,6 +36,11 @@ corner_radius_bottom_left = 15 [sub_resource type="StyleBoxEmpty" id=5] +[sub_resource type="StyleBoxEmpty" id=21] +content_margin_left = 10.0 +content_margin_right = 10.0 +content_margin_top = 15.0 + [sub_resource type="StyleBoxFlat" id=9] content_margin_left = 10.0 content_margin_right = 10.0 @@ -105,6 +110,7 @@ ItemList/fonts/font = ExtResource( 2 ) ItemList/styles/bg = SubResource( 5 ) ItemList/styles/selected = SubResource( 4 ) ItemList/styles/selected_focus = SubResource( 4 ) +Label/styles/normal = SubResource( 21 ) LineEdit/styles/focus = SubResource( 9 ) LineEdit/styles/normal = SubResource( 7 ) LineEdit/styles/read_only = null -- cgit v1.2.3