summaryrefslogtreecommitdiff
path: root/schist_desktop_gui/src/gui/components/account_navigation_entry.rs
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2026-02-08 15:15:24 +0000
committerJoe Carstairs <me@joeac.net>2026-02-08 15:15:24 +0000
commitd5f1554949321f2ebfda89efe39b0477a6ff2e55 (patch)
tree0fbb780f8df2c4c742c0b602febacd2a2d9684c8 /schist_desktop_gui/src/gui/components/account_navigation_entry.rs
parentd21a2500813b3fea4892fff9dbbf572e37b5d70d (diff)
task-085: transactions view has transactions
Diffstat (limited to 'schist_desktop_gui/src/gui/components/account_navigation_entry.rs')
-rw-r--r--schist_desktop_gui/src/gui/components/account_navigation_entry.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/schist_desktop_gui/src/gui/components/account_navigation_entry.rs b/schist_desktop_gui/src/gui/components/account_navigation_entry.rs
new file mode 100644
index 0000000..6a582a7
--- /dev/null
+++ b/schist_desktop_gui/src/gui/components/account_navigation_entry.rs
@@ -0,0 +1,34 @@
+use iced::Element;
+use schist_models::Account;
+
+use crate::{
+ gui::components::{navigation, Text},
+ impl_focusable,
+};
+
+#[derive(Clone, Debug, PartialEq)]
+pub struct AccountNavigationEntry {
+ pub account: Account,
+ is_focused: bool,
+}
+
+impl AccountNavigationEntry {
+ pub fn new(account: Account) -> Self {
+ Self {
+ account,
+ is_focused: false,
+ }
+ }
+}
+
+impl<'a> From<&'a AccountNavigationEntry>
+ for Element<'a, navigation::Message<AccountNavigationEntry>>
+{
+ fn from(account_navigation_entry: &'a AccountNavigationEntry) -> Self {
+ Text::default(&account_navigation_entry.account.name)
+ .highlight_maybe(account_navigation_entry.is_focused)
+ .into()
+ }
+}
+
+impl_focusable!(AccountNavigationEntry);