aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordam <dam@gudinoff>2022-06-22 13:40:01 +0000
committerdam <dam@gudinoff>2022-06-22 13:40:01 +0000
commit44d634db3f42ae60b42a1a20892d11faabc3c1b0 (patch)
tree4746d0f4ee812b7fd4d5abfa7e6e9bcec0471825
parentbc7df6808b404f96dd8a0677a90b4dcfaf9eca47 (diff)
downloadsurgery-log-44d634db3f42ae60b42a1a20892d11faabc3c1b0.tar.zst
surgery-log-44d634db3f42ae60b42a1a20892d11faabc3c1b0.zip
Night theme completed.
-rw-r--r--main.gd2
-rw-r--r--themes/day.tres32
-rw-r--r--themes/night.tres63
-rw-r--r--ui/date_picker/date_picker.tscn55
-rw-r--r--ui/modal_popup/modal_popup.gd2
-rw-r--r--ui/modal_popup/modal_popup.tscn6
-rw-r--r--ui/option_set/option_set_list.gd38
7 files changed, 105 insertions, 93 deletions
diff --git a/main.gd b/main.gd
index 393d6f0..5d17d68 100644
--- a/main.gd
+++ b/main.gd
@@ -83,6 +83,6 @@ func toggle_theme():
func apply_theme(theme_idx: int) -> void:
self.theme = themes[theme_idx]
- VisualServer.set_default_clear_color(get_color("background", "theme"))
+ VisualServer.set_default_clear_color(get_color("background", "Misc"))
diff --git a/themes/day.tres b/themes/day.tres
index a8b786d..375928a 100644
--- a/themes/day.tres
+++ b/themes/day.tres
@@ -1,4 +1,4 @@
-[gd_resource type="Theme" load_steps=17 format=2]
+[gd_resource type="Theme" load_steps=18 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]
@@ -7,35 +7,39 @@
content_margin_left = 10.0
content_margin_right = 10.0
-[sub_resource type="StyleBoxFlat" id=11]
+[sub_resource type="StyleBoxFlat" id=2]
content_margin_left = 10.0
content_margin_right = 10.0
-bg_color = Color( 0.615686, 0.776471, 0.94902, 0.784314 )
+bg_color = Color( 1, 0.34, 0.34, 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=2]
+[sub_resource type="StyleBoxFlat" id=22]
content_margin_left = 10.0
content_margin_right = 10.0
-bg_color = Color( 0.74902, 0.74902, 0.74902, 0.870588 )
+bg_color = Color( 1, 0.231373, 0.231373, 1 )
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=24]
+
[sub_resource type="StyleBoxFlat" id=4]
content_margin_left = 10.0
content_margin_right = 10.0
bg_color = Color( 0.475, 0.696667, 0.95, 0.870588 )
+border_width_left = 5
+border_width_top = 5
+border_width_right = 5
+border_width_bottom = 5
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]
-
[sub_resource type="StyleBoxEmpty" id=21]
content_margin_left = 10.0
content_margin_right = 10.0
@@ -57,6 +61,8 @@ draw_center = false
border_width_bottom = 2
border_color = Color( 0.329412, 0.329412, 0.329412, 1 )
+[sub_resource type="StyleBoxFlat" id=23]
+
[sub_resource type="StyleBoxFlat" id=12]
bg_color = Color( 0.85098, 0.85098, 0.85098, 1 )
corner_radius_top_left = 15
@@ -110,14 +116,14 @@ Button/colors/font_color_hover = Color( 0.06, 0.06, 0.06, 1 )
Button/colors/font_color_pressed = Color( 0, 0, 0, 1 )
Button/styles/disabled = SubResource( 10 )
Button/styles/focus = SubResource( 10 )
-Button/styles/hover = SubResource( 11 )
+Button/styles/hover = SubResource( 2 )
Button/styles/normal = SubResource( 2 )
-Button/styles/pressed = SubResource( 4 )
+Button/styles/pressed = SubResource( 22 )
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/colors/guide_color = Color( 1, 0, 0, 0.870588 )
ItemList/fonts/font = ExtResource( 2 )
-ItemList/styles/bg = SubResource( 5 )
+ItemList/styles/bg = SubResource( 24 )
ItemList/styles/selected = SubResource( 4 )
ItemList/styles/selected_focus = SubResource( 4 )
Label/colors/font_color = Color( 0, 0, 0, 1 )
@@ -128,6 +134,9 @@ 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
+Misc/colors/background = Color( 1, 1, 1, 1 )
+OptionSetList/styles/normal = SubResource( 23 )
+OptionSetList/styles/selected = SubResource( 23 )
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 )
@@ -140,4 +149,3 @@ 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 558a8da..60ec11a 100644
--- a/themes/night.tres
+++ b/themes/night.tres
@@ -1,4 +1,4 @@
-[gd_resource type="Theme" load_steps=17 format=2]
+[gd_resource type="Theme" load_steps=19 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]
@@ -7,35 +7,39 @@
content_margin_left = 10.0
content_margin_right = 10.0
-[sub_resource type="StyleBoxFlat" id=11]
+[sub_resource type="StyleBoxFlat" id=2]
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.501961, 0.0588235, 0.0588235, 0.498039 )
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]
+[sub_resource type="StyleBoxFlat" id=22]
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.54902, 0.0666667, 0.0666667, 0.909804 )
+border_width_left = 2
+border_width_top = 2
+border_width_right = 2
+border_width_bottom = 2
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=25]
+
[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.658824, 0, 0, 0.870588 )
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]
-
[sub_resource type="StyleBoxEmpty" id=21]
content_margin_left = 10.0
content_margin_right = 10.0
@@ -47,7 +51,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.54902, 0.0666667, 0.0666667, 0.909804 )
[sub_resource type="StyleBoxFlat" id=7]
content_margin_left = 10.0
@@ -57,6 +61,29 @@ draw_center = false
border_width_bottom = 2
border_color = Color( 0.329412, 0.329412, 0.329412, 1 )
+[sub_resource type="StyleBoxFlat" id=23]
+content_margin_left = 10.0
+content_margin_right = 10.0
+content_margin_top = 15.0
+bg_color = Color( 0, 0, 0, 0 )
+border_width_bottom = 2
+border_color = Color( 1, 1, 1, 0.301961 )
+corner_radius_bottom_right = 15
+corner_radius_bottom_left = 15
+
+[sub_resource type="StyleBoxFlat" id=24]
+content_margin_left = 10.0
+content_margin_right = 10.0
+content_margin_top = 15.0
+bg_color = Color( 0.54902, 0.0666667, 0.0666667, 0.909804 )
+border_width_left = 2
+border_width_right = 2
+border_width_bottom = 2
+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=12]
bg_color = Color( 0.14902, 0.14902, 0.14902, 1 )
corner_radius_top_left = 15
@@ -65,7 +92,7 @@ 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.501961, 0.0588235, 0.0588235, 0.498039 )
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
@@ -85,14 +112,14 @@ corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
[sub_resource type="StyleBoxFlat" id=18]
-bg_color = Color( 0.223529, 0.352941, 0.501961, 0.784314 )
+bg_color = Color( 0.501961, 0.223529, 0.223529, 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=19]
-bg_color = Color( 0.337255, 0.529412, 0.74902, 0.870588 )
+bg_color = Color( 0.54902, 0.0666667, 0.0666667, 0.909804 )
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
@@ -105,18 +132,21 @@ content_margin_left = 20.0
default_font = ExtResource( 1 )
Button/styles/disabled = SubResource( 10 )
Button/styles/focus = SubResource( 10 )
-Button/styles/hover = SubResource( 11 )
+Button/styles/hover = SubResource( 2 )
Button/styles/normal = SubResource( 2 )
-Button/styles/pressed = SubResource( 4 )
-ItemList/colors/guide_color = Color( 0.25098, 0.25098, 0.25098, 0.25098 )
+Button/styles/pressed = SubResource( 22 )
+ItemList/colors/guide_color = Color( 0, 0, 0, 0 )
ItemList/fonts/font = ExtResource( 2 )
-ItemList/styles/bg = SubResource( 5 )
+ItemList/styles/bg = SubResource( 25 )
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
+Misc/colors/background = Color( 0, 0, 0, 1 )
+OptionSetList/styles/normal = SubResource( 23 )
+OptionSetList/styles/selected = SubResource( 24 )
Panel/styles/panel = SubResource( 12 )
PopupMenu/constants/vseparation = 20
PopupMenu/styles/hover = SubResource( 20 )
@@ -127,4 +157,3 @@ 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 0e2e64e..86839a2 100644
--- a/ui/date_picker/date_picker.tscn
+++ b/ui/date_picker/date_picker.tscn
@@ -8,6 +8,24 @@ anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 2 )
+[node name="split_upper" type="ColorRect" parent="."]
+anchor_top = 0.333
+anchor_right = 1.0
+anchor_bottom = 0.343
+color = Color( 0.501961, 0.501961, 0.501961, 0.501961 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="split_lower" type="ColorRect" parent="."]
+anchor_top = 0.666
+anchor_right = 1.0
+anchor_bottom = 0.676
+color = Color( 0.501961, 0.501961, 0.501961, 0.501961 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
[node name="year" type="Control" parent="."]
anchor_right = 0.333
anchor_bottom = 1.0
@@ -23,10 +41,6 @@ anchor_right = 1.0
anchor_bottom = 0.333
mouse_filter = 1
align = 1
-valign = 1
-__meta__ = {
-"_edit_use_anchors_": false
-}
[node name="current" type="Label" parent="year"]
anchor_top = 0.333
@@ -34,7 +48,6 @@ anchor_right = 1.0
anchor_bottom = 0.666
mouse_filter = 1
align = 1
-valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
@@ -43,8 +56,11 @@ __meta__ = {
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
+margin_top = 3.0
+margin_bottom = 3.0
grow_horizontal = 2
grow_vertical = 2
+rect_clip_content = true
focus_next = NodePath("../../../month/current/input")
custom_constants/minimum_spaces = 0
align = 1
@@ -57,7 +73,6 @@ anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 1
align = 1
-valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
@@ -75,7 +90,6 @@ anchor_right = 1.0
anchor_bottom = 0.333
mouse_filter = 1
align = 1
-valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
@@ -86,7 +100,6 @@ anchor_right = 1.0
anchor_bottom = 0.666
mouse_filter = 1
align = 1
-valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
@@ -95,6 +108,8 @@ __meta__ = {
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
+margin_top = 3.0
+margin_bottom = 3.0
grow_horizontal = 2
grow_vertical = 2
focus_next = NodePath("../../../day/current/input")
@@ -110,7 +125,6 @@ anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 1
align = 1
-valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
@@ -131,7 +145,6 @@ anchor_right = 1.0
anchor_bottom = 0.333
mouse_filter = 1
align = 1
-valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
@@ -142,7 +155,6 @@ anchor_right = 1.0
anchor_bottom = 0.666
mouse_filter = 1
align = 1
-valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
@@ -151,6 +163,8 @@ __meta__ = {
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
+margin_top = 3.0
+margin_bottom = 3.0
grow_horizontal = 2
grow_vertical = 2
focus_previous = NodePath("../../../month/current/input")
@@ -165,25 +179,6 @@ anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 1
align = 1
-valign = 1
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="split_upper" type="ColorRect" parent="."]
-anchor_top = 0.333
-anchor_right = 1.0
-anchor_bottom = 0.343
-color = Color( 0.501961, 0.501961, 0.501961, 0.501961 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="split_lower" type="ColorRect" parent="."]
-anchor_top = 0.666
-anchor_right = 1.0
-anchor_bottom = 0.676
-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 857f90e..2a45f38 100644
--- a/ui/modal_popup/modal_popup.gd
+++ b/ui/modal_popup/modal_popup.gd
@@ -42,7 +42,7 @@ func open_popup(title: String, item: Control):
if visible == true:
return
- self.color = get_color("background", "theme")
+ self.color = get_color("background", "Misc")
self.color.a = 0.85
self.title.text = title
diff --git a/ui/modal_popup/modal_popup.tscn b/ui/modal_popup/modal_popup.tscn
index 3814bef..4ee5939 100644
--- a/ui/modal_popup/modal_popup.tscn
+++ b/ui/modal_popup/modal_popup.tscn
@@ -17,11 +17,10 @@ anchor_right = 0.95
anchor_bottom = 0.975
[node name="title" type="Label" parent="."]
-anchor_left = 0.124
+anchor_left = 0.15
anchor_top = 0.025
anchor_right = 0.95
anchor_bottom = 0.1
-margin_left = 0.0799866
margin_right = -80.0
margin_bottom = -20.0
align = 1
@@ -31,10 +30,9 @@ autowrap = true
[node name="dismiss" type="Button" parent="."]
anchor_left = 0.05
anchor_top = 0.025
-anchor_right = 0.124
+anchor_right = 0.15
anchor_bottom = 0.1
margin_right = 0.0799866
margin_bottom = -20.0
custom_fonts/font = ExtResource( 2 )
text = ""
-flat = true
diff --git a/ui/option_set/option_set_list.gd b/ui/option_set/option_set_list.gd
index fda2c04..9f784f9 100644
--- a/ui/option_set/option_set_list.gd
+++ b/ui/option_set/option_set_list.gd
@@ -26,9 +26,9 @@ var selected_idx := -1
var selected_item := ""
var is_dirty := true
-var normal_style : StyleBoxFlat
-var selected_style : StyleBoxFlat
-var border_size := 5
+var normal_style : StyleBox
+var selected_style : StyleBox
+var border_size := 2
onready var font : Font = get_font("font")
onready var screen_dpcm : float = float(OS.get_screen_dpi()) / 2.54
@@ -68,31 +68,6 @@ func _init():
sensor.connect("on_scroll", self, "pointer_input_on_scroll_handler")
-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
-
- var bg_color := button_style.bg_color as Color
- var corner_radius := button_style.corner_radius_top_right as int
- 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():
is_dirty = true
@@ -292,3 +267,10 @@ func _clear_signals():
disconnect(it.signal, it.target, it.method)
+func _notification(what):
+ if what == NOTIFICATION_THEME_CHANGED:
+ normal_style = get_stylebox("normal", "OptionSetList")
+ selected_style = get_stylebox("selected", "OptionSetList")
+ border_size = normal_style.get_margin(MARGIN_BOTTOM)
+
+