aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordam <dam@gudinoff>2022-02-09 00:34:02 +0000
committerdam <dam@gudinoff>2022-02-09 00:34:02 +0000
commitbfa4fe480ecb9ba4f4ce69788362ba61ce2144c1 (patch)
tree556715462845aba72b9be5687c9f4f51ae7c7feb
parentcc3f6e5ea29bfe006576a35b5fa24d029a07cf7c (diff)
downloadsurgery-log-bfa4fe480ecb9ba4f4ce69788362ba61ce2144c1.tar.zst
surgery-log-bfa4fe480ecb9ba4f4ce69788362ba61ce2144c1.zip
Fade out action buttons when no actions is possible.
-rw-r--r--logic/database.gd7
-rw-r--r--main.tscn10
-rw-r--r--readme.md6
3 files changed, 16 insertions, 7 deletions
diff --git a/logic/database.gd b/logic/database.gd
index 1518490..7b05932 100644
--- a/logic/database.gd
+++ b/logic/database.gd
@@ -55,11 +55,18 @@ func get_entry_view(database_entry: Dictionary) -> String:
func item_selected(index: int):
selected_idx = index
+ fade_action_buttons(1.0)
func clear_selection():
selected_idx = -1
unselect_all()
+ fade_action_buttons(0.25)
+
+
+func fade_action_buttons(target_alpha: float):
+ get_node("actions/delete").modulate.a = target_alpha
+ get_node("actions/edit").modulate.a = target_alpha
func delete_action():
diff --git a/main.tscn b/main.tscn
index ead511e..1169994 100644
--- a/main.tscn
+++ b/main.tscn
@@ -30,14 +30,14 @@ anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
-margin_left = -140.0
-margin_top = -410.0
+margin_left = -160.0
+margin_top = -430.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="delete" type="Button" parent="database/actions"]
-margin_right = 140.0
+margin_right = 160.0
margin_bottom = 134.0
focus_mode = 0
enabled_focus_mode = 0
@@ -49,7 +49,7 @@ __meta__ = {
[node name="edit" type="Button" parent="database/actions"]
margin_top = 138.0
-margin_right = 140.0
+margin_right = 160.0
margin_bottom = 272.0
focus_mode = 0
enabled_focus_mode = 0
@@ -61,7 +61,7 @@ __meta__ = {
[node name="add" type="Button" parent="database/actions"]
margin_top = 276.0
-margin_right = 140.0
+margin_right = 160.0
margin_bottom = 410.0
focus_mode = 0
enabled_focus_mode = 0
diff --git a/readme.md b/readme.md
index 7aed207..549bbf4 100644
--- a/readme.md
+++ b/readme.md
@@ -26,7 +26,7 @@ Surgery Log
- selecting option puts that text on the associated LineEdit;
- [x] add pop-up asking if changes are to be discarded once the stage screen's discard button is pressed;
- [x] add pop-up confirming delete-entry action;
-- [ ] edit and delete action buttons should be faded-out when no entry is selected;
+- [x] edit and delete action buttons should be faded-out when no entry is selected;
- [ ] Implement file access permission check on Android:
```py
if OS.get_name() == "Android":
@@ -48,7 +48,9 @@ Surgery Log
- on about screen should close it;
- on auto-fill pop-up, should close it;
- on database screen, should deselect selected item, otherwise should quit the app;
-- [ ] Create two themes:
+- [ ] Add title to current window (on top, left of the menu);
+- [ ] Improve menu appearance;
+- [ ] Setup two themes:
- [ ] theme_light
- [ ] theme_dark
- [ ] main/screen_controller is responsible for whos currently on focus, fade animations, input access (enable/disable), and back_key_notification handling.