diff options
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(), + }; + } +} |
