-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b58ca92
commit 992af64
Showing
14 changed files
with
112 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
use iced::widget::text; | ||
use iced::widget::text::Style; | ||
use iced::{Element, Theme}; | ||
use iced::Element; | ||
|
||
use crate::Message; | ||
|
||
use super::lighten; | ||
use super::subtitle; | ||
|
||
pub fn h_caption_text(string: &'static str) -> Element<'static, Message> { | ||
text(string) | ||
.size(18) | ||
.style(|theme: &Theme| { | ||
let gray = lighten(theme.palette().background, 0.5); | ||
Style { color: Some(gray) } | ||
}) | ||
.into() | ||
text(string).size(18).style(subtitle).into() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,30 @@ | ||
use fedimint_core::config::FederationId; | ||
use iced::{ | ||
widget::{row, text}, | ||
Element, | ||
widget::{column, row, text}, | ||
Alignment, Element, | ||
}; | ||
|
||
use crate::Message; | ||
|
||
use super::{format_amount, map_icon, subtitle, SvgIcon}; | ||
|
||
#[derive(Debug, Clone)] | ||
pub struct FederationItem { | ||
pub id: FederationId, | ||
pub name: String, | ||
pub balance: u64, | ||
} | ||
|
||
pub fn h_federation_item(item: &FederationItem) -> Element<Message> { | ||
let FederationItem { id, name } = item; | ||
let row = row![text(name).size(24), text(format!("{id:?}")).size(24),].spacing(16); | ||
let FederationItem { id, name, balance } = item; | ||
let title = row![map_icon(SvgIcon::People, 24., 24.), text(name).size(24)] | ||
.align_items(Alignment::Center) | ||
.spacing(16); | ||
let balance = text(format_amount(*balance)).size(24); | ||
|
||
let id = text(format!("{id}")).size(18).style(subtitle); | ||
|
||
let column = column![title, balance, id].spacing(16); | ||
|
||
row.into() | ||
column.into() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,3 +48,6 @@ pub use toast::*; | |
|
||
mod colors; | ||
pub use colors::*; | ||
|
||
mod styles; | ||
pub use styles::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
use iced::{widget::text::Style, Theme}; | ||
|
||
use super::lighten; | ||
|
||
pub fn subtitle(theme: &Theme) -> Style { | ||
let gray = lighten(theme.palette().background, 0.5); | ||
Style { color: Some(gray) } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters