diff options
| author | dam <dam@gudinoff> | 2022-06-17 23:53:52 +0000 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2022-06-17 23:53:52 +0000 |
| commit | bc7df6808b404f96dd8a0677a90b4dcfaf9eca47 (patch) | |
| tree | 9666debba4bb7a9a476f308a883444c5a8aa1021 | |
| parent | 075aa00b2bdda61640c3e089a8d01c898506903a (diff) | |
| download | surgery-log-bc7df6808b404f96dd8a0677a90b4dcfaf9eca47.tar.zst surgery-log-bc7df6808b404f96dd8a0677a90b4dcfaf9eca47.zip | |
First iteration over the day/night themes.
| -rw-r--r-- | main.gd | 6 | ||||
| -rw-r--r-- | project.godot | 2 | ||||
| -rw-r--r-- | readme.md | 10 | ||||
| -rw-r--r-- | themes/day.tres | 27 | ||||
| -rw-r--r-- | themes/night.tres | 6 | ||||
| -rw-r--r-- | ui/date_picker/date_picker.tscn | 4 | ||||
| -rw-r--r-- | ui/modal_popup/modal_popup.gd | 4 |
7 files changed, 39 insertions, 20 deletions
@@ -6,10 +6,6 @@ var themes := [ preload("res://themes/day.tres") as Theme, preload("res://themes/night.tres") as Theme ] -var themes_color := [ - Color.white, - Color.black -] onready var settings := Settings.new() onready var popup := get_node("/root/main/popup") as ModalPopup @@ -87,6 +83,6 @@ func toggle_theme(): func apply_theme(theme_idx: int) -> void: self.theme = themes[theme_idx] - VisualServer.set_default_clear_color(themes_color[theme_idx]) + VisualServer.set_default_clear_color(get_color("background", "theme")) diff --git a/project.godot b/project.godot index 7539c83..e00d6c5 100644 --- a/project.godot +++ b/project.godot @@ -29,7 +29,7 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://ui/dialog/dialog.gd" }, { -"base": "Control", +"base": "ColorRect", "class": "ModalPopup", "language": "GDScript", "path": "res://ui/modal_popup/modal_popup.gd" @@ -69,9 +69,13 @@ Surgery Log - [x] Cleanup code: - [x] Search by tags @DAM and TODO; - [x] Rename dialog and popup classes; - - [x] Reorganize code files; -- [ ] Create light theme; -- [ ] Create theme entry in menu and save on settings file; + - [x] Reorganize code files; +- [ ] Create day/night themes: + - [x] Store configuration on settings file; + - [x] fix ui on modal_popup; + - [ ] use logo's red as key-color on the ui; low saturation on normal buttons; increase a bit of saturation and alpha for hover; boost on selected/pressed; + - [ ] fix ui of file-picker +- [ ] fix access on android 11; Try using [MANAGE_EXTERNAL_STORAGE](https://github.com/godotengine/godot/pull/49435) or wait for v4.0? - [ ] main/screen_controller is responsible for whos currently on focus, fade animations, input access (enable/disable), and back_key_notification handling. For input use: node.set_process_input(!pause) diff --git a/themes/day.tres b/themes/day.tres index 22fef09..a8b786d 100644 --- a/themes/day.tres +++ b/themes/day.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.223529, 0.352941, 0.501961, 0.784314 ) +bg_color = Color( 0.615686, 0.776471, 0.94902, 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.870588 ) +bg_color = Color( 0.74902, 0.74902, 0.74902, 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.337255, 0.529412, 0.74902, 0.870588 ) +bg_color = Color( 0.475, 0.696667, 0.95, 0.870588 ) corner_radius_top_left = 15 corner_radius_top_right = 15 corner_radius_bottom_right = 15 @@ -47,7 +47,7 @@ content_margin_right = 10.0 bg_color = Color( 0, 0, 0, 0 ) draw_center = false border_width_bottom = 4 -border_color = Color( 0.337255, 0.529412, 0.74902, 0.870588 ) +border_color = Color( 0.475, 0.696667, 0.95, 0.870588 ) [sub_resource type="StyleBoxFlat" id=7] content_margin_left = 10.0 @@ -58,25 +58,27 @@ border_width_bottom = 2 border_color = Color( 0.329412, 0.329412, 0.329412, 1 ) [sub_resource type="StyleBoxFlat" id=12] -bg_color = Color( 0.85, 0.85, 0.85, 1 ) +bg_color = Color( 0.85098, 0.85098, 0.85098, 1 ) 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=20] -bg_color = Color( 0.223529, 0.352941, 0.501961, 0.784314 ) +bg_color = Color( 0.615686, 0.776471, 0.94902, 0.784314 ) corner_radius_top_left = 15 corner_radius_top_right = 15 corner_radius_bottom_right = 15 corner_radius_bottom_left = 15 +expand_margin_left = 5.0 +expand_margin_right = 5.0 [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 ) +bg_color = Color( 0.85, 0.85, 0.85, 1 ) corner_radius_top_left = 15 corner_radius_top_right = 15 corner_radius_bottom_right = 15 @@ -102,6 +104,7 @@ content_margin_left = 20.0 [resource] default_font = ExtResource( 1 ) Button/colors/font_color = Color( 0.121569, 0.121569, 0.121569, 1 ) +Button/colors/font_color_disabled = Color( 0.1, 0.1, 0.1, 0.2 ) Button/colors/font_color_focus = Color( 0.06, 0.06, 0.06, 1 ) Button/colors/font_color_hover = Color( 0.06, 0.06, 0.06, 1 ) Button/colors/font_color_pressed = Color( 0, 0, 0, 1 ) @@ -110,15 +113,24 @@ Button/styles/focus = SubResource( 10 ) Button/styles/hover = SubResource( 11 ) Button/styles/normal = SubResource( 2 ) Button/styles/pressed = SubResource( 4 ) +ItemList/colors/font_color = Color( 0.37, 0.37, 0.37, 1 ) +ItemList/colors/font_color_selected = Color( 0, 0, 0, 1 ) +ItemList/colors/guide_color = Color( 0.74902, 0.74902, 0.74902, 0.870588 ) ItemList/fonts/font = ExtResource( 2 ) ItemList/styles/bg = SubResource( 5 ) ItemList/styles/selected = SubResource( 4 ) ItemList/styles/selected_focus = SubResource( 4 ) +Label/colors/font_color = Color( 0, 0, 0, 1 ) Label/styles/normal = SubResource( 21 ) +LineEdit/colors/cursor_color = Color( 0.06, 0.06, 0.06, 1 ) +LineEdit/colors/font_color = Color( 0.12, 0.12, 0.12, 1 ) +LineEdit/colors/font_color_selected = Color( 1, 1, 1, 1 ) LineEdit/styles/focus = SubResource( 9 ) LineEdit/styles/normal = SubResource( 7 ) LineEdit/styles/read_only = null Panel/styles/panel = SubResource( 12 ) +PopupMenu/colors/font_color = Color( 0.12, 0.12, 0.12, 1 ) +PopupMenu/colors/font_color_hover = Color( 0.12, 0.12, 0.12, 1 ) PopupMenu/constants/vseparation = 20 PopupMenu/styles/hover = SubResource( 20 ) PopupMenu/styles/panel = SubResource( 13 ) @@ -128,3 +140,4 @@ VScrollBar/styles/grabber_highlight = SubResource( 18 ) VScrollBar/styles/grabber_pressed = SubResource( 19 ) VScrollBar/styles/scroll = SubResource( 17 ) VScrollBar/styles/scroll_focus = SubResource( 17 ) +theme/colors/background = Color( 1, 1, 1, 1 ) diff --git a/themes/night.tres b/themes/night.tres index 875ee21..558a8da 100644 --- a/themes/night.tres +++ b/themes/night.tres @@ -58,7 +58,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.15, 0.15, 0.15, 1 ) +bg_color = Color( 0.14902, 0.14902, 0.14902, 1 ) corner_radius_top_left = 15 corner_radius_top_right = 15 corner_radius_bottom_right = 15 @@ -70,6 +70,8 @@ corner_radius_top_left = 15 corner_radius_top_right = 15 corner_radius_bottom_right = 15 corner_radius_bottom_left = 15 +expand_margin_left = 5.0 +expand_margin_right = 5.0 [sub_resource type="StyleBoxFlat" id=13] content_margin_left = 20.0 @@ -106,6 +108,7 @@ Button/styles/focus = SubResource( 10 ) Button/styles/hover = SubResource( 11 ) Button/styles/normal = SubResource( 2 ) Button/styles/pressed = SubResource( 4 ) +ItemList/colors/guide_color = Color( 0.25098, 0.25098, 0.25098, 0.25098 ) ItemList/fonts/font = ExtResource( 2 ) ItemList/styles/bg = SubResource( 5 ) ItemList/styles/selected = SubResource( 4 ) @@ -124,3 +127,4 @@ VScrollBar/styles/grabber_highlight = SubResource( 18 ) VScrollBar/styles/grabber_pressed = SubResource( 19 ) VScrollBar/styles/scroll = SubResource( 17 ) VScrollBar/styles/scroll_focus = SubResource( 17 ) +theme/colors/background = Color( 0, 0, 0, 1 ) diff --git a/ui/date_picker/date_picker.tscn b/ui/date_picker/date_picker.tscn index e3d88c4..0e2e64e 100644 --- a/ui/date_picker/date_picker.tscn +++ b/ui/date_picker/date_picker.tscn @@ -174,7 +174,7 @@ __meta__ = { anchor_top = 0.333 anchor_right = 1.0 anchor_bottom = 0.343 -color = Color( 1, 1, 1, 0.25 ) +color = Color( 0.501961, 0.501961, 0.501961, 0.501961 ) __meta__ = { "_edit_use_anchors_": false } @@ -183,7 +183,7 @@ __meta__ = { anchor_top = 0.666 anchor_right = 1.0 anchor_bottom = 0.676 -color = Color( 1, 1, 1, 0.25 ) +color = Color( 0.501961, 0.501961, 0.501961, 0.501961 ) __meta__ = { "_edit_use_anchors_": false } diff --git a/ui/modal_popup/modal_popup.gd b/ui/modal_popup/modal_popup.gd index 95fc2c3..857f90e 100644 --- a/ui/modal_popup/modal_popup.gd +++ b/ui/modal_popup/modal_popup.gd @@ -1,4 +1,4 @@ -extends Control +extends ColorRect class_name ModalPopup signal dismissed # () @@ -42,6 +42,8 @@ func open_popup(title: String, item: Control): if visible == true: return + self.color = get_color("background", "theme") + self.color.a = 0.85 self.title.text = title control = item |
