diff options
| author | Joe Carstairs <me@joeac.net> | 2026-02-07 11:52:08 +0000 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-02-07 12:02:27 +0000 |
| commit | 1664e741ad35ce52a01788c34029f0b2ea477e32 (patch) | |
| tree | dd6bd7c83a7e834c75815a786d67b5188cdd1f48 /schist_desktop_gui/src/gui/components/bucket_navigation_entry.rs | |
| parent | 179878d12ba10ac242da2044f4c6dfe4d4829e59 (diff) | |
task-001: can navigate file screen options with keyboard
Diffstat (limited to 'schist_desktop_gui/src/gui/components/bucket_navigation_entry.rs')
| -rw-r--r-- | schist_desktop_gui/src/gui/components/bucket_navigation_entry.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/schist_desktop_gui/src/gui/components/bucket_navigation_entry.rs b/schist_desktop_gui/src/gui/components/bucket_navigation_entry.rs index be11178..69665a3 100644 --- a/schist_desktop_gui/src/gui/components/bucket_navigation_entry.rs +++ b/schist_desktop_gui/src/gui/components/bucket_navigation_entry.rs @@ -4,7 +4,7 @@ use iced::Element; use itertools::Either; use schist_models::Bucket; -use crate::gui::components::navigation; +use crate::{gui::components::navigation, traits::Focusable}; mod bucket_group_name; mod bucket_name_and_balance; @@ -66,3 +66,19 @@ impl<'a> From<&'a BucketNavigationEntry> bucket_navigation_entry.0.as_ref().either_into() } } + +impl Focusable for BucketNavigationEntry { + fn focus(&mut self) { + match self.0.as_mut() { + Either::Left(group) => group.focus(), + Either::Right(bucket) => bucket.focus(), + }; + } + + fn unfocus(&mut self) { + match self.0.as_mut() { + Either::Left(group) => group.unfocus(), + Either::Right(bucket) => bucket.unfocus(), + }; + } +} |
