Use text size constant
This commit is contained in:
parent
21f2d593c7
commit
d722ca1e4d
@ -1135,7 +1135,7 @@ pub fn update_spend_view<'a>(
|
|||||||
Message::ImportSpend(ImportSpendMessage::PsbtEdited(msg))
|
Message::ImportSpend(ImportSpendMessage::PsbtEdited(msg))
|
||||||
})
|
})
|
||||||
.warning("Please enter the correct base64 encoded PSBT")
|
.warning("Please enter the correct base64 encoded PSBT")
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(10),
|
.padding(10),
|
||||||
)
|
)
|
||||||
.push(Row::new().push(Space::with_width(Length::Fill)).push(
|
.push(Row::new().push(Space::with_width(Length::Fill)).push(
|
||||||
|
|||||||
@ -31,7 +31,7 @@ pub fn import_psbt_view<'a>(
|
|||||||
Message::ImportSpend(ImportSpendMessage::PsbtEdited(msg))
|
Message::ImportSpend(ImportSpendMessage::PsbtEdited(msg))
|
||||||
})
|
})
|
||||||
.warning("Please enter a base64 encoded PSBT")
|
.warning("Please enter a base64 encoded PSBT")
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(10),
|
.padding(10),
|
||||||
)
|
)
|
||||||
.push(Row::new().push(Space::with_width(Length::Fill)).push(
|
.push(Row::new().push(Space::with_width(Length::Fill)).push(
|
||||||
|
|||||||
@ -72,7 +72,7 @@ pub fn recovery<'a>(
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
.warning("Invalid Bitcoin address")
|
.warning("Invalid Bitcoin address")
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(10),
|
.padding(10),
|
||||||
)
|
)
|
||||||
.max_width(500)
|
.max_width(500)
|
||||||
@ -85,7 +85,7 @@ pub fn recovery<'a>(
|
|||||||
Message::CreateSpend(CreateSpendMessage::FeerateEdited(msg))
|
Message::CreateSpend(CreateSpendMessage::FeerateEdited(msg))
|
||||||
})
|
})
|
||||||
.warning("Invalid feerate")
|
.warning("Invalid feerate")
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(10),
|
.padding(10),
|
||||||
)
|
)
|
||||||
.width(Length::Fixed(200.0)),
|
.width(Length::Fixed(200.0)),
|
||||||
|
|||||||
@ -276,7 +276,7 @@ pub fn bitcoind_edit<'a>(
|
|||||||
|value| SettingsEditMessage::FieldEdited("cookie_file_path", value),
|
|value| SettingsEditMessage::FieldEdited("cookie_file_path", value),
|
||||||
)
|
)
|
||||||
.warning("Please enter a valid filesystem path")
|
.warning("Please enter a valid filesystem path")
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(5),
|
.padding(5),
|
||||||
)
|
)
|
||||||
.spacing(5),
|
.spacing(5),
|
||||||
@ -288,7 +288,7 @@ pub fn bitcoind_edit<'a>(
|
|||||||
SettingsEditMessage::FieldEdited("user", value)
|
SettingsEditMessage::FieldEdited("user", value)
|
||||||
})
|
})
|
||||||
.warning("Please enter a valid user")
|
.warning("Please enter a valid user")
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(5),
|
.padding(5),
|
||||||
)
|
)
|
||||||
.push(
|
.push(
|
||||||
@ -296,7 +296,7 @@ pub fn bitcoind_edit<'a>(
|
|||||||
SettingsEditMessage::FieldEdited("password", value)
|
SettingsEditMessage::FieldEdited("password", value)
|
||||||
})
|
})
|
||||||
.warning("Please enter a valid password")
|
.warning("Please enter a valid password")
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(5),
|
.padding(5),
|
||||||
)
|
)
|
||||||
.spacing(10),
|
.spacing(10),
|
||||||
@ -311,7 +311,7 @@ pub fn bitcoind_edit<'a>(
|
|||||||
SettingsEditMessage::FieldEdited("socket_address", value)
|
SettingsEditMessage::FieldEdited("socket_address", value)
|
||||||
})
|
})
|
||||||
.warning("Please enter a valid address")
|
.warning("Please enter a valid address")
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(5),
|
.padding(5),
|
||||||
)
|
)
|
||||||
.spacing(5),
|
.spacing(5),
|
||||||
@ -512,7 +512,7 @@ pub fn rescan<'a>(
|
|||||||
form::Form::new_trimmed("2022", year, |value| {
|
form::Form::new_trimmed("2022", year, |value| {
|
||||||
SettingsEditMessage::FieldEdited("rescan_year", value)
|
SettingsEditMessage::FieldEdited("rescan_year", value)
|
||||||
})
|
})
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(5),
|
.padding(5),
|
||||||
)
|
)
|
||||||
.push(text("Month:").bold().small())
|
.push(text("Month:").bold().small())
|
||||||
@ -520,7 +520,7 @@ pub fn rescan<'a>(
|
|||||||
form::Form::new_trimmed("12", month, |value| {
|
form::Form::new_trimmed("12", month, |value| {
|
||||||
SettingsEditMessage::FieldEdited("rescan_month", value)
|
SettingsEditMessage::FieldEdited("rescan_month", value)
|
||||||
})
|
})
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(5),
|
.padding(5),
|
||||||
)
|
)
|
||||||
.push(text("Day:").bold().small())
|
.push(text("Day:").bold().small())
|
||||||
@ -528,7 +528,7 @@ pub fn rescan<'a>(
|
|||||||
form::Form::new_trimmed("31", day, |value| {
|
form::Form::new_trimmed("31", day, |value| {
|
||||||
SettingsEditMessage::FieldEdited("rescan_day", value)
|
SettingsEditMessage::FieldEdited("rescan_day", value)
|
||||||
})
|
})
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(5),
|
.padding(5),
|
||||||
)
|
)
|
||||||
.align_items(Alignment::Center)
|
.align_items(Alignment::Center)
|
||||||
@ -674,7 +674,7 @@ pub fn wallet_settings<'a>(
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
.warning("Please enter correct alias")
|
.warning("Please enter correct alias")
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(10),
|
.padding(10),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@ -194,7 +194,7 @@ pub fn create_spend_tx<'a>(
|
|||||||
"Feerate must be an integer less than \
|
"Feerate must be an integer less than \
|
||||||
or equal to 1000 sats/vbyte",
|
or equal to 1000 sats/vbyte",
|
||||||
)
|
)
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(10),
|
.padding(10),
|
||||||
)
|
)
|
||||||
.width(Length::FillPortion(1)),
|
.width(Length::FillPortion(1)),
|
||||||
@ -346,7 +346,7 @@ pub fn recipient_view<'a>(
|
|||||||
CreateSpendMessage::RecipientEdited(index, "address", msg)
|
CreateSpendMessage::RecipientEdited(index, "address", msg)
|
||||||
})
|
})
|
||||||
.warning("Invalid address (maybe it is for another network?)")
|
.warning("Invalid address (maybe it is for another network?)")
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(10),
|
.padding(10),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@ -365,7 +365,7 @@ pub fn recipient_view<'a>(
|
|||||||
CreateSpendMessage::RecipientEdited(index, "label", msg)
|
CreateSpendMessage::RecipientEdited(index, "label", msg)
|
||||||
})
|
})
|
||||||
.warning("Label length is too long (> 100 char)")
|
.warning("Label length is too long (> 100 char)")
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(10),
|
.padding(10),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@ -382,7 +382,9 @@ pub fn recipient_view<'a>(
|
|||||||
.push_maybe(if is_max_selected {
|
.push_maybe(if is_max_selected {
|
||||||
Some(
|
Some(
|
||||||
Container::new(
|
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)
|
.padding(10)
|
||||||
.width(Length::Fill),
|
.width(Length::Fill),
|
||||||
@ -397,7 +399,7 @@ pub fn recipient_view<'a>(
|
|||||||
.warning(
|
.warning(
|
||||||
"Invalid amount. (Note amounts lower than 0.00005 BTC are invalid.)",
|
"Invalid amount. (Note amounts lower than 0.00005 BTC are invalid.)",
|
||||||
)
|
)
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(10))
|
.padding(10))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|||||||
@ -251,7 +251,7 @@ pub fn create_rbf_modal<'a>(
|
|||||||
"Feerate must be greater than previous value and \
|
"Feerate must be greater than previous value and \
|
||||||
less than or equal to 1000 sats/vbyte",
|
less than or equal to 1000 sats/vbyte",
|
||||||
)
|
)
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
.padding(10),
|
.padding(10),
|
||||||
)
|
)
|
||||||
.width(Length::Fill),
|
.width(Length::Fill),
|
||||||
|
|||||||
@ -5,6 +5,7 @@ use iced::widget::{
|
|||||||
use iced::{alignment, widget::progress_bar, Alignment, Length};
|
use iced::{alignment, widget::progress_bar, Alignment, Length};
|
||||||
|
|
||||||
use async_hwi::DeviceKind;
|
use async_hwi::DeviceKind;
|
||||||
|
use liana_ui::component::text;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::{collections::HashSet, str::FromStr};
|
use std::{collections::HashSet, str::FromStr};
|
||||||
|
|
||||||
@ -484,7 +485,7 @@ pub fn import_descriptor<'a>(
|
|||||||
} else {
|
} else {
|
||||||
"Failed to read the descriptor"
|
"Failed to read the descriptor"
|
||||||
})
|
})
|
||||||
.size(20)
|
.size(text::P1_SIZE)
|
||||||
.padding(10),
|
.padding(10),
|
||||||
)
|
)
|
||||||
.spacing(10);
|
.spacing(10);
|
||||||
@ -906,7 +907,7 @@ pub fn define_bitcoin<'a>(
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
.warning("Please enter correct address")
|
.warning("Please enter correct address")
|
||||||
.size(20)
|
.size(text::P1_SIZE)
|
||||||
.padding(10),
|
.padding(10),
|
||||||
)
|
)
|
||||||
.spacing(10);
|
.spacing(10);
|
||||||
@ -944,7 +945,7 @@ pub fn define_bitcoin<'a>(
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
.warning("Please enter correct path")
|
.warning("Please enter correct path")
|
||||||
.size(20)
|
.size(text::P1_SIZE)
|
||||||
.padding(10),
|
.padding(10),
|
||||||
),
|
),
|
||||||
RpcAuthType::UserPass => Row::new()
|
RpcAuthType::UserPass => Row::new()
|
||||||
@ -956,7 +957,7 @@ pub fn define_bitcoin<'a>(
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
.warning("Please enter correct user")
|
.warning("Please enter correct user")
|
||||||
.size(20)
|
.size(text::P1_SIZE)
|
||||||
.padding(10),
|
.padding(10),
|
||||||
)
|
)
|
||||||
.push(
|
.push(
|
||||||
@ -967,7 +968,7 @@ pub fn define_bitcoin<'a>(
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
.warning("Please enter correct password")
|
.warning("Please enter correct password")
|
||||||
.size(20)
|
.size(text::P1_SIZE)
|
||||||
.padding(10),
|
.padding(10),
|
||||||
)
|
)
|
||||||
.spacing(10),
|
.spacing(10),
|
||||||
@ -1518,7 +1519,7 @@ pub fn edit_key_modal<'a>(
|
|||||||
} else {
|
} else {
|
||||||
"Please enter correct tpub with origin and without appended derivation path"
|
"Please enter correct tpub with origin and without appended derivation path"
|
||||||
})
|
})
|
||||||
.size(20)
|
.size(text::P1_SIZE)
|
||||||
.padding(10),
|
.padding(10),
|
||||||
)
|
)
|
||||||
.spacing(10)
|
.spacing(10)
|
||||||
@ -1568,7 +1569,7 @@ pub fn edit_key_modal<'a>(
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
.warning("Please enter correct alias")
|
.warning("Please enter correct alias")
|
||||||
.size(20)
|
.size(text::P1_SIZE)
|
||||||
.padding(10),
|
.padding(10),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -130,6 +130,6 @@ impl Text for iced::widget::Text<'_, iced::Renderer<Theme>> {
|
|||||||
self.font(font::BOLD)
|
self.font(font::BOLD)
|
||||||
}
|
}
|
||||||
fn small(self) -> Self {
|
fn small(self) -> Self {
|
||||||
self.size(20)
|
self.size(P1_SIZE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
use crate::widget::*;
|
use crate::{component::text::P1_SIZE, widget::*};
|
||||||
use iced::{alignment, Font, Length};
|
use iced::{alignment, Font, Length};
|
||||||
|
|
||||||
const BOOTSTRAP_ICONS: Font = Font::External {
|
const BOOTSTRAP_ICONS: Font = Font::External {
|
||||||
@ -11,7 +11,7 @@ fn bootstrap_icon(unicode: char) -> Text<'static> {
|
|||||||
.font(BOOTSTRAP_ICONS)
|
.font(BOOTSTRAP_ICONS)
|
||||||
.width(Length::Fixed(20.0))
|
.width(Length::Fixed(20.0))
|
||||||
.horizontal_alignment(alignment::Horizontal::Center)
|
.horizontal_alignment(alignment::Horizontal::Center)
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn cross_icon() -> Text<'static> {
|
pub fn cross_icon() -> Text<'static> {
|
||||||
@ -128,7 +128,7 @@ fn iconex_icon(unicode: char) -> Text<'static> {
|
|||||||
.font(ICONEX_ICONS)
|
.font(ICONEX_ICONS)
|
||||||
.width(Length::Fixed(20.0))
|
.width(Length::Fixed(20.0))
|
||||||
.horizontal_alignment(alignment::Horizontal::Center)
|
.horizontal_alignment(alignment::Horizontal::Center)
|
||||||
.size(20)
|
.size(P1_SIZE)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn arrow_repeat() -> Text<'static> {
|
pub fn arrow_repeat() -> Text<'static> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user