Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use text size constant #1071

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gui/src/app/view/psbt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ pub fn update_spend_view<'a>(
Message::ImportSpend(ImportSpendMessage::PsbtEdited(msg))
})
.warning("Please enter the correct base64 encoded PSBT")
.size(20)
.size(P1_SIZE)
.padding(10),
)
.push(Row::new().push(Space::with_width(Length::Fill)).push(
Expand Down
2 changes: 1 addition & 1 deletion gui/src/app/view/psbts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn import_psbt_view<'a>(
Message::ImportSpend(ImportSpendMessage::PsbtEdited(msg))
})
.warning("Please enter a base64 encoded PSBT")
.size(20)
.size(P1_SIZE)
.padding(10),
)
.push(Row::new().push(Space::with_width(Length::Fill)).push(
Expand Down
4 changes: 2 additions & 2 deletions gui/src/app/view/recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub fn recovery<'a>(
))
})
.warning("Invalid Bitcoin address")
.size(20)
.size(P1_SIZE)
.padding(10),
)
.max_width(500)
Expand All @@ -85,7 +85,7 @@ pub fn recovery<'a>(
Message::CreateSpend(CreateSpendMessage::FeerateEdited(msg))
})
.warning("Invalid feerate")
.size(20)
.size(P1_SIZE)
.padding(10),
)
.width(Length::Fixed(200.0)),
Expand Down
16 changes: 8 additions & 8 deletions gui/src/app/view/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ pub fn bitcoind_edit<'a>(
|value| SettingsEditMessage::FieldEdited("cookie_file_path", value),
)
.warning("Please enter a valid filesystem path")
.size(20)
.size(P1_SIZE)
.padding(5),
)
.spacing(5),
Expand All @@ -288,15 +288,15 @@ pub fn bitcoind_edit<'a>(
SettingsEditMessage::FieldEdited("user", value)
})
.warning("Please enter a valid user")
.size(20)
.size(P1_SIZE)
.padding(5),
)
.push(
form::Form::new_trimmed("Password", &rpc_auth_vals.password, |value| {
SettingsEditMessage::FieldEdited("password", value)
})
.warning("Please enter a valid password")
.size(20)
.size(P1_SIZE)
.padding(5),
)
.spacing(10),
Expand All @@ -311,7 +311,7 @@ pub fn bitcoind_edit<'a>(
SettingsEditMessage::FieldEdited("socket_address", value)
})
.warning("Please enter a valid address")
.size(20)
.size(P1_SIZE)
.padding(5),
)
.spacing(5),
Expand Down Expand Up @@ -512,23 +512,23 @@ pub fn rescan<'a>(
form::Form::new_trimmed("2022", year, |value| {
SettingsEditMessage::FieldEdited("rescan_year", value)
})
.size(20)
.size(P1_SIZE)
.padding(5),
)
.push(text("Month:").bold().small())
.push(
form::Form::new_trimmed("12", month, |value| {
SettingsEditMessage::FieldEdited("rescan_month", value)
})
.size(20)
.size(P1_SIZE)
.padding(5),
)
.push(text("Day:").bold().small())
.push(
form::Form::new_trimmed("31", day, |value| {
SettingsEditMessage::FieldEdited("rescan_day", value)
})
.size(20)
.size(P1_SIZE)
.padding(5),
)
.align_items(Alignment::Center)
Expand Down Expand Up @@ -674,7 +674,7 @@ pub fn wallet_settings<'a>(
)
})
.warning("Please enter correct alias")
.size(20)
.size(P1_SIZE)
.padding(10),
),
)
Expand Down
12 changes: 7 additions & 5 deletions gui/src/app/view/spend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ pub fn create_spend_tx<'a>(
"Feerate must be an integer less than \
or equal to 1000 sats/vbyte",
)
.size(20)
.size(P1_SIZE)
.padding(10),
)
.width(Length::FillPortion(1)),
Expand Down Expand Up @@ -346,7 +346,7 @@ pub fn recipient_view<'a>(
CreateSpendMessage::RecipientEdited(index, "address", msg)
})
.warning("Invalid address (maybe it is for another network?)")
.size(20)
.size(P1_SIZE)
.padding(10),
),
)
Expand All @@ -365,7 +365,7 @@ pub fn recipient_view<'a>(
CreateSpendMessage::RecipientEdited(index, "label", msg)
})
.warning("Label length is too long (> 100 char)")
.size(20)
.size(P1_SIZE)
.padding(10),
),
)
Expand All @@ -382,7 +382,9 @@ pub fn recipient_view<'a>(
.push_maybe(if is_max_selected {
Some(
Container::new(
text(amount.value.clone()).size(20).style(color::GREY_2),
text(amount.value.clone())
.size(P1_SIZE)
.style(color::GREY_2),
)
.padding(10)
.width(Length::Fill),
Expand All @@ -397,7 +399,7 @@ pub fn recipient_view<'a>(
.warning(
"Invalid amount. (Note amounts lower than 0.00005 BTC are invalid.)",
)
.size(20)
.size(P1_SIZE)
.padding(10))
} else {
None
Expand Down
2 changes: 1 addition & 1 deletion gui/src/app/view/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ pub fn create_rbf_modal<'a>(
"Feerate must be greater than previous value and \
less than or equal to 1000 sats/vbyte",
)
.size(20)
.size(P1_SIZE)
.padding(10),
)
.width(Length::Fill),
Expand Down
15 changes: 8 additions & 7 deletions gui/src/installer/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use iced::widget::{
use iced::{alignment, widget::progress_bar, Alignment, Length};

use async_hwi::DeviceKind;
use liana_ui::component::text;
use std::path::PathBuf;
use std::{collections::HashSet, str::FromStr};

Expand Down Expand Up @@ -484,7 +485,7 @@ pub fn import_descriptor<'a>(
} else {
"Failed to read the descriptor"
})
.size(20)
.size(text::P1_SIZE)
.padding(10),
)
.spacing(10);
Expand Down Expand Up @@ -906,7 +907,7 @@ pub fn define_bitcoin<'a>(
))
})
.warning("Please enter correct address")
.size(20)
.size(text::P1_SIZE)
.padding(10),
)
.spacing(10);
Expand Down Expand Up @@ -944,7 +945,7 @@ pub fn define_bitcoin<'a>(
))
})
.warning("Please enter correct path")
.size(20)
.size(text::P1_SIZE)
.padding(10),
),
RpcAuthType::UserPass => Row::new()
Expand All @@ -956,7 +957,7 @@ pub fn define_bitcoin<'a>(
))
})
.warning("Please enter correct user")
.size(20)
.size(text::P1_SIZE)
.padding(10),
)
.push(
Expand All @@ -967,7 +968,7 @@ pub fn define_bitcoin<'a>(
))
})
.warning("Please enter correct password")
.size(20)
.size(text::P1_SIZE)
.padding(10),
)
.spacing(10),
Expand Down Expand Up @@ -1518,7 +1519,7 @@ pub fn edit_key_modal<'a>(
} else {
"Please enter correct tpub with origin and without appended derivation path"
})
.size(20)
.size(text::P1_SIZE)
.padding(10),
)
.spacing(10)
Expand Down Expand Up @@ -1568,7 +1569,7 @@ pub fn edit_key_modal<'a>(
))
})
.warning("Please enter correct alias")
.size(20)
.size(text::P1_SIZE)
.padding(10),
)
} else {
Expand Down
2 changes: 1 addition & 1 deletion gui/ui/src/component/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@ impl Text for iced::widget::Text<'_, iced::Renderer<Theme>> {
self.font(font::BOLD)
}
fn small(self) -> Self {
self.size(20)
self.size(P1_SIZE)
}
}
6 changes: 3 additions & 3 deletions gui/ui/src/icon.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::widget::*;
use crate::{component::text::P1_SIZE, widget::*};
use iced::{alignment, Font, Length};

const BOOTSTRAP_ICONS: Font = Font::External {
Expand All @@ -11,7 +11,7 @@ fn bootstrap_icon(unicode: char) -> Text<'static> {
.font(BOOTSTRAP_ICONS)
.width(Length::Fixed(20.0))
.horizontal_alignment(alignment::Horizontal::Center)
.size(20)
.size(P1_SIZE)
}

pub fn cross_icon() -> Text<'static> {
Expand Down Expand Up @@ -128,7 +128,7 @@ fn iconex_icon(unicode: char) -> Text<'static> {
.font(ICONEX_ICONS)
.width(Length::Fixed(20.0))
.horizontal_alignment(alignment::Horizontal::Center)
.size(20)
.size(P1_SIZE)
}

pub fn arrow_repeat() -> Text<'static> {
Expand Down
Loading