gui: new dark theme

This commit is contained in:
edouard 2023-04-13 15:38:46 +02:00
parent 2e75d4b602
commit 3eb81980ef
20 changed files with 322 additions and 654 deletions

View File

@ -76,11 +76,11 @@ fn coin_list_view(
Some(Container::new(
Row::new()
.spacing(5)
.push(text(" 0").small().style(color::legacy::ALERT))
.push(text(" 0").small().style(color::RED))
.push(
icon::hourglass_done_icon()
.small()
.style(color::legacy::ALERT),
.style(color::RED),
)
.align_items(Alignment::Center),
))
@ -91,12 +91,12 @@ fn coin_list_view(
.push(
text(format!(" {}", seq))
.small()
.style(color::legacy::WARNING),
.style(color::ORANGE),
)
.push(
icon::hourglass_icon()
.small()
.style(color::legacy::WARNING),
.style(color::ORANGE),
)
.align_items(Alignment::Center),
))
@ -143,7 +143,7 @@ fn coin_list_view(
text("One of the recovery path is available")
.bold()
.small()
.style(color::legacy::ALERT),
.style(color::RED),
))
} else {
Some(Container::new(

View File

@ -35,11 +35,7 @@ pub fn home_view<'a>(
Row::new()
.spacing(15)
.align_items(Alignment::Center)
.push(
icon::hourglass_icon()
.size(30)
.style(color::legacy::WARNING),
)
.push(icon::hourglass_icon().size(30).style(color::ORANGE))
.push(
Row::new()
.spacing(5)
@ -57,7 +53,7 @@ pub fn home_view<'a>(
Row::new()
.spacing(15)
.align_items(Alignment::Center)
.push(icon::hourglass_done_icon().style(color::legacy::ALERT))
.push(icon::hourglass_done_icon().style(color::RED))
.push(
Row::new()
.spacing(5)

View File

@ -44,7 +44,7 @@ pub fn hw_list_view(
hw::unsupported_hardware_wallet(&kind.to_string(), version.as_ref())
}
})
.style(theme::Button::Secondary)
.style(theme::Button::Border)
.width(Length::Fill);
if !processing {
if let HardwareWallet::Supported { registered, .. } = hw {
@ -91,7 +91,7 @@ pub fn hw_list_view_for_registration(
hw::unsupported_hardware_wallet(&kind.to_string(), version.as_ref())
}
})
.style(theme::Button::Secondary)
.style(theme::Button::Border)
.width(Length::Fill);
if !processing && hw.is_supported() {
bttn = bttn.on_press(Message::SelectHardwareWallet(i));

View File

@ -27,11 +27,11 @@ use crate::app::{cache::Cache, error::Error, menu::Menu};
pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> Container<'a, Message> {
let home_button = if *menu == Menu::Home {
button::primary(Some(home_icon()), "Home")
button::menu_active(Some(home_icon()), "Home")
.on_press(Message::Reload)
.width(iced::Length::Units(200))
} else {
button::transparent(Some(home_icon()), "Home")
button::menu(Some(home_icon()), "Home")
.on_press(Message::Menu(Menu::Home))
.width(iced::Length::Units(200))
};
@ -62,17 +62,17 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> Container<'a, Message> {
.small()
.bold(),
)
.style(theme::Container::Pill(theme::Pill::InversePrimary)),
.style(theme::Container::Pill(theme::Pill::Primary)),
)
.spacing(10)
.width(iced::Length::Fill)
.align_items(iced::Alignment::Center),
)
.width(iced::Length::Fill)
.padding(5)
.padding(10)
.center_x(),
)
.style(theme::Button::Primary)
.style(theme::Button::Menu(true))
.on_press(Message::Reload)
.width(iced::Length::Units(200))
} else {
@ -108,10 +108,10 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> Container<'a, Message> {
.align_items(iced::Alignment::Center),
)
.width(iced::Length::Fill)
.padding(5)
.padding(10)
.center_x(),
)
.style(theme::Button::Transparent)
.style(theme::Button::Menu(false))
.on_press(Message::Menu(Menu::Coins))
.width(iced::Length::Units(200))
};
@ -137,7 +137,7 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> Container<'a, Message> {
.small()
.bold(),
)
.style(theme::Pill::InversePrimary),
.style(theme::Pill::Primary),
)
})
.spacing(10)
@ -145,10 +145,10 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> Container<'a, Message> {
.align_items(iced::Alignment::Center),
)
.width(iced::Length::Fill)
.padding(5)
.padding(10)
.center_x(),
)
.style(theme::Button::Primary)
.style(theme::Button::Menu(true))
.on_press(Message::Reload)
.width(iced::Length::Units(200))
} else {
@ -180,30 +180,30 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> Container<'a, Message> {
.align_items(iced::Alignment::Center),
)
.width(iced::Length::Fill)
.padding(5)
.padding(10)
.center_x(),
)
.style(theme::Button::Transparent)
.style(theme::Button::Menu(false))
.on_press(Message::Menu(Menu::Spend))
.width(iced::Length::Units(200))
};
let receive_button = if *menu == Menu::Receive {
button::primary(Some(receive_icon()), "Receive")
button::menu_active(Some(receive_icon()), "Receive")
.on_press(Message::Reload)
.width(iced::Length::Units(200))
} else {
button::transparent(Some(receive_icon()), "Receive")
button::menu(Some(receive_icon()), "Receive")
.on_press(Message::Menu(Menu::Receive))
.width(iced::Length::Units(200))
};
let settings_button = if *menu == Menu::Settings {
button::primary(Some(settings_icon()), "Settings")
button::menu_active(Some(settings_icon()), "Settings")
.on_press(Message::Menu(Menu::Settings))
.width(iced::Length::Units(200))
} else {
button::transparent(Some(settings_icon()), "Settings")
button::menu(Some(settings_icon()), "Settings")
.on_press(Message::Menu(Menu::Settings))
.width(iced::Length::Units(200))
};

View File

@ -53,7 +53,7 @@ pub fn list(cache: &Cache) -> Element<Message> {
.width(Length::Fill),
)
.width(Length::Fill)
.style(theme::Button::Secondary)
.style(theme::Button::TransparentBorder)
.on_press(Message::Settings(SettingsMessage::EditBitcoindSettings))
)
.width(Length::Fill)
@ -71,7 +71,7 @@ pub fn list(cache: &Cache) -> Element<Message> {
.width(Length::Fill),
)
.width(Length::Fill)
.style(theme::Button::Secondary)
.style(theme::Button::TransparentBorder)
.on_press(Message::Settings(SettingsMessage::EditWalletSettings))
)
.width(Length::Fill)
@ -90,7 +90,7 @@ pub fn list(cache: &Cache) -> Element<Message> {
.width(Length::Fill),
)
.width(Length::Fill)
.style(theme::Button::Secondary)
.style(theme::Button::TransparentBorder)
.on_press(Message::Menu(Menu::Recovery))
)
.width(Length::Fill)
@ -108,7 +108,7 @@ pub fn list(cache: &Cache) -> Element<Message> {
.width(Length::Fill),
)
.width(Length::Fill)
.style(theme::Button::Secondary)
.style(theme::Button::TransparentBorder)
.on_press(Message::Settings(SettingsMessage::AboutSection))
)
.width(Length::Fill)
@ -397,15 +397,15 @@ pub fn is_running_label<'a, T: 'a>(is_running: Option<bool>) -> Container<'a, T>
if running {
Container::new(
Row::new()
.push(icon::dot_icon().size(5).style(color::legacy::SUCCESS))
.push(text("Running").small().style(color::legacy::SUCCESS))
.push(icon::dot_icon().size(5).style(color::GREEN))
.push(text("Running").small().style(color::GREEN))
.align_items(Alignment::Center),
)
} else {
Container::new(
Row::new()
.push(icon::dot_icon().size(5).style(color::legacy::ALERT))
.push(text("Not running").small().style(color::legacy::ALERT))
.push(icon::dot_icon().size(5).style(color::RED))
.push(text("Not running").small().style(color::RED))
.align_items(Alignment::Center),
)
}
@ -430,7 +430,7 @@ pub fn rescan<'a>(
.push(badge::Badge::new(icon::block_icon()))
.push(text("Rescan blockchain").bold().width(Length::Fill))
.push_maybe(if success {
Some(text("Rescan was successful").style(color::legacy::SUCCESS))
Some(text("Rescan was successful").style(color::GREEN))
} else {
None
})
@ -563,7 +563,7 @@ pub fn wallet_settings<'a>(
.spacing(10)
.push(Column::new().width(Length::Fill))
.push(
button::border(Some(icon::clipboard_icon()), "Copy")
button::secondary(Some(icon::clipboard_icon()), "Copy")
.on_press(Message::Clipboard(descriptor.to_owned())),
)
.push(
@ -609,10 +609,8 @@ pub fn wallet_settings<'a>(
Some(
Row::new()
.align_items(Alignment::Center)
.push(
icon::circle_check_icon().style(color::legacy::SUCCESS),
)
.push(text("Updated").style(color::legacy::SUCCESS)),
.push(icon::circle_check_icon().style(color::GREEN))
.push(text("Updated").style(color::GREEN)),
)
} else {
None
@ -645,7 +643,7 @@ pub fn register_wallet_modal<'a>(
.push(
Row::new()
.push(text("Select device:").bold().width(Length::Fill))
.push(button::border(None, "Refresh").on_press(Message::Reload))
.push(button::secondary(None, "Refresh").on_press(Message::Reload))
.align_items(Alignment::Center),
)
.spacing(10)

View File

@ -249,11 +249,11 @@ fn spend_overview_view<'a>(
Row::new()
.spacing(5)
.push(
button::border(Some(icon::clipboard_icon()), "Copy")
button::secondary(Some(icon::clipboard_icon()), "Copy")
.on_press(Message::Clipboard(tx.psbt.to_string())),
)
.push(
button::border(Some(icon::import_icon()), "Update")
button::secondary(Some(icon::import_icon()), "Update")
.on_press(Message::Spend(SpendTxMessage::EditPsbt)),
),
)
@ -292,8 +292,8 @@ pub fn signatures<'a>(
Row::new()
.spacing(5)
.align_items(Alignment::Center)
.push(icon::circle_check_icon().style(color::legacy::SUCCESS))
.push(text("Ready").bold().style(color::legacy::SUCCESS))
.push(icon::circle_check_icon().style(color::GREEN))
.push(text("Ready").bold().style(color::GREEN))
.push(text(", signed by"))
.push(
sigs.signed_pubkeys
@ -429,7 +429,7 @@ pub fn path_view<'a>(
Row::new()
.align_items(Alignment::Center)
.push(if sigs.sigs_count >= sigs.threshold {
icon::circle_check_icon().style(color::legacy::SUCCESS)
icon::circle_check_icon().style(color::GREEN)
} else {
icon::circle_cross_icon()
})
@ -728,7 +728,7 @@ pub fn sign_action<'a>(
.bold()
.width(Length::Fill),
)
.push(button::border(None, "Refresh").on_press(Message::Reload))
.push(button::secondary(None, "Refresh").on_press(Message::Reload))
.align_items(Alignment::Center),
)
.spacing(10)
@ -754,7 +754,7 @@ pub fn sign_action<'a>(
})
.on_press(Message::Spend(SpendTxMessage::SelectHotSigner))
.padding(10)
.style(theme::Button::Secondary)
.style(theme::Button::Border)
.width(Length::Fill)
}))
.width(Length::Fill),
@ -820,7 +820,7 @@ pub fn update_spend_success_view<'a>() -> Element<'a, Message> {
Column::new()
.push(
card::simple(Container::new(
text("Spend transaction is updated").style(color::legacy::SUCCESS),
text("Spend transaction is updated").style(color::GREEN),
))
.padding(50),
)

View File

@ -55,10 +55,7 @@ pub fn import_spend_view<'a>(
pub fn import_spend_success_view<'a>() -> Element<'a, Message> {
Column::new()
.push(
card::simple(Container::new(
text("PSBT is imported").style(color::legacy::SUCCESS),
))
.padding(50),
card::simple(Container::new(text("PSBT is imported").style(color::GREEN))).padding(50),
)
.width(Length::Units(400))
.align_items(Alignment::Center)
@ -72,7 +69,7 @@ pub fn spend_view<'a>(spend_txs: &[SpendTx]) -> Element<'a, Message> {
.spacing(10)
.push(Column::new().width(Length::Fill))
.push(
button::border(Some(icon::import_icon()), "Import")
button::secondary(Some(icon::import_icon()), "Import")
.on_press(Message::ImportSpend(ImportSpendMessage::Import)),
)
.push(

View File

@ -63,10 +63,7 @@ pub fn choose_recipients_view<'a>(
.width(Length::Fill),
)
.push_maybe(if duplicate {
Some(
text("Two recipient addresses are the same")
.style(color::legacy::WARNING),
)
Some(text("Two recipient addresses are the same").style(color::ORANGE))
} else {
None
})
@ -217,12 +214,8 @@ fn coin_list_view<'a>(
Some(Container::new(
Row::new()
.spacing(5)
.push(text(" 0").small().style(color::legacy::ALERT))
.push(
icon::hourglass_done_icon()
.small()
.style(color::legacy::ALERT),
)
.push(text(" 0").small().style(color::RED))
.push(icon::hourglass_done_icon().small().style(color::RED))
.align_items(Alignment::Center),
))
} else if seq < timelock as u32 * 10 / 100 {
@ -230,15 +223,9 @@ fn coin_list_view<'a>(
Row::new()
.spacing(5)
.push(
text(format!(" {}", seq))
.small()
.style(color::legacy::WARNING),
)
.push(
icon::hourglass_icon()
.small()
.style(color::legacy::WARNING),
text(format!(" {}", seq)).small().style(color::ORANGE),
)
.push(icon::hourglass_icon().small().style(color::ORANGE))
.align_items(Alignment::Center),
))
} else {

View File

@ -47,7 +47,7 @@ fn split_digits<'a, T: 'a>(mut s: String, size: u16) -> impl Into<Element<'a, T>
if s.starts_with(prefix) {
let right = s.split_off(prefix.len());
return Row::new()
.push(text(s).size(size).style(color::DARK_GREY))
.push(text(s).size(size).style(color::GREY_2))
.push_maybe(if right.is_empty() {
None
} else {

View File

@ -166,10 +166,7 @@ pub fn define_descriptor<'a>(
.push_maybe(if network_valid {
None
} else {
Some(
text("A data directory already exists for this network")
.style(color::legacy::ALERT),
)
Some(text("A data directory already exists for this network").style(color::RED))
})
.padding(50);
@ -257,7 +254,7 @@ pub fn define_descriptor<'a>(
.push(
Row::new()
.spacing(10)
.push(button::border(None, "Add a recovery path").on_press(
.push(button::secondary(None, "Add a recovery path").on_press(
Message::DefineDescriptor(message::DefineDescriptor::AddRecoveryPath),
))
.push(if !valid {
@ -354,10 +351,7 @@ pub fn import_descriptor<'a>(
.push_maybe(if network_valid {
None
} else {
Some(
text("A data directory already exists for this network")
.style(color::legacy::ALERT),
)
Some(text("A data directory already exists for this network").style(color::RED))
});
let col_descriptor = Column::new()
.push(text("Descriptor:").bold())
@ -445,7 +439,7 @@ pub fn signer_xpubs(xpubs: &Vec<String>) -> Element<Message> {
)
.push(
Container::new(
button::border(Some(icon::clipboard_icon()), "Copy")
button::secondary(Some(icon::clipboard_icon()), "Copy")
.on_press(Message::Clibpboard(xpub.clone()))
.width(Length::Shrink),
)
@ -457,7 +451,7 @@ pub fn signer_xpubs(xpubs: &Vec<String>) -> Element<Message> {
.push_maybe(if !xpubs.is_empty() {
Some(
Container::new(
button::border(Some(icon::plus_icon()), "New public key")
button::secondary(Some(icon::plus_icon()), "New public key")
.on_press(Message::UseHotSigner),
)
.padding(10),
@ -528,7 +522,7 @@ pub fn hardware_wallet_xpubs<'a>(
)
.push(
Container::new(
button::border(Some(icon::clipboard_icon()), "Copy")
button::secondary(Some(icon::clipboard_icon()), "Copy")
.on_press(Message::Clibpboard(xpub.clone()))
.width(Length::Shrink),
)
@ -540,10 +534,10 @@ pub fn hardware_wallet_xpubs<'a>(
.push_maybe(if !xpubs.is_empty() {
Some(
Container::new(if !processing {
button::border(Some(icon::plus_icon()), "New public key")
button::secondary(Some(icon::plus_icon()), "New public key")
.on_press(Message::Select(i))
} else {
button::border(Some(icon::plus_icon()), "New public key")
button::secondary(Some(icon::plus_icon()), "New public key")
})
.padding(10),
)
@ -581,10 +575,7 @@ pub fn participate_xpub<'a>(
.push_maybe(if network_valid {
None
} else {
Some(
text("A data directory already exists for this network")
.style(color::legacy::ALERT),
)
Some(text("A data directory already exists for this network").style(color::RED))
});
layout(
@ -608,7 +599,7 @@ pub fn participate_xpub<'a>(
.width(Length::Fill),
)
.push(
button::border(Some(icon::reload_icon()), "Refresh")
button::secondary(Some(icon::reload_icon()), "Refresh")
.on_press(Message::Reload),
),
)
@ -659,7 +650,7 @@ pub fn register_descriptor<'a>(
.push(text(descriptor.clone()).small())
.push(
Row::new().push(Column::new().width(Length::Fill)).push(
button::transparent_border(Some(icon::clipboard_icon()), "Copy")
button::secondary(Some(icon::clipboard_icon()), "Copy")
.on_press(Message::Clibpboard(descriptor)),
),
)
@ -681,7 +672,7 @@ pub fn register_descriptor<'a>(
.width(Length::Fill),
)
.push(
button::border(Some(icon::reload_icon()), "Refresh")
button::secondary(Some(icon::reload_icon()), "Refresh")
.on_press(Message::Reload),
),
)
@ -770,7 +761,7 @@ pub fn backup_descriptor<'a>(
.push(text(descriptor.clone()).small())
.push(
Row::new().push(Column::new().width(Length::Fill)).push(
button::transparent_border(Some(icon::clipboard_icon()), "Copy")
button::secondary(Some(icon::clipboard_icon()), "Copy")
.on_press(Message::Clibpboard(descriptor)),
),
)
@ -848,16 +839,16 @@ pub fn define_bitcoin<'a>(
Row::new()
.spacing(10)
.align_items(Alignment::Center)
.push(icon::circle_check_icon().style(color::legacy::SUCCESS))
.push(text("Connection checked").style(color::legacy::SUCCESS)),
.push(icon::circle_check_icon().style(color::GREEN))
.push(text("Connection checked").style(color::GREEN)),
)
} else {
Container::new(
Row::new()
.spacing(10)
.align_items(Alignment::Center)
.push(icon::circle_cross_icon().style(color::legacy::ALERT))
.push(text("Connection failed").style(color::legacy::ALERT)),
.push(icon::circle_cross_icon().style(color::RED))
.push(text("Connection failed").style(color::RED)),
)
}
})
@ -868,7 +859,7 @@ pub fn define_bitcoin<'a>(
Row::new()
.spacing(10)
.push(Container::new(
button::border(None, "Check connection")
button::secondary(None, "Check connection")
.on_press(Message::DefineBitcoind(
message::DefineBitcoind::PingBitcoind,
))
@ -1048,7 +1039,7 @@ pub fn defined_sequence<'a>(
Some(
text("No two recovery paths may become available at the very same date.")
.small()
.style(color::legacy::ALERT),
.style(color::RED),
)
} else {
None
@ -1086,7 +1077,7 @@ pub fn defined_sequence<'a>(
.align_y(alignment::Vertical::Center),
)
.push(
button::border(Some(icon::pencil_icon()), "Edit")
button::secondary(Some(icon::pencil_icon()), "Edit")
.on_press(message::DefinePath::EditSequence),
)
.spacing(15),
@ -1116,18 +1107,14 @@ pub fn undefined_descriptor_key<'a>() -> Element<'a, message::DefineKey> {
Column::new()
.spacing(15)
.align_items(Alignment::Center)
.push(
icon::key_icon()
.style(color::DARK_GREY)
.size(30)
.width(Length::Units(50)),
),
.push(icon::key_icon().size(30).width(Length::Units(50))),
)
.height(Length::Fill)
.align_y(alignment::Vertical::Center),
)
.push(
button::border(Some(icon::pencil_icon()), "Set").on_press(message::DefineKey::Edit),
button::secondary(Some(icon::pencil_icon()), "Set")
.on_press(message::DefineKey::Edit),
)
.push(Space::with_height(Length::Units(5))),
)
@ -1172,7 +1159,7 @@ pub fn defined_descriptor_key(
)
.push(
icon::circle_check_icon()
.style(color::legacy::SUCCESS)
.style(color::GREEN)
.size(20)
.width(Length::Units(50)),
),
@ -1182,7 +1169,9 @@ pub fn defined_descriptor_key(
)
.height(Length::Fill),
)
.push(button::border(Some(icon::pencil_icon()), "Edit").on_press(message::DefineKey::Edit))
.push(
button::secondary(Some(icon::pencil_icon()), "Edit").on_press(message::DefineKey::Edit),
)
.push(Space::with_height(Length::Units(5)));
if !valid {
@ -1197,7 +1186,7 @@ pub fn defined_descriptor_key(
.push(
text("Key is for a different network")
.small()
.style(color::legacy::ALERT),
.style(color::RED),
)
.into()
} else if duplicate_key {
@ -1209,7 +1198,7 @@ pub fn defined_descriptor_key(
.height(Length::Units(150))
.width(Length::Units(150)),
)
.push(text("Duplicate key").small().style(color::legacy::ALERT))
.push(text("Duplicate key").small().style(color::RED))
.into()
} else if duplicate_name {
Column::new()
@ -1220,7 +1209,7 @@ pub fn defined_descriptor_key(
.height(Length::Units(150))
.width(Length::Units(150)),
)
.push(text("Duplicate name").small().style(color::legacy::ALERT))
.push(text("Duplicate name").small().style(color::RED))
.into()
} else {
card::simple(col)
@ -1260,7 +1249,7 @@ pub fn edit_key_modal<'a>(
.width(Length::Fill),
)
.push(
button::border(Some(icon::reload_icon()), "Refresh")
button::secondary(Some(icon::reload_icon()), "Refresh")
.on_press(Message::Reload),
),
)
@ -1288,7 +1277,7 @@ pub fn edit_key_modal<'a>(
})
.width(Length::Fill)
.on_press(Message::UseHotSigner)
.style(theme::Button::Secondary),
.style(theme::Button::Border),
)
.width(Length::Fill),
)
@ -1336,11 +1325,15 @@ pub fn edit_key_modal<'a>(
)
.push(text(&form_name.value)),
)
.push(button::border(Some(icon::pencil_icon()), "Edit").on_press(
Message::DefineDescriptor(message::DefineDescriptor::KeyModal(
message::ImportKeyModal::EditName,
)),
)),
.push(
button::secondary(Some(icon::pencil_icon()), "Edit").on_press(
Message::DefineDescriptor(
message::DefineDescriptor::KeyModal(
message::ImportKeyModal::EditName,
),
),
),
),
)
} else if !form_xpub.value.is_empty() && form_xpub.valid {
Column::new()
@ -1501,7 +1494,7 @@ fn hw_list_view(
hw::unsupported_hardware_wallet(&kind.to_string(), version.as_ref())
}
})
.style(theme::Button::Secondary)
.style(theme::Button::Border)
.width(Length::Fill);
if !processing && hw.is_supported() {
bttn = bttn.on_press(Message::Select(i));
@ -1611,10 +1604,7 @@ pub fn recover_mnemonic<'a>(
.width(Length::Units(100)),
)
.push_maybe(if *valid {
Some(
icon::circle_check_icon()
.style(color::legacy::SUCCESS),
)
Some(icon::circle_check_icon().style(color::GREEN))
} else {
None
}),
@ -1622,9 +1612,7 @@ pub fn recover_mnemonic<'a>(
},
))
.push(Space::with_height(Length::Units(50)))
.push_maybe(
error.map(|e| card::invalid(text(e).style(color::legacy::ALERT))),
),
.push_maybe(error.map(|e| card::invalid(text(e).style(color::RED)))),
)
} else {
None
@ -1633,7 +1621,7 @@ pub fn recover_mnemonic<'a>(
Row::new()
.spacing(10)
.push(
button::border(None, "Import mnemonic")
button::secondary(None, "Import mnemonic")
.on_press(Message::ImportMnemonic(true))
.width(Length::Units(200)),
)
@ -1646,7 +1634,7 @@ pub fn recover_mnemonic<'a>(
Row::new()
.spacing(10)
.push(
button::border(None, "Cancel")
button::secondary(None, "Cancel")
.on_press(Message::ImportMnemonic(false))
.width(Length::Units(200)),
)

View File

@ -114,7 +114,7 @@ impl Launcher {
.on_press(ViewMessage::Check(*choice))
.padding(10)
.width(Length::Fill)
.style(theme::Button::Secondary),
.style(theme::Button::Border),
)
},
)

View File

@ -107,13 +107,9 @@ impl Application for DesignSystem {
button(
container(text(section.title()))
.width(Length::Fill)
.padding(5)
.padding(10)
)
.style(if i == self.current {
theme::Button::Primary
} else {
theme::Button::Transparent
})
.style(theme::Button::Menu(i == self.current))
.on_press(Message::Section(i))
.width(Length::Units(200))
)

View File

@ -43,18 +43,17 @@ impl Section for Colors {
column![
h1(self.title()),
column![
color_row(color::dark::BLACK, "BLACK (0,0,0)"),
color_row(
color::dark::LIGHT_BLACK,
"LIGHT_BLACK #141414 original design"
),
color_row(color::dark::GREEN, "GREEN #00FF66 original design"),
color_row(color::dark::GREY_5, "GREY #272727"),
color_row(color::dark::GREY_4, "GREY #424242"),
color_row(color::dark::GREY_3, "GREY #717171"),
color_row(color::dark::GREY_2, "GREY #CCCCCC"),
color_row(color::dark::GREY_1, "GREY #E6E6E6"),
color_row(color::dark::WHITE, "WHITE #FFFFFF"),
color_row(color::BLACK, "BLACK (0,0,0)"),
color_row(color::LIGHT_BLACK, "LIGHT_BLACK #141414 original design"),
color_row(color::GREEN, "GREEN #00FF66 original design"),
color_row(color::GREY_7, "GREY #3F3F3F"),
color_row(color::GREY_6, "GREY #202020"),
color_row(color::GREY_5, "GREY #272727"),
color_row(color::GREY_4, "GREY #424242"),
color_row(color::GREY_3, "GREY #717171"),
color_row(color::GREY_2, "GREY #CCCCCC"),
color_row(color::GREY_1, "GREY #E6E6E6"),
color_row(color::WHITE, "WHITE #FFFFFF"),
color_row(color::RED, "RED #F04359"),
color_row(color::ORANGE, "ORANGE #FFa700")
]
@ -140,7 +139,9 @@ impl Section for Buttons {
button_row(theme::Button::Primary, "Primary"),
button_row(theme::Button::Secondary, "Secondary"),
button_row(theme::Button::Destructive, "Destructive"),
button_row(theme::Button::Transparent, "Transparent")
button_row(theme::Button::Transparent, "Transparent"),
button_row(theme::Button::TransparentBorder, "Transparent Border"),
button_row(theme::Button::Border, "Border"),
]
.spacing(20)
]
@ -183,7 +184,7 @@ impl Section for HardwareWallets {
.width(Length::Units(500))
)
.on_press(Message::Ignore)
.style(theme::Button::Secondary),
.style(theme::Button::Border),
button(
hw::supported_hardware_wallet(
"ledger",
@ -194,7 +195,7 @@ impl Section for HardwareWallets {
.width(Length::Units(500))
)
.on_press(Message::Ignore)
.style(theme::Button::Secondary),
.style(theme::Button::Border),
button(
hw::unregistered_hardware_wallet(
"ledger",
@ -205,13 +206,13 @@ impl Section for HardwareWallets {
.width(Length::Units(500))
)
.on_press(Message::Ignore)
.style(theme::Button::Secondary),
.style(theme::Button::Border),
button(
hw::unsupported_hardware_wallet("ledger", Some("v2.1.0"))
.width(Length::Units(500))
)
.on_press(Message::Ignore)
.style(theme::Button::Secondary),
.style(theme::Button::Border),
button(
hw::processing_hardware_wallet(
"ledger",
@ -222,7 +223,7 @@ impl Section for HardwareWallets {
.width(Length::Units(500))
)
.on_press(Message::Ignore)
.style(theme::Button::Secondary),
.style(theme::Button::Border),
button(
hw::sign_success_hardware_wallet(
"ledger",
@ -233,7 +234,7 @@ impl Section for HardwareWallets {
.width(Length::Units(500))
)
.on_press(Message::Ignore)
.style(theme::Button::Secondary),
.style(theme::Button::Border),
button(
hw::registration_success_hardware_wallet(
"ledger",
@ -244,7 +245,7 @@ impl Section for HardwareWallets {
.width(Length::Units(500))
)
.on_press(Message::Ignore)
.style(theme::Button::Secondary),
.style(theme::Button::Border),
]
.spacing(20)
]

View File

@ -1,167 +1,56 @@
use iced::Color;
pub const BLACK: Color = iced::Color::BLACK;
pub const LIGHT_BLACK: Color = Color::from_rgb(
0x14 as f32 / 255.0,
0x14 as f32 / 255.0,
0x14 as f32 / 255.0,
);
pub const GREY_7: Color = Color::from_rgb(
0x3F as f32 / 255.0,
0x3F as f32 / 255.0,
0x3F as f32 / 255.0,
);
pub const GREY_6: Color = Color::from_rgb(
0x20 as f32 / 255.0,
0x20 as f32 / 255.0,
0x20 as f32 / 255.0,
);
pub const GREY_5: Color = Color::from_rgb(
0x27 as f32 / 255.0,
0x27 as f32 / 255.0,
0x27 as f32 / 255.0,
);
pub const GREY_4: Color = Color::from_rgb(
0x42 as f32 / 255.0,
0x42 as f32 / 255.0,
0x42 as f32 / 255.0,
);
pub const GREY_3: Color = Color::from_rgb(
0x71 as f32 / 255.0,
0x71 as f32 / 255.0,
0x71 as f32 / 255.0,
);
pub const GREY_2: Color = Color::from_rgb(
0xCC as f32 / 255.0,
0xCC as f32 / 255.0,
0xCC as f32 / 255.0,
);
pub const GREY_1: Color = Color::from_rgb(
0xE6 as f32 / 255.0,
0xE6 as f32 / 255.0,
0xE6 as f32 / 255.0,
);
pub const WHITE: Color = iced::Color::WHITE;
pub const GREEN: Color = Color::from_rgb(
0x00 as f32 / 255.0,
0xFF as f32 / 255.0,
0x66 as f32 / 255.0,
);
pub const DARK_GREY: Color = Color::from_rgb(
0x55 as f32 / 255.0,
0x55 as f32 / 255.0,
0x55 as f32 / 255.0,
);
pub const GREY: Color = Color::from_rgb(
0xCC as f32 / 255.0,
0xCC as f32 / 255.0,
0xCC as f32 / 255.0,
);
pub const LIGHT_GREY: Color = Color::from_rgb(
0xE6 as f32 / 255.0,
0xE6 as f32 / 255.0,
0xE6 as f32 / 255.0,
);
pub const RED: Color = Color::from_rgb(
0xF0 as f32 / 255.0,
0x43 as f32 / 255.0,
0x59 as f32 / 255.0,
0xE2 as f32 / 255.0,
0x4E as f32 / 255.0,
0x1B as f32 / 255.0,
);
pub const ORANGE: Color =
Color::from_rgb(0xFF as f32 / 255.0, 0xa7 as f32 / 255.0, 0x0 as f32 / 255.0);
pub mod dark {
use iced::Color;
pub const BLACK: Color = iced::Color::BLACK;
pub const LIGHT_BLACK: Color = Color::from_rgb(
0x14 as f32 / 255.0,
0x14 as f32 / 255.0,
0x14 as f32 / 255.0,
);
pub const GREY_5: Color = Color::from_rgb(
0x27 as f32 / 255.0,
0x27 as f32 / 255.0,
0x27 as f32 / 255.0,
);
pub const GREY_4: Color = Color::from_rgb(
0x42 as f32 / 255.0,
0x42 as f32 / 255.0,
0x42 as f32 / 255.0,
);
pub const GREY_3: Color = Color::from_rgb(
0x71 as f32 / 255.0,
0x71 as f32 / 255.0,
0x71 as f32 / 255.0,
);
pub const GREY_2: Color = Color::from_rgb(
0xCC as f32 / 255.0,
0xCC as f32 / 255.0,
0xCC as f32 / 255.0,
);
pub const GREY_1: Color = Color::from_rgb(
0xE6 as f32 / 255.0,
0xE6 as f32 / 255.0,
0xE6 as f32 / 255.0,
);
pub const WHITE: Color = iced::Color::WHITE;
pub const GREEN: Color = Color::from_rgb(
0x00 as f32 / 255.0,
0xFF as f32 / 255.0,
0x66 as f32 / 255.0,
);
}
pub mod legacy {
use iced::Color;
pub const BACKGROUND: Color = Color::from_rgb(
0xF6 as f32 / 255.0,
0xF7 as f32 / 255.0,
0xF8 as f32 / 255.0,
);
pub const BORDER_GREY: Color = Color::from_rgb(
0xd0 as f32 / 255.0,
0xd7 as f32 / 255.0,
0xde as f32 / 255.0,
);
pub const FOREGROUND: Color = Color::WHITE;
pub const PRIMARY: Color = Color::BLACK;
pub const SECONDARY: Color = DARK_GREY;
pub const SUCCESS: Color = Color::from_rgb(
0x29 as f32 / 255.0,
0xBC as f32 / 255.0,
0x97 as f32 / 255.0,
);
#[allow(dead_code)]
pub const SUCCESS_LIGHT: Color = Color::from_rgba(
0x29 as f32 / 255.0,
0xBC as f32 / 255.0,
0x97 as f32 / 255.0,
0.5f32,
);
pub const ALERT: Color = Color::from_rgb(
0xF0 as f32 / 255.0,
0x43 as f32 / 255.0,
0x59 as f32 / 255.0,
);
pub const ALERT_LIGHT: Color = Color::from_rgba(
0xF0 as f32 / 255.0,
0x43 as f32 / 255.0,
0x59 as f32 / 255.0,
0.5f32,
);
pub const WARNING: Color =
Color::from_rgb(0xFF as f32 / 255.0, 0xa7 as f32 / 255.0, 0x0 as f32 / 255.0);
pub const WARNING_LIGHT: Color = Color::from_rgba(
0xFF as f32 / 255.0,
0xa7 as f32 / 255.0,
0x0 as f32 / 255.0,
0.5f32,
);
pub const CANCEL: Color = Color::from_rgb(
0x34 as f32 / 255.0,
0x37 as f32 / 255.0,
0x3D as f32 / 255.0,
);
pub const INFO: Color = Color::from_rgb(
0x2A as f32 / 255.0,
0x98 as f32 / 255.0,
0xBD as f32 / 255.0,
);
pub const INFO_LIGHT: Color = Color::from_rgba(
0x2A as f32 / 255.0,
0x98 as f32 / 255.0,
0xBD as f32 / 255.0,
0.5f32,
);
pub const DARK_GREY: Color = Color::from_rgb(
0x8c as f32 / 255.0,
0x97 as f32 / 255.0,
0xa6 as f32 / 255.0,
);
}

View File

@ -4,6 +4,14 @@ use iced::{Alignment, Length};
use super::text::text;
pub fn menu<'a, T: 'a>(icon: Option<Text<'a>>, t: &'static str) -> Button<'a, T> {
button::Button::new(content(icon, t).padding(10)).style(theme::Button::Menu(false))
}
pub fn menu_active<'a, T: 'a>(icon: Option<Text<'a>>, t: &'static str) -> Button<'a, T> {
button::Button::new(content(icon, t).padding(10)).style(theme::Button::Menu(true))
}
pub fn alert<'a, T: 'a>(icon: Option<Text<'a>>, t: &'static str) -> Button<'a, T> {
button::Button::new(content(icon, t)).style(theme::Button::Destructive)
}
@ -16,10 +24,14 @@ pub fn transparent<'a, T: 'a>(icon: Option<Text<'a>>, t: &'static str) -> Button
button::Button::new(content(icon, t)).style(theme::Button::Transparent)
}
pub fn border<'a, T: 'a>(icon: Option<Text<'a>>, t: &'static str) -> Button<'a, T> {
pub fn secondary<'a, T: 'a>(icon: Option<Text<'a>>, t: &'static str) -> Button<'a, T> {
button::Button::new(content(icon, t)).style(theme::Button::Secondary)
}
pub fn border<'a, T: 'a>(icon: Option<Text<'a>>, t: &'static str) -> Button<'a, T> {
button::Button::new(content(icon, t)).style(theme::Button::Border)
}
pub fn transparent_border<'a, T: 'a>(icon: Option<Text<'a>>, t: &'static str) -> Button<'a, T> {
button(content(icon, t)).style(theme::Button::TransparentBorder)
}

View File

@ -32,8 +32,8 @@ pub fn error<'a, T: 'a>(message: &'static str, error: String) -> Container<'a, T
Row::new()
.spacing(20)
.align_items(iced::Alignment::Center)
.push(icon::warning_icon().style(color::legacy::ALERT))
.push(text(message).style(color::legacy::ALERT)),
.push(icon::warning_icon().style(color::RED))
.push(text(message).style(color::RED)),
error,
iced::widget::tooltip::Position::Bottom,
)

View File

@ -74,7 +74,7 @@ impl<'a, Message: 'a + Clone> From<Form<'a, Message>> for Element<'a, Message> {
})
.push_maybe(if !form.valid {
form.warning
.map(|message| text::caption(message).style(color::legacy::ALERT))
.map(|message| text::caption(message).style(color::RED))
} else {
None
})

View File

@ -121,9 +121,7 @@ pub fn selected_hardware_wallet<'a, T: 'a, K: Display, V: Display, F: Display>(
])
.width(Length::Fill)
.into(),
icon::circle_check_icon()
.style(color::legacy::SUCCESS)
.into(),
icon::circle_check_icon().style(color::GREEN).into(),
])
.align_items(Alignment::Center),
)
@ -153,12 +151,8 @@ pub fn sign_success_hardware_wallet<'a, T: 'a, K: Display, V: Display, F: Displa
.width(Length::Fill)
.into(),
row(vec![
icon::circle_check_icon()
.style(color::legacy::SUCCESS)
.into(),
text::p1_regular("Signed")
.style(color::legacy::SUCCESS)
.into(),
icon::circle_check_icon().style(color::GREEN).into(),
text::p1_regular("Signed").style(color::GREEN).into(),
])
.align_items(Alignment::Center)
.spacing(5)
@ -192,12 +186,8 @@ pub fn registration_success_hardware_wallet<'a, T: 'a, K: Display, V: Display, F
.width(Length::Fill)
.into(),
row(vec![
icon::circle_check_icon()
.style(color::legacy::SUCCESS)
.into(),
text::p1_regular("Registered")
.style(color::legacy::SUCCESS)
.into(),
icon::circle_check_icon().style(color::GREEN).into(),
text::p1_regular("Registered").style(color::GREEN).into(),
])
.align_items(Alignment::Center)
.spacing(5)
@ -260,12 +250,8 @@ pub fn sign_success_hot_signer<'a, T: 'a, F: Display>(
.width(Length::Fill)
.into(),
row(vec![
icon::circle_check_icon()
.style(color::legacy::SUCCESS)
.into(),
text::p1_regular("Signed")
.style(color::legacy::SUCCESS)
.into(),
icon::circle_check_icon().style(color::GREEN).into(),
text::p1_regular("Signed").style(color::GREEN).into(),
])
.align_items(Alignment::Center)
.spacing(5)
@ -298,9 +284,7 @@ pub fn selected_hot_signer<'a, T: 'a, F: Display>(
])
.width(Length::Fill)
.into(),
icon::circle_check_icon()
.style(color::legacy::SUCCESS)
.into(),
icon::circle_check_icon().style(color::GREEN).into(),
])
.align_items(Alignment::Center),
)

View File

@ -1,4 +1,5 @@
use crate::{
color,
component::{collapse, text},
icon, theme,
widget::*,
@ -12,14 +13,16 @@ pub fn warning<'a, T: 'a + Clone>(message: String, error: String) -> Container<'
Button::new(
Row::new()
.push(
Container::new(text::p1_bold(message_clone.to_string()))
.width(Length::Fill),
Container::new(
text::p1_bold(message_clone.to_string()).style(color::WHITE),
)
.width(Length::Fill),
)
.push(
Row::new()
.align_items(Alignment::Center)
.spacing(10)
.push(text::p1_bold("Learn more"))
.push(text::p1_bold("Learn more").style(color::WHITE))
.push(icon::collapse_icon()),
),
)
@ -28,12 +31,15 @@ pub fn warning<'a, T: 'a + Clone>(message: String, error: String) -> Container<'
move || {
Button::new(
Row::new()
.push(Container::new(text::p1_bold(message.to_owned())).width(Length::Fill))
.push(
Container::new(text::p1_bold(message.to_owned()).style(color::WHITE))
.width(Length::Fill),
)
.push(
Row::new()
.align_items(Alignment::Center)
.spacing(10)
.push(text::p1_bold("Learn more"))
.push(text::p1_bold("Learn more").style(color::WHITE))
.push(icon::collapsed_icon()),
),
)

View File

@ -10,10 +10,9 @@ use super::color;
#[derive(Debug, Copy, Clone, Eq, PartialEq, Default)]
pub enum Theme {
#[default]
Dark,
Light,
#[default]
Legacy,
}
impl application::StyleSheet for Theme {
@ -22,16 +21,12 @@ impl application::StyleSheet for Theme {
fn appearance(&self, _style: &Self::Style) -> application::Appearance {
match self {
Theme::Light => application::Appearance {
background_color: color::LIGHT_GREY,
background_color: color::GREY_2,
text_color: color::LIGHT_BLACK,
},
Theme::Dark => application::Appearance {
background_color: color::LIGHT_BLACK,
text_color: color::LIGHT_GREY,
},
Theme::Legacy => application::Appearance {
background_color: color::legacy::BACKGROUND,
text_color: color::BLACK,
text_color: color::WHITE,
},
}
}
@ -47,12 +42,12 @@ impl iced::overlay::menu::StyleSheet for Theme {
fn appearance(&self, _style: &Self::Style) -> iced::overlay::menu::Appearance {
iced::overlay::menu::Appearance {
text_color: color::BLACK,
background: color::LIGHT_GREY.into(),
border_width: 1.0,
border_radius: 0.0,
border_color: color::LIGHT_GREY,
selected_text_color: color::BLACK,
text_color: color::GREY_2,
background: color::GREY_6.into(),
border_width: 0.0,
border_radius: 25.0,
border_color: color::GREY_2,
selected_text_color: color::LIGHT_BLACK,
selected_background: color::GREEN.into(),
}
}
@ -110,11 +105,11 @@ impl container::StyleSheet for Theme {
..container::Appearance::default()
},
Container::Background => container::Appearance {
background: color::LIGHT_GREY.into(),
background: color::GREY_2.into(),
..container::Appearance::default()
},
Container::Foreground => container::Appearance {
background: color::GREY.into(),
background: color::GREY_2.into(),
..container::Appearance::default()
},
Container::Border => container::Appearance {
@ -147,34 +142,7 @@ impl container::StyleSheet for Theme {
Container::Border => container::Appearance {
background: iced::Color::TRANSPARENT.into(),
border_width: 1.0,
border_color: color::LIGHT_GREY,
..container::Appearance::default()
},
Container::Card(c) => c.appearance(self),
Container::Badge(c) => c.appearance(self),
Container::Pill(c) => c.appearance(self),
Container::Custom(c) => container::Appearance {
background: (*c).into(),
..container::Appearance::default()
},
},
Theme::Legacy => match style {
Container::Transparent => container::Appearance {
background: iced::Color::TRANSPARENT.into(),
..container::Appearance::default()
},
Container::Background => container::Appearance {
background: color::legacy::BACKGROUND.into(),
..container::Appearance::default()
},
Container::Foreground => container::Appearance {
background: color::legacy::FOREGROUND.into(),
..container::Appearance::default()
},
Container::Border => container::Appearance {
background: iced::Color::TRANSPARENT.into(),
border_width: 1.0,
border_color: color::legacy::BORDER_GREY,
border_color: color::GREY_3,
..container::Appearance::default()
},
Container::Card(c) => c.appearance(self),
@ -222,25 +190,25 @@ impl Card {
match theme {
Theme::Light => match self {
Card::Simple => container::Appearance {
background: color::GREY.into(),
background: color::GREY_2.into(),
..container::Appearance::default()
},
Card::Border => container::Appearance {
background: iced::Color::TRANSPARENT.into(),
border_radius: 10.0,
border_color: color::GREY,
border_color: color::GREY_2,
border_width: 1.0,
..container::Appearance::default()
},
Card::Invalid => container::Appearance {
background: color::GREY.into(),
background: color::GREY_2.into(),
text_color: color::BLACK.into(),
border_width: 1.0,
border_color: color::RED,
..container::Appearance::default()
},
Card::Error => container::Appearance {
background: color::GREY.into(),
background: color::GREY_2.into(),
text_color: color::RED.into(),
border_width: 1.0,
border_color: color::RED,
@ -248,28 +216,29 @@ impl Card {
},
Card::Warning => container::Appearance {
background: color::ORANGE.into(),
text_color: color::GREY.into(),
text_color: color::GREY_2.into(),
..container::Appearance::default()
},
},
Theme::Dark => match self {
Card::Simple => container::Appearance {
background: color::LIGHT_BLACK.into(),
background: color::GREY_6.into(),
border_radius: 25.0,
..container::Appearance::default()
},
Card::Border => container::Appearance {
background: iced::Color::TRANSPARENT.into(),
border_radius: 10.0,
border_color: color::LIGHT_GREY,
border_radius: 25.0,
border_color: color::GREY_5,
border_width: 1.0,
..container::Appearance::default()
},
Card::Invalid => container::Appearance {
background: color::LIGHT_BLACK.into(),
text_color: color::BLACK.into(),
text_color: color::RED.into(),
border_width: 1.0,
border_radius: 25.0,
border_color: color::RED,
..container::Appearance::default()
},
Card::Error => container::Appearance {
background: color::LIGHT_BLACK.into(),
@ -280,44 +249,7 @@ impl Card {
},
Card::Warning => container::Appearance {
background: color::ORANGE.into(),
text_color: color::GREY.into(),
..container::Appearance::default()
},
},
Theme::Legacy => match self {
Card::Simple => container::Appearance {
background: color::legacy::FOREGROUND.into(),
border_radius: 10.0,
border_color: color::legacy::BORDER_GREY,
border_width: 1.0,
..container::Appearance::default()
},
Card::Border => container::Appearance {
background: iced::Color::TRANSPARENT.into(),
border_radius: 10.0,
border_color: color::legacy::BORDER_GREY,
border_width: 1.0,
..container::Appearance::default()
},
Card::Invalid => container::Appearance {
background: color::legacy::FOREGROUND.into(),
text_color: iced::Color::BLACK.into(),
border_width: 1.0,
border_radius: 10.0,
border_color: color::legacy::ALERT,
},
Card::Error => container::Appearance {
background: color::legacy::FOREGROUND.into(),
text_color: color::legacy::ALERT.into(),
border_width: 1.0,
border_radius: 10.0,
border_color: color::legacy::ALERT,
},
Card::Warning => container::Appearance {
border_radius: 0.0,
text_color: iced::Color::BLACK.into(),
background: color::legacy::WARNING.into(),
border_color: color::legacy::WARNING,
text_color: color::WHITE.into(),
..container::Appearance::default()
},
},
@ -337,12 +269,12 @@ impl Badge {
match self {
Self::Standard => container::Appearance {
border_radius: 40.0,
background: color::legacy::BACKGROUND.into(),
background: color::GREY_4.into(),
..container::Appearance::default()
},
Self::Bitcoin => container::Appearance {
border_radius: 40.0,
background: color::legacy::WARNING.into(),
background: color::ORANGE.into(),
text_color: iced::Color::WHITE.into(),
..container::Appearance::default()
},
@ -354,7 +286,6 @@ impl Badge {
pub enum Pill {
#[default]
Simple,
InversePrimary,
Primary,
Success,
}
@ -363,27 +294,21 @@ impl Pill {
fn appearance(&self, _theme: &Theme) -> iced::widget::container::Appearance {
match self {
Self::Primary => container::Appearance {
background: color::legacy::PRIMARY.into(),
border_radius: 10.0,
text_color: iced::Color::WHITE.into(),
..container::Appearance::default()
},
Self::InversePrimary => container::Appearance {
background: color::legacy::FOREGROUND.into(),
border_radius: 10.0,
text_color: color::legacy::PRIMARY.into(),
background: color::GREEN.into(),
border_radius: 25.0,
text_color: color::LIGHT_BLACK.into(),
..container::Appearance::default()
},
Self::Success => container::Appearance {
background: color::legacy::SUCCESS.into(),
border_radius: 10.0,
text_color: iced::Color::WHITE.into(),
background: color::GREEN.into(),
border_radius: 25.0,
text_color: color::LIGHT_BLACK.into(),
..container::Appearance::default()
},
Self::Simple => container::Appearance {
background: color::legacy::BACKGROUND.into(),
border_radius: 10.0,
text_color: iced::Color::BLACK.into(),
background: color::GREEN.into(),
border_radius: 25.0,
text_color: color::LIGHT_BLACK.into(),
..container::Appearance::default()
},
}
@ -424,10 +349,10 @@ impl scrollable::StyleSheet for Theme {
scrollable::Scrollbar {
background: None,
border_width: 0.0,
border_color: color::legacy::BORDER_GREY,
border_color: color::GREY_7,
border_radius: 10.0,
scroller: scrollable::Scroller {
color: color::legacy::BORDER_GREY,
color: color::GREY_7,
border_radius: 10.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
@ -453,21 +378,21 @@ impl pick_list::StyleSheet for Theme {
fn active(&self, style: &Self::Style) -> pick_list::Appearance {
match style {
PickList::Simple => pick_list::Appearance {
placeholder_color: color::legacy::FOREGROUND,
handle_color: color::legacy::FOREGROUND,
background: color::legacy::FOREGROUND.into(),
placeholder_color: color::GREY_6,
handle_color: color::GREY_6,
background: color::GREEN.into(),
border_width: 1.0,
border_color: color::legacy::BORDER_GREY,
border_radius: 10.0,
border_color: color::GREY_7,
border_radius: 25.0,
text_color: iced::Color::BLACK,
},
PickList::Invalid => pick_list::Appearance {
placeholder_color: color::legacy::FOREGROUND,
handle_color: color::legacy::FOREGROUND,
background: color::legacy::FOREGROUND.into(),
placeholder_color: color::GREY_6,
handle_color: color::GREY_6,
background: color::GREY_6.into(),
border_width: 1.0,
border_color: color::legacy::ALERT,
border_radius: 10.0,
border_color: color::RED,
border_radius: 25.0,
text_color: iced::Color::BLACK,
},
}
@ -488,7 +413,7 @@ impl checkbox::StyleSheet for Theme {
checkbox::Appearance {
background: iced::Color::TRANSPARENT.into(),
border_width: 1.0,
border_color: color::GREY,
border_color: color::GREY_7,
checkmark_color: color::GREEN,
text_color: None,
border_radius: 0.0,
@ -509,6 +434,8 @@ pub enum Button {
Destructive,
Transparent,
TransparentBorder,
Border,
Menu(bool),
}
impl button::StyleSheet for Theme {
@ -516,168 +443,89 @@ impl button::StyleSheet for Theme {
fn active(&self, style: &Self::Style) -> button::Appearance {
match self {
Theme::Light => match style {
Button::Primary => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::LIGHT_BLACK.into(),
border_radius: 10.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::LIGHT_GREY,
},
Button::Secondary => button::Appearance {
shadow_offset: iced::Vector::default(),
background: iced::Color::TRANSPARENT.into(),
border_radius: 10.0,
border_width: 1.0,
border_color: color::DARK_GREY,
text_color: color::LIGHT_BLACK,
},
Button::Destructive => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::RED.into(),
border_radius: 10.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::LIGHT_GREY,
},
Button::Transparent | Button::TransparentBorder => button::Appearance {
shadow_offset: iced::Vector::default(),
background: iced::Color::TRANSPARENT.into(),
border_radius: 10.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::LIGHT_BLACK,
},
},
Theme::Light => button::Appearance::default(),
Theme::Dark => match style {
Button::Primary => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::GREY.into(),
border_radius: 10.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::LIGHT_BLACK,
},
Button::Secondary => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::LIGHT_BLACK.into(),
border_radius: 10.0,
background: iced::Color::TRANSPARENT.into(),
border_radius: 25.0,
border_width: 1.0,
border_color: color::LIGHT_GREY,
text_color: color::LIGHT_GREY,
border_color: color::GREY_7,
text_color: color::GREY_2,
},
Button::Secondary | Button::Border => button::Appearance {
shadow_offset: iced::Vector::default(),
background: iced::Color::TRANSPARENT.into(),
border_radius: 25.0,
border_width: 1.0,
border_color: color::GREY_7,
text_color: color::GREY_2,
},
Button::Destructive => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::RED.into(),
border_radius: 10.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::LIGHT_BLACK,
background: iced::Color::TRANSPARENT.into(),
border_radius: 25.0,
border_width: 1.0,
border_color: color::RED,
text_color: color::RED,
},
Button::Transparent | Button::TransparentBorder => button::Appearance {
Button::Transparent => button::Appearance {
shadow_offset: iced::Vector::default(),
background: iced::Color::TRANSPARENT.into(),
border_radius: 10.0,
border_radius: 25.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::LIGHT_GREY,
text_color: color::GREY_2,
},
},
Theme::Legacy => match style {
Button::Primary => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::legacy::PRIMARY.into(),
border_radius: 10.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::legacy::FOREGROUND,
},
Button::Destructive => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::legacy::FOREGROUND.into(),
border_radius: 10.0,
border_width: 0.0,
border_color: color::legacy::ALERT,
text_color: color::legacy::ALERT,
},
Button::Transparent | Button::TransparentBorder => button::Appearance {
Button::TransparentBorder => button::Appearance {
shadow_offset: iced::Vector::default(),
background: iced::Color::TRANSPARENT.into(),
border_radius: 10.0,
border_radius: 25.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: iced::Color::BLACK,
},
Button::Secondary => button::Appearance {
shadow_offset: iced::Vector::default(),
background: iced::Color::TRANSPARENT.into(),
border_radius: 10.0,
border_width: 1.2,
border_color: color::legacy::BORDER_GREY,
text_color: iced::Color::BLACK,
text_color: color::WHITE,
},
Button::Menu(active) => {
if *active {
button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::LIGHT_BLACK.into(),
border_radius: 25.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::WHITE,
}
} else {
button::Appearance {
shadow_offset: iced::Vector::default(),
background: iced::Color::TRANSPARENT.into(),
border_radius: 25.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::WHITE,
}
}
}
},
}
}
fn hovered(&self, style: &Self::Style) -> button::Appearance {
match self {
Theme::Light => match style {
Button::Primary => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::LIGHT_BLACK.into(),
border_radius: 10.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::LIGHT_GREY,
},
Button::Secondary => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::LIGHT_BLACK.into(),
border_radius: 10.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::LIGHT_GREY,
},
Button::Destructive => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::RED.into(),
border_radius: 10.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::LIGHT_GREY,
},
Button::Transparent => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::DARK_GREY.into(),
border_radius: 10.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::LIGHT_GREY,
},
Button::TransparentBorder => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::DARK_GREY.into(),
border_radius: 10.0,
border_width: 1.0,
border_color: color::LIGHT_BLACK,
text_color: color::LIGHT_GREY,
},
},
Theme::Light => button::Appearance::default(),
Theme::Dark => match style {
Button::Primary => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::GREY.into(),
border_radius: 10.0,
background: color::GREEN.into(),
border_radius: 25.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::LIGHT_BLACK,
},
Button::Secondary => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::GREY.into(),
border_radius: 10.0,
background: color::GREEN.into(),
border_radius: 25.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::LIGHT_BLACK,
@ -685,68 +533,34 @@ impl button::StyleSheet for Theme {
Button::Destructive => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::RED.into(),
border_radius: 10.0,
border_radius: 25.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::LIGHT_BLACK,
},
Button::Transparent => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::DARK_GREY.into(),
border_radius: 10.0,
background: color::GREY_7.into(),
border_radius: 25.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::LIGHT_GREY,
text_color: color::GREY_2,
},
Button::TransparentBorder => button::Appearance {
Button::TransparentBorder | Button::Border => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::DARK_GREY.into(),
border_radius: 10.0,
background: iced::Color::TRANSPARENT.into(),
border_radius: 25.0,
border_width: 1.0,
border_color: color::LIGHT_GREY,
text_color: color::LIGHT_GREY,
border_color: color::GREEN,
text_color: color::WHITE,
},
},
Theme::Legacy => match style {
Button::Primary => button::Appearance {
Button::Menu(_) => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::legacy::PRIMARY.into(),
border_radius: 10.0,
background: color::LIGHT_BLACK.into(),
border_radius: 25.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: color::legacy::FOREGROUND,
},
Button::Destructive => button::Appearance {
shadow_offset: iced::Vector::default(),
background: color::legacy::FOREGROUND.into(),
border_radius: 10.0,
border_width: 0.0,
border_color: color::legacy::ALERT,
text_color: color::legacy::ALERT,
},
Button::Transparent => button::Appearance {
shadow_offset: iced::Vector::default(),
background: iced::Color::TRANSPARENT.into(),
border_radius: 10.0,
border_width: 0.0,
border_color: iced::Color::TRANSPARENT,
text_color: iced::Color::BLACK,
},
Button::TransparentBorder => button::Appearance {
shadow_offset: iced::Vector::default(),
background: iced::Color::TRANSPARENT.into(),
border_radius: 10.0,
border_width: 1.0,
border_color: iced::Color::BLACK,
text_color: iced::Color::BLACK,
},
Button::Secondary => button::Appearance {
shadow_offset: iced::Vector::default(),
background: iced::Color::TRANSPARENT.into(),
border_radius: 10.0,
border_width: 1.0,
border_color: iced::Color::BLACK,
text_color: iced::Color::BLACK,
text_color: color::WHITE,
},
},
}
@ -765,16 +579,16 @@ impl text_input::StyleSheet for Theme {
fn active(&self, style: &Self::Style) -> text_input::Appearance {
match style {
Form::Simple => text_input::Appearance {
background: iced::Background::Color(color::legacy::FOREGROUND),
border_radius: 5.0,
background: iced::Background::Color(iced::Color::TRANSPARENT),
border_radius: 25.0,
border_width: 1.0,
border_color: color::legacy::DARK_GREY,
border_color: color::GREY_7,
},
Form::Invalid => text_input::Appearance {
background: iced::Background::Color(color::legacy::FOREGROUND),
border_radius: 5.0,
background: iced::Background::Color(iced::Color::TRANSPARENT),
border_radius: 25.0,
border_width: 1.0,
border_color: color::legacy::ALERT,
border_color: color::RED,
},
}
}
@ -786,15 +600,15 @@ impl text_input::StyleSheet for Theme {
}
fn placeholder_color(&self, _style: &Self::Style) -> iced::Color {
iced::Color::from_rgb(0.7, 0.7, 0.7)
color::GREY_7
}
fn value_color(&self, _style: &Self::Style) -> iced::Color {
iced::Color::from_rgb(0.3, 0.3, 0.3)
color::GREY_2
}
fn selection_color(&self, _style: &Self::Style) -> iced::Color {
iced::Color::from_rgb(0.8, 0.8, 1.0)
color::GREEN
}
}
@ -808,7 +622,7 @@ impl progress_bar::StyleSheet for Theme {
type Style = ProgressBar;
fn appearance(&self, _style: &Self::Style) -> progress_bar::Appearance {
progress_bar::Appearance {
background: color::GREY.into(),
background: color::GREY_6.into(),
bar: color::GREEN.into(),
border_radius: 10.0,
}
@ -829,7 +643,7 @@ impl slider::StyleSheet for Theme {
width: 8,
border_radius: 4.0,
},
color: color::legacy::FOREGROUND,
color: color::BLACK,
border_color: color::GREEN,
border_width: 1.0,
};