diff options
| author | dam <dam@gudinoff> | 2022-02-09 00:34:02 +0000 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2022-02-09 00:34:02 +0000 |
| commit | bfa4fe480ecb9ba4f4ce69788362ba61ce2144c1 (patch) | |
| tree | 556715462845aba72b9be5687c9f4f51ae7c7feb | |
| parent | cc3f6e5ea29bfe006576a35b5fa24d029a07cf7c (diff) | |
| download | surgery-log-bfa4fe480ecb9ba4f4ce69788362ba61ce2144c1.tar.zst surgery-log-bfa4fe480ecb9ba4f4ce69788362ba61ce2144c1.zip | |
Fade out action buttons when no actions is possible.
| -rw-r--r-- | logic/database.gd | 7 | ||||
| -rw-r--r-- | main.tscn | 10 | ||||
| -rw-r--r-- | readme.md | 6 |
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(): @@ -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 @@ -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. |
