From 91e442f49e2a50e67e81e70469397904ce0e079f Mon Sep 17 00:00:00 2001 From: edouardparis Date: Thu, 23 Jan 2025 18:01:30 +0100 Subject: [PATCH] use liana-ui::theme methods --- liana-gui/src/app/view/coins.rs | 52 +++---- liana-gui/src/app/view/home.rs | 26 ++-- liana-gui/src/app/view/hw.rs | 12 +- liana-gui/src/app/view/mod.rs | 12 +- liana-gui/src/app/view/psbt.rs | 116 +++++++-------- liana-gui/src/app/view/psbts.rs | 10 +- liana-gui/src/app/view/receive.rs | 8 +- liana-gui/src/app/view/recovery.rs | 12 +- liana-gui/src/app/view/settings.rs | 114 +++++++------- liana-gui/src/app/view/spend/mod.rs | 26 ++-- liana-gui/src/app/view/transactions.rs | 24 +-- liana-gui/src/installer/view/editor/mod.rs | 36 ++--- .../installer/view/editor/template/custom.rs | 8 +- .../view/editor/template/inheritance.rs | 12 +- .../src/installer/view/editor/template/mod.rs | 12 +- .../template/multisig_security_wallet.rs | 14 +- liana-gui/src/installer/view/mod.rs | 140 +++++++++--------- liana-gui/src/launcher.rs | 22 +-- liana-gui/src/lianalite/login.rs | 4 +- 19 files changed, 330 insertions(+), 330 deletions(-) diff --git a/liana-gui/src/app/view/coins.rs b/liana-gui/src/app/view/coins.rs index 6f53b80fb..def964f4b 100644 --- a/liana-gui/src/app/view/coins.rs +++ b/liana-gui/src/app/view/coins.rs @@ -84,7 +84,7 @@ fn coin_list_view<'a>( // It is not possible to know if a coin is a // change coin or not so for now, From is // enough - p1_regular("From").style(color::GREY_3), + p1_regular("From").color(color::GREY_3), ) .push(p1_regular(label)), ) @@ -101,7 +101,7 @@ fn coin_list_view<'a>( // It is not possible to know if a coin is a // change coin or not so for now, From is // enough - p1_regular("From").style(color::GREY_3), + p1_regular("From").color(color::GREY_3), ) .push(p1_regular(label)), ) @@ -130,7 +130,7 @@ fn coin_list_view<'a>( .align_y(Alignment::Center) .spacing(20), ) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) .padding(10) .on_press(Message::Select(index)), ) @@ -156,7 +156,7 @@ fn coin_list_view<'a>( if blockheight > b as u32 + timelock as u32 { Some(Container::new( p1_bold("One of the recovery path is available") - .style(color::RED), + .color(color::RED), )) } else { Some(Container::new(p1_bold(format!( @@ -178,32 +178,32 @@ fn coin_list_view<'a>( .push( p2_regular("Address label:") .bold() - .style(color::GREY_2), + .color(color::GREY_2), ) .push(if let Some(label) = labels.get(&address) { - p2_regular(label).style(color::GREY_2) + p2_regular(label).color(color::GREY_2) } else { - p2_regular("No label").style(color::GREY_2) + p2_regular("No label").color(color::GREY_2) }) .spacing(5), ) .push( Row::new() .align_y(Alignment::Center) - .push(p2_regular("Address:").bold().style(color::GREY_2)) + .push(p2_regular("Address:").bold().color(color::GREY_2)) .push( Row::new() .align_y(Alignment::Center) .push( p2_regular(address.clone()) - .style(color::GREY_2), + .color(color::GREY_2), ) .push( Button::new(icon::clipboard_icon()) .on_press(Message::Clipboard( address.clone(), )) - .style(theme::Button::TransparentBorder), + .style(theme::button::transparent_border), ), ) .spacing(5), @@ -214,32 +214,32 @@ fn coin_list_view<'a>( .push( p2_regular("Deposit transaction label:") .bold() - .style(color::GREY_2), + .color(color::GREY_2), ) .push(if let Some(label) = labels.get(&txid) { - p2_regular(label).style(color::GREY_2) + p2_regular(label).color(color::GREY_2) } else { - p2_regular("No label").style(color::GREY_2) + p2_regular("No label").color(color::GREY_2) }) .spacing(5), ) .push( Row::new() .align_y(Alignment::Center) - .push(p2_regular("Outpoint:").bold().style(color::GREY_2)) + .push(p2_regular("Outpoint:").bold().color(color::GREY_2)) .push( Row::new() .align_y(Alignment::Center) .push( p2_regular(format!("{}", coin.outpoint)) - .style(color::GREY_2), + .color(color::GREY_2), ) .push( Button::new(icon::clipboard_icon()) .on_press(Message::Clipboard( coin.outpoint.to_string(), )) - .style(theme::Button::TransparentBorder), + .style(theme::button::transparent_border), ), ) .spacing(5), @@ -247,9 +247,9 @@ fn coin_list_view<'a>( .push_maybe(coin.block_height.map(|b| { Row::new() .push( - p2_regular("Block height:").bold().style(color::GREY_2), + p2_regular("Block height:").bold().color(color::GREY_2), ) - .push(p2_regular(format!("{}", b)).style(color::GREY_2)) + .push(p2_regular(format!("{}", b)).color(color::GREY_2)) .spacing(5) })), ) @@ -257,7 +257,7 @@ fn coin_list_view<'a>( Column::new() .push( Row::new() - .push(p2_regular("Spend txid:").bold().style(color::GREY_2)) + .push(p2_regular("Spend txid:").bold().color(color::GREY_2)) .push(p2_regular(format!("{}", info.txid))) .spacing(5), ) @@ -266,13 +266,13 @@ fn coin_list_view<'a>( .push( p2_regular("Spend block height:") .bold() - .style(color::GREY_2), + .color(color::GREY_2), ) .push(p2_regular(format!("{}", height))) .spacing(5) } else { Row::new().push( - p2_regular("Not in a block").bold().style(color::GREY_2), + p2_regular("Not in a block").bold().color(color::GREY_2), ) }) .spacing(5) @@ -291,7 +291,7 @@ fn coin_list_view<'a>( None }), ) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) } pub fn coin_sequence_label<'a, T: 'a>(seq: u32, timelock: u32) -> Container<'a, T> { @@ -304,7 +304,7 @@ pub fn coin_sequence_label<'a, T: 'a>(seq: u32, timelock: u32) -> Container<'a, .align_y(Alignment::Center), ) .padding(10) - .style(theme::Container::Pill(theme::Pill::Warning)) + .style(theme::pill::warning) } else if seq < timelock * 10 / 100 { Container::new( Row::new() @@ -314,17 +314,17 @@ pub fn coin_sequence_label<'a, T: 'a>(seq: u32, timelock: u32) -> Container<'a, .align_y(Alignment::Center), ) .padding(10) - .style(theme::Container::Pill(theme::Pill::Simple)) + .style(theme::pill::simple) } else { Container::new( Row::new() .spacing(5) .push(icon::clock_icon().width(Length::Fixed(20.0))) - .push(p2_regular(expire_message(seq)).style(color::GREY_3)) + .push(p2_regular(expire_message(seq)).color(color::GREY_3)) .align_y(Alignment::Center), ) .padding(10) - .style(theme::Container::Pill(theme::Pill::Simple)) + .style(theme::pill::simple) } } diff --git a/liana-gui/src/app/view/home.rs b/liana-gui/src/app/view/home.rs index 8748257c4..d2c9f5103 100644 --- a/liana-gui/src/app/view/home.rs +++ b/liana-gui/src/app/view/home.rs @@ -69,13 +69,13 @@ pub fn home_view<'a>( SyncStatus::WalletFullScan => text("Syncing"), _ => text("Checking for new transactions"), } - .style(color::GREY_2), + .color(color::GREY_2), ) .push(spinner::typing_text_carousel( "...", true, Duration::from_millis(2000), - |content| text(content).style(color::GREY_2), + |content| text(content).color(color::GREY_2), )), ) } else { @@ -86,9 +86,9 @@ pub fn home_view<'a>( Some( Row::new() .spacing(10) - .push(text("+").size(H3_SIZE).style(color::GREY_3)) + .push(text("+").size(H3_SIZE).color(color::GREY_3)) .push(unconfirmed_amount_with_size(unconfirmed_balance, H3_SIZE)) - .push(text("unconfirmed").size(H3_SIZE).style(color::GREY_3)), + .push(text("unconfirmed").size(H3_SIZE).color(color::GREY_3)), ) } else { None @@ -111,13 +111,13 @@ pub fn home_view<'a>( .push( icon::tooltip_icon() .size(20) - .style(color::GREY_3) + .color(color::GREY_3) .width(Length::Fixed(20.0)), ) .width(Length::Fill), ) .padding(25) - .style(theme::Card::Border) + .style(theme::card::border) }) } else { Some( @@ -140,7 +140,7 @@ pub fn home_view<'a>( ), ) .padding(25) - .style(theme::Card::Invalid), + .style(theme::card::invalid), ) }) .push( @@ -168,7 +168,7 @@ pub fn home_view<'a>( ) .width(Length::Fill) .padding(15) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) .on_press_maybe(if !processing { Some(Message::Next) } else { @@ -176,7 +176,7 @@ pub fn home_view<'a>( }), ) .width(Length::Fill) - .style(theme::Container::Card(theme::Card::Simple)), + .style(theme::card::simple), ) } else { None @@ -193,7 +193,7 @@ fn event_list_view(event: &Payment) -> Element<'_, Message> { event .address_label .as_ref() - .map(|label| p1_regular(format!("address label: {}", label)).style(color::GREY_3)) + .map(|label| p1_regular(format!("address label: {}", label)).color(color::GREY_3)) }; if event.kind == PaymentKind::Incoming { if let Some(t) = event.time { @@ -298,7 +298,7 @@ pub fn payment_view<'a>( .push_maybe(tx.fee_amount.map(|fee_amount| { Row::new() .align_y(Alignment::Center) - .push(h3("Miner fee: ").style(color::GREY_3)) + .push(h3("Miner fee: ").color(color::GREY_3)) .push(amount_with_size(&fee_amount, H3_SIZE)) .push(text(" ").size(H3_SIZE)) .push( @@ -307,7 +307,7 @@ pub fn payment_view<'a>( fee_amount.to_sat() / tx.tx.vsize() as u64 )) .size(H4_SIZE) - .style(color::GREY_3), + .color(color::GREY_3), ) })) .push(card::simple( @@ -334,7 +334,7 @@ pub fn payment_view<'a>( .push( Button::new(icon::clipboard_icon()) .on_press(Message::Clipboard(tx.tx.txid().to_string())) - .style(theme::Button::TransparentBorder), + .style(theme::button::transparent_border), ) .width(Length::Shrink), ), diff --git a/liana-gui/src/app/view/hw.rs b/liana-gui/src/app/view/hw.rs index 4c15ef5fa..00759e7d3 100644 --- a/liana-gui/src/app/view/hw.rs +++ b/liana-gui/src/app/view/hw.rs @@ -69,7 +69,7 @@ pub fn hw_list_view( kind, pairing_code, .. } => hw::locked_hardware_wallet(kind, pairing_code.as_ref()), }) - .style(theme::Button::Border) + .style(theme::button::container_border) .width(Length::Fill); if !signing { if let HardwareWallet::Supported { registered, .. } = hw { @@ -80,7 +80,7 @@ pub fn hw_list_view( } Container::new(bttn) .width(Length::Fill) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) .into() } @@ -137,14 +137,14 @@ pub fn hw_list_view_for_registration( kind, pairing_code, .. } => hw::locked_hardware_wallet(kind, pairing_code.as_ref()), }) - .style(theme::Button::Border) + .style(theme::button::container_border) .width(Length::Fill); if !processing && hw.is_supported() { bttn = bttn.on_press(Message::SelectHardwareWallet(i)); } Container::new(bttn) .width(Length::Fill) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) .into() } @@ -222,13 +222,13 @@ pub fn hw_list_view_verify_address( ), }; let mut bttn = Button::new(content) - .style(theme::Button::Border) + .style(theme::button::container_border) .width(Length::Fill); if selectable && hw.is_supported() { bttn = bttn.on_press(Message::SelectHardwareWallet(i)); } Container::new(bttn) .width(Length::Fill) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) .into() } diff --git a/liana-gui/src/app/view/mod.rs b/liana-gui/src/app/view/mod.rs index 6ec4f6635..55c2e6e3e 100644 --- a/liana-gui/src/app/view/mod.rs +++ b/liana-gui/src/app/view/mod.rs @@ -77,7 +77,7 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> Container<'a, Message> { ) } else { row!(button::menu(Some(coins_icon()), "Coins") - .style(theme::Button::Menu(false)) + .style(theme::button::menu) .on_press(Message::Menu(Menu::Coins)) .width(iced::Length::Fill)) }; @@ -161,14 +161,14 @@ pub fn sidebar<'a>(menu: &Menu, cache: &'a Cache) -> Container<'a, Message> { .push_maybe(cache.rescan_progress.map(|p| { Container::new(text(format!(" Rescan...{:.2}% ", p * 100.0))) .padding(5) - .style(theme::Pill::Simple) + .style(theme::pill::simple) })) .push(settings_button), ) .height(Length::Shrink), ), ) - .style(theme::Container::Foreground) + .style(theme::container::foreground) } pub fn dashboard<'a, T: Into>>( @@ -195,7 +195,7 @@ pub fn dashboard<'a, T: Into>>( Space::with_width(Length::FillPortion(1)), ))) .center_x(Length::Fill) - .style(theme::Container::Background) + .style(theme::container::background) .height(Length::Fill), ) .width(Length::FillPortion(10)), @@ -229,7 +229,7 @@ pub fn modal<'a, T: Into>, F: Into>>( .push(button::secondary(Some(cross_icon()), "Close").on_press(Message::Close)), ) .padding(10) - .style(theme::Container::Background), + .style(theme::container::background), ) .push(modal_section(Container::new(scrollable(content)))) .push_maybe(fixed_footer) @@ -240,7 +240,7 @@ pub fn modal<'a, T: Into>, F: Into>>( fn modal_section<'a, T: 'a>(menu: Container<'a, T>) -> Container<'a, T> { Container::new(menu.max_width(1500)) - .style(theme::Container::Background) + .style(theme::container::background) .center_x(Length::Fill) .width(Length::Fill) .height(Length::Fill) diff --git a/liana-gui/src/app/view/psbt.rs b/liana-gui/src/app/view/psbt.rs index 5f0ef76bd..ac79b08f1 100644 --- a/liana-gui/src/app/view/psbt.rs +++ b/liana-gui/src/app/view/psbt.rs @@ -202,10 +202,10 @@ pub fn broadcast_action<'a>( .push(text(txid.to_string())) .push( Button::new( - icon::clipboard_icon().style(color::GREY_3), + icon::clipboard_icon().color(color::GREY_3), ) .on_press(Message::Clipboard(txid.to_string())) - .style(theme::Button::TransparentBorder), + .style(theme::button::transparent_border), ), ) }, @@ -297,7 +297,7 @@ pub fn spend_header<'a>( .push( Row::new() .align_y(Alignment::Center) - .push(h3("Miner fee: ").style(color::GREY_3)) + .push(h3("Miner fee: ").color(color::GREY_3)) .push_maybe(if tx.fee_amount.is_none() { Some(text("Missing information about transaction inputs")) } else { @@ -308,7 +308,7 @@ pub fn spend_header<'a>( .push_maybe(tx.min_feerate_vb().map(|rate| { text(format!("(~{} sats/vbyte)", &rate)) .size(H4_SIZE) - .style(color::GREY_3) + .color(color::GREY_3) })), ), ) @@ -358,21 +358,21 @@ pub fn spend_overview_view<'a>( .push(p1_bold("Tx ID").width(Length::Fill)) .push( p2_regular(tx.psbt.unsigned_tx.txid().to_string()) - .style(color::GREY_3), + .color(color::GREY_3), ) .push( - Button::new(icon::clipboard_icon().style(color::GREY_3)) + Button::new(icon::clipboard_icon().color(color::GREY_3)) .on_press(Message::Clipboard( tx.psbt.unsigned_tx.txid().to_string(), )) - .style(theme::Button::TransparentBorder), + .style(theme::button::transparent_border), ) .align_y(Alignment::Center), ), ) .push(signatures(tx, desc_info, key_aliases)), ) - .style(theme::Container::Card(theme::Card::Simple)), + .style(theme::card::simple), ) .push_maybe(if tx.status == SpendStatus::Pending { Some( @@ -414,8 +414,8 @@ pub fn signatures<'a>( .align_y(Alignment::Center) .spacing(10) .push(p1_bold("Status")) - .push(icon::circle_check_icon().style(color::GREEN)) - .push(text("Ready").bold().style(color::GREEN)) + .push(icon::circle_check_icon().color(color::GREEN)) + .push(text("Ready").bold().color(color::GREEN)) .push(text(" signed by")) .push(sigs.signed_pubkeys.keys().fold( Row::new().spacing(5), @@ -425,16 +425,16 @@ pub fn signatures<'a>( tooltip::Tooltip::new( Container::new(text(alias)) .padding(10) - .style(theme::Container::Pill(theme::Pill::Simple)), + .style(theme::pill::simple), text(value.to_string()), tooltip::Position::Bottom, ) - .style(theme::Container::Card(theme::Card::Simple)), + .style(theme::card::simple), ) } else { Container::new(text(value.to_string())) .padding(10) - .style(theme::Container::Pill(theme::Pill::Simple)) + .style(theme::pill::simple) }) }, )), @@ -456,15 +456,15 @@ pub fn signatures<'a>( Row::new() .spacing(5) .align_y(Alignment::Center) - .push(icon::circle_cross_icon().style(color::RED)) - .push(text("Not ready").style(color::RED)) + .push(icon::circle_cross_icon().color(color::RED)) + .push(text("Not ready").color(color::RED)) .width(Length::Fill), ) .push(icon::collapse_icon()), ) .padding(15) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) }, move || { Button::new( @@ -476,15 +476,15 @@ pub fn signatures<'a>( Row::new() .spacing(5) .align_y(Alignment::Center) - .push(icon::circle_cross_icon().style(color::RED)) - .push(text("Not ready").style(color::RED)) + .push(icon::circle_cross_icon().color(color::RED)) + .push(text("Not ready").color(color::RED)) .width(Length::Fill), ) .push(icon::collapsed_icon()), ) .padding(15) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) }, move || { Into::>::into( @@ -521,16 +521,16 @@ fn container_from_fg( tooltip::Tooltip::new( Container::new(text(alias)) .padding(10) - .style(theme::Container::Pill(theme::Pill::Simple)), + .style(theme::pill::simple), liana_ui::widget::Text::new(fg.to_string()), tooltip::Position::Bottom, ) - .style(theme::Container::Card(theme::Card::Simple)), + .style(theme::card::simple), ) } else { Container::new(text(fg.to_string())) .padding(10) - .style(theme::Container::Pill(theme::Pill::Simple)) + .style(theme::pill::simple) } } @@ -569,9 +569,9 @@ pub fn path_view<'a>( .push( Row::new() .push(if missing_signatures == 0 { - icon::circle_check_icon().style(color::GREEN) + icon::circle_check_icon().color(color::GREEN) } else { - icon::circle_cross_icon().style(color::GREY_3) + icon::circle_cross_icon().color(color::GREY_3) }) .push(Space::with_width(Length::Fixed(20.0))), ) @@ -587,12 +587,12 @@ pub fn path_view<'a>( " from " } )) - .style(color::GREY_3), + .color(color::GREY_3), ) .push_maybe(row_unsigned) .push_maybe( (!sigs.signed_pubkeys.is_empty()) - .then_some(p1_regular(", already signed by ").style(color::GREY_3)), + .then_some(p1_regular(", already signed by ").color(color::GREY_3)), ) .push(row_signed), ) @@ -625,7 +625,7 @@ pub fn inputs_view<'a>( ) .padding(20) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) }, move || { Button::new( @@ -643,7 +643,7 @@ pub fn inputs_view<'a>( ) .padding(20) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) }, move || { tx.input @@ -662,7 +662,7 @@ pub fn inputs_view<'a>( .into() }, )) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) .into() } @@ -708,7 +708,7 @@ pub fn outputs_view<'a>( ) .padding(20) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) }, move || { Button::new( @@ -726,7 +726,7 @@ pub fn outputs_view<'a>( ) .padding(20) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) }, move || { tx.output @@ -756,12 +756,12 @@ pub fn outputs_view<'a>( .into() }, )) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) } else { Container::new(h4_bold("0 payment")) .padding(20) .width(Length::Fill) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) } }) .push_maybe( @@ -781,7 +781,7 @@ pub fn outputs_view<'a>( ) .padding(20) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) }, move || { Button::new( @@ -792,7 +792,7 @@ pub fn outputs_view<'a>( ) .padding(20) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) }, move || { tx.output @@ -808,7 +808,7 @@ pub fn outputs_view<'a>( .into() }, )) - .style(theme::Container::Card(theme::Card::Simple)), + .style(theme::card::simple), ) } else { None @@ -850,12 +850,12 @@ fn input_view<'a>( Row::new() .align_y(Alignment::Center) .spacing(5) - .push(p1_bold("Outpoint:").style(color::GREY_3)) - .push(p2_regular(outpoint.clone()).style(color::GREY_3)) + .push(p1_bold("Outpoint:").color(color::GREY_3)) + .push(p2_regular(outpoint.clone()).color(color::GREY_3)) .push( - Button::new(icon::clipboard_icon().style(color::GREY_3)) + Button::new(icon::clipboard_icon().color(color::GREY_3)) .on_press(Message::Clipboard(outpoint.clone())) - .style(theme::Button::TransparentBorder), + .style(theme::button::transparent_border), ), ) .push_maybe(coin.map(|c| { @@ -868,12 +868,12 @@ fn input_view<'a>( .align_y(Alignment::Center) .width(Length::Fill) .spacing(5) - .push(p1_bold("Address:").style(color::GREY_3)) - .push(p2_regular(addr.clone()).style(color::GREY_3)) + .push(p1_bold("Address:").color(color::GREY_3)) + .push(p2_regular(addr.clone()).color(color::GREY_3)) .push( - Button::new(icon::clipboard_icon().style(color::GREY_3)) + Button::new(icon::clipboard_icon().color(color::GREY_3)) .on_press(Message::Clipboard(addr)) - .style(theme::Button::TransparentBorder), + .style(theme::button::transparent_border), ), ) })) @@ -887,8 +887,8 @@ fn input_view<'a>( .align_y(Alignment::Center) .width(Length::Fill) .spacing(5) - .push(p1_bold("Address label:").style(color::GREY_3)) - .push(p2_regular(label).style(color::GREY_3)), + .push(p1_bold("Address label:").color(color::GREY_3)) + .push(p2_regular(label).color(color::GREY_3)), ) }) })), @@ -949,12 +949,12 @@ fn payment_view<'a>( .align_y(Alignment::Center) .width(Length::Fill) .spacing(5) - .push(p1_bold("Address:").style(color::GREY_3)) - .push(p2_regular(addr.clone()).style(color::GREY_3)) + .push(p1_bold("Address:").color(color::GREY_3)) + .push(p2_regular(addr.clone()).color(color::GREY_3)) .push( - Button::new(icon::clipboard_icon().style(color::GREY_3)) + Button::new(icon::clipboard_icon().color(color::GREY_3)) .on_press(Message::Clipboard(addr.clone())) - .style(theme::Button::TransparentBorder), + .style(theme::button::transparent_border), ), ), ) @@ -967,8 +967,8 @@ fn payment_view<'a>( .align_y(Alignment::Center) .width(Length::Fill) .spacing(5) - .push(p1_bold("Address label:").style(color::GREY_3)) - .push(p2_regular(label).style(color::GREY_3)), + .push(p1_bold("Address label:").color(color::GREY_3)) + .push(p2_regular(label).color(color::GREY_3)), ) })) })) @@ -996,12 +996,12 @@ fn change_view(output: &TxOut, network: Network) -> Element { .align_y(Alignment::Center) .width(Length::Fill) .spacing(5) - .push(p1_bold("Address:").style(color::GREY_3)) - .push(p2_regular(addr.clone()).style(color::GREY_3)) + .push(p1_bold("Address:").color(color::GREY_3)) + .push(p2_regular(addr.clone()).color(color::GREY_3)) .push( - Button::new(icon::clipboard_icon().style(color::GREY_3)) + Button::new(icon::clipboard_icon().color(color::GREY_3)) .on_press(Message::Clipboard(addr)) - .style(theme::Button::TransparentBorder), + .style(theme::button::transparent_border), ), ), ) @@ -1051,7 +1051,7 @@ pub fn sign_action<'a>( }) .on_press(Message::Spend(SpendTxMessage::SelectHotSigner)) .padding(10) - .style(theme::Button::Border) + .style(theme::button::border) .width(Length::Fill) })) .width(Length::Fill), @@ -1166,7 +1166,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::GREEN), + text("Spend transaction is updated").color(color::GREEN), )) .padding(50), ) diff --git a/liana-gui/src/app/view/psbts.rs b/liana-gui/src/app/view/psbts.rs index 3e4f7f22d..8ca3dd9a6 100644 --- a/liana-gui/src/app/view/psbts.rs +++ b/liana-gui/src/app/view/psbts.rs @@ -51,7 +51,7 @@ pub fn import_psbt_view<'a>( pub fn import_psbt_success_view<'a>() -> Element<'a, Message> { Column::new() .push( - card::simple(Container::new(text("PSBT is imported").style(color::GREEN))).padding(50), + card::simple(Container::new(text("PSBT is imported").color(color::GREEN))).padding(50), ) .width(Length::Fixed(400.0)) .align_x(Alignment::Center) @@ -118,9 +118,9 @@ fn spend_tx_list_view(i: usize, tx: &SpendTx) -> Element<'_, Message> { }, sigs.threshold )) - .style(color::GREY_3), + .color(color::GREY_3), ) - .push(icon::key_icon().style(color::GREY_3)), + .push(icon::key_icon().color(color::GREY_3)), ) }) .push_maybe( @@ -159,8 +159,8 @@ fn spend_tx_list_view(i: usize, tx: &SpendTx) -> Element<'_, Message> { ) .padding(10) .on_press(Message::Select(i)) - .style(theme::Button::TransparentBorder), + .style(theme::button::transparent_border), ) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) .into() } diff --git a/liana-gui/src/app/view/receive.rs b/liana-gui/src/app/view/receive.rs index a7debe0e9..8f5a0a73f 100644 --- a/liana-gui/src/app/view/receive.rs +++ b/liana-gui/src/app/view/receive.rs @@ -85,7 +85,7 @@ pub fn receive<'a>( .push( p2_regular(addr) .small() - .style(color::GREY_3), + .color(color::GREY_3), ) // Space between the address and the scrollbar .push(Space::with_height( @@ -102,10 +102,10 @@ pub fn receive<'a>( ) .push( Button::new( - icon::clipboard_icon().style(color::GREY_3), + icon::clipboard_icon().color(color::GREY_3), ) .on_press(Message::Clipboard(address.to_string())) - .style(theme::Button::TransparentBorder), + .style(theme::button::transparent_border), ) .align_y(Alignment::Center), ) @@ -169,7 +169,7 @@ pub fn verify_address_modal<'a>( .on_press(Message::Clipboard( address.to_string(), )) - .style(theme::Button::TransparentBorder), + .style(theme::button::transparent_border), ) .width(Length::Shrink), ), diff --git a/liana-gui/src/app/view/recovery.rs b/liana-gui/src/app/view/recovery.rs index 61c811dfa..b141ca1c7 100644 --- a/liana-gui/src/app/view/recovery.rs +++ b/liana-gui/src/app/view/recovery.rs @@ -47,13 +47,13 @@ pub fn recovery<'a>( .align_y(Alignment::Center) .push( Button::new(text("Settings").size(30).bold()) - .style(theme::Button::Transparent) + .style(theme::button::transparent) .on_press(Message::Menu(Menu::Settings)), ) .push(icon::chevron_right().size(30)) .push( Button::new(text("Recovery").size(30).bold()) - .style(theme::Button::Transparent) + .style(theme::button::transparent) .on_press(Message::Menu(Menu::Recovery)), ), ) @@ -102,7 +102,7 @@ pub fn recovery<'a>( ))) .push(Column::with_children(recovery_paths).spacing(20)), ) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) .padding(20) }) .push_maybe(if no_recovery_paths { @@ -169,16 +169,16 @@ pub fn recovery_path_view<'a>( tooltip::Tooltip::new( Container::new(text(alias)) .padding(5) - .style(theme::Container::Pill(theme::Pill::Simple)), + .style(theme::pill::simple), liana_ui::widget::Text::new(fg.to_string()), tooltip::Position::Bottom, ) - .style(theme::Container::Card(theme::Card::Simple)), + .style(theme::card::simple), ) } else { Container::new(text(fg.to_string())) .padding(5) - .style(theme::Container::Pill(theme::Pill::Simple)) + .style(theme::pill::simple) }) }, )), diff --git a/liana-gui/src/app/view/settings.rs b/liana-gui/src/app/view/settings.rs index 6268f4014..aadebfd64 100644 --- a/liana-gui/src/app/view/settings.rs +++ b/liana-gui/src/app/view/settings.rs @@ -46,14 +46,14 @@ pub fn list(cache: &Cache, is_remote_backend: bool) -> Element { .width(Length::Fill) .push( Button::new(text("Settings").size(30).bold()) - .style(theme::Button::Transparent) + .style(theme::button::transparent) .on_press(Message::Menu(Menu::Settings))) .push( if !is_remote_backend { Container::new( Button::new( Row::new() - .push(badge::Badge::new(icon::bitcoin_icon())) + .push(badge::badge(icon::bitcoin_icon())) .push(text("Node").bold()) .padding(10) .spacing(20) @@ -61,16 +61,16 @@ pub fn list(cache: &Cache, is_remote_backend: bool) -> Element { .width(Length::Fill), ) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) .on_press(Message::Settings(SettingsMessage::EditBitcoindSettings)) ) .width(Length::Fill) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) } else { Container::new( Button::new( Row::new() - .push(badge::Badge::new(icon::bitcoin_icon())) + .push(badge::badge(icon::bitcoin_icon())) .push(text("Backend").bold()) .padding(10) .spacing(20) @@ -78,18 +78,18 @@ pub fn list(cache: &Cache, is_remote_backend: bool) -> Element { .width(Length::Fill), ) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) .on_press(Message::Settings(SettingsMessage::EditRemoteBackendSettings)) ) .width(Length::Fill) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) } ) .push( Container::new( Button::new( Row::new() - .push(badge::Badge::new(icon::wallet_icon())) + .push(badge::badge(icon::wallet_icon())) .push(text("Wallet").bold()) .padding(10) .spacing(20) @@ -97,17 +97,17 @@ pub fn list(cache: &Cache, is_remote_backend: bool) -> Element { .width(Length::Fill), ) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) .on_press(Message::Settings(SettingsMessage::EditWalletSettings)) ) .width(Length::Fill) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) ) .push( Container::new( Button::new( Row::new() - .push(badge::Badge::new(icon::recovery_icon())) + .push(badge::badge(icon::recovery_icon())) .push(text("Recovery").bold()) .push(tooltip("In case of loss of the main key, the recovery key can move the funds after a certain time.")) .padding(10) @@ -116,17 +116,17 @@ pub fn list(cache: &Cache, is_remote_backend: bool) -> Element { .width(Length::Fill), ) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) .on_press(Message::Menu(Menu::Recovery)) ) .width(Length::Fill) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) ) .push( Container::new( Button::new( Row::new() - .push(badge::Badge::new(icon::tooltip_icon())) + .push(badge::badge(icon::tooltip_icon())) .push(text("About").bold()) .padding(10) .spacing(20) @@ -134,11 +134,11 @@ pub fn list(cache: &Cache, is_remote_backend: bool) -> Element { .width(Length::Fill), ) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) .on_press(Message::Settings(SettingsMessage::AboutSection)) ) .width(Length::Fill) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) ) ) } @@ -159,13 +159,13 @@ pub fn bitcoind_settings<'a>( .align_y(Alignment::Center) .push( Button::new(text("Settings").size(30).bold()) - .style(theme::Button::Transparent) + .style(theme::button::transparent) .on_press(Message::Menu(Menu::Settings)), ) .push(icon::chevron_right().size(30)) .push( Button::new(text("Node").size(30).bold()) - .style(theme::Button::Transparent) + .style(theme::button::transparent) .on_press(Message::Settings(SettingsMessage::EditBitcoindSettings)), ), ) @@ -190,13 +190,13 @@ pub fn about_section<'a>( .align_y(Alignment::Center) .push( Button::new(text("Settings").size(30).bold()) - .style(theme::Button::Transparent) + .style(theme::button::transparent) .on_press(Message::Menu(Menu::Settings)), ) .push(icon::chevron_right().size(30)) .push( Button::new(text("About").size(30).bold()) - .style(theme::Button::Transparent) + .style(theme::button::transparent) .on_press(Message::Settings(SettingsMessage::AboutSection)), ), ) @@ -205,7 +205,7 @@ pub fn about_section<'a>( Column::new() .push( Row::new() - .push(badge::Badge::new(icon::tooltip_icon())) + .push(badge::badge(icon::tooltip_icon())) .push(text("Version").bold()) .padding(10) .spacing(20) @@ -249,13 +249,13 @@ pub fn remote_backend_section<'a>( .align_y(Alignment::Center) .push( Button::new(text("Settings").size(30).bold()) - .style(theme::Button::Transparent) + .style(theme::button::transparent) .on_press(Message::Menu(Menu::Settings)), ) .push(icon::chevron_right().size(30)) .push( Button::new(text("Backend").size(30).bold()) - .style(theme::Button::Transparent) + .style(theme::button::transparent) .on_press(Message::Settings( SettingsMessage::EditRemoteBackendSettings, )), @@ -279,7 +279,7 @@ pub fn remote_backend_section<'a>( .push( Row::new() .push_maybe(if success { - Some(text("Invitation was sent").style(color::GREEN)) + Some(text("Invitation was sent").color(color::GREEN)) } else { None }) @@ -318,7 +318,7 @@ pub fn bitcoind_edit<'a>( Row::new() .push( Row::new() - .push(badge::Badge::new(icon::network_icon())) + .push(badge::badge(icon::network_icon())) .push( Column::new() .push(text("Network:")) @@ -329,7 +329,7 @@ pub fn bitcoind_edit<'a>( ) .push( Row::new() - .push(badge::Badge::new(icon::block_icon())) + .push(badge::badge(icon::block_icon())) .push( Column::new() .push(text("Block Height:")) @@ -423,7 +423,7 @@ pub fn bitcoind_edit<'a>( Column::new() .push( Row::new() - .push(badge::Badge::new(icon::bitcoin_icon())) + .push(badge::badge(icon::bitcoin_icon())) .push(text("Bitcoin Core").bold()) .padding(10) .spacing(20) @@ -464,7 +464,7 @@ pub fn bitcoind<'a>( Row::new() .push( Row::new() - .push(badge::Badge::new(icon::network_icon())) + .push(badge::badge(icon::network_icon())) .push( Column::new() .push(text("Network:")) @@ -475,7 +475,7 @@ pub fn bitcoind<'a>( ) .push( Row::new() - .push(badge::Badge::new(icon::block_icon())) + .push(badge::badge(icon::block_icon())) .push( Column::new() .push(text("Block Height:")) @@ -516,7 +516,7 @@ pub fn bitcoind<'a>( .push(Space::with_width(10)) .push( Button::new(icon::clipboard_icon()) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) .on_press(SettingsEditMessage::Clipboard(v.to_string())), ) .align_y(Alignment::Center) @@ -529,7 +529,7 @@ pub fn bitcoind<'a>( Row::new() .push( Row::new() - .push(badge::Badge::new(icon::bitcoin_icon())) + .push(badge::badge(icon::bitcoin_icon())) .push(text("Bitcoin Core").bold()) .push_maybe(if is_configured_node_type { Some(is_running_label(is_running)) @@ -542,10 +542,10 @@ pub fn bitcoind<'a>( ) .push(if can_edit { Button::new(icon::pencil_icon()) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) .on_press(SettingsEditMessage::Select) } else { - Button::new(icon::pencil_icon()).style(theme::Button::TransparentBorder) + Button::new(icon::pencil_icon()).style(theme::button::transparent_border) }) .align_y(Alignment::Center), ) @@ -571,7 +571,7 @@ pub fn electrum_edit<'a>( Row::new() .push( Row::new() - .push(badge::Badge::new(icon::network_icon())) + .push(badge::badge(icon::network_icon())) .push( Column::new() .push(text("Network:")) @@ -582,7 +582,7 @@ pub fn electrum_edit<'a>( ) .push( Row::new() - .push(badge::Badge::new(icon::block_icon())) + .push(badge::badge(icon::block_icon())) .push( Column::new() .push(text("Block Height:")) @@ -621,7 +621,7 @@ pub fn electrum_edit<'a>( Column::new() .push( Row::new() - .push(badge::Badge::new(icon::bitcoin_icon())) + .push(badge::badge(icon::bitcoin_icon())) .push(text("Electrum").bold()) .padding(10) .spacing(20) @@ -662,7 +662,7 @@ pub fn electrum<'a>( Row::new() .push( Row::new() - .push(badge::Badge::new(icon::network_icon())) + .push(badge::badge(icon::network_icon())) .push( Column::new() .push(text("Network:")) @@ -673,7 +673,7 @@ pub fn electrum<'a>( ) .push( Row::new() - .push(badge::Badge::new(icon::block_icon())) + .push(badge::badge(icon::block_icon())) .push( Column::new() .push(text("Block Height:")) @@ -701,7 +701,7 @@ pub fn electrum<'a>( .push(Space::with_width(10)) .push( Button::new(icon::clipboard_icon()) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) .on_press(SettingsEditMessage::Clipboard(v.to_string())), ) .align_y(Alignment::Center), @@ -714,7 +714,7 @@ pub fn electrum<'a>( Row::new() .push( Row::new() - .push(badge::Badge::new(icon::bitcoin_icon())) + .push(badge::badge(icon::bitcoin_icon())) .push(text("Electrum").bold()) .push_maybe(if is_configured_node_type { Some(is_running_label(is_running)) @@ -727,10 +727,10 @@ pub fn electrum<'a>( ) .push(if can_edit { Button::new(icon::pencil_icon()) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) .on_press(SettingsEditMessage::Select) } else { - Button::new(icon::pencil_icon()).style(theme::Button::TransparentBorder) + Button::new(icon::pencil_icon()).style(theme::button::transparent_border) }) .align_y(Alignment::Center), ) @@ -747,15 +747,15 @@ pub fn is_running_label<'a, T: 'a>(is_running: Option) -> Container<'a, T> if running { Container::new( Row::new() - .push(icon::dot_icon().size(5).style(color::GREEN)) - .push(text("Running").small().style(color::GREEN)) + .push(icon::dot_icon().size(5).color(color::GREEN)) + .push(text("Running").small().color(color::GREEN)) .align_y(Alignment::Center), ) } else { Container::new( Row::new() - .push(icon::dot_icon().size(5).style(color::RED)) - .push(text("Not running").small().style(color::RED)) + .push(icon::dot_icon().size(5).color(color::RED)) + .push(text("Not running").small().color(color::RED)) .align_y(Alignment::Center), ) } @@ -781,10 +781,10 @@ pub fn rescan<'a>( Column::new() .push( Row::new() - .push(badge::Badge::new(icon::block_icon())) + .push(badge::badge(icon::block_icon())) .push(text("Blockchain rescan").bold().width(Length::Fill)) .push_maybe(if success { - Some(text("Successfully rescanned the blockchain").style(color::GREEN)) + Some(text("Successfully rescanned the blockchain").color(color::GREEN)) } else { None }) @@ -834,20 +834,20 @@ pub fn rescan<'a>( .spacing(10), ) .push_maybe(if invalid_date { - Some(p1_regular("Provided date is invalid").style(color::RED)) + Some(p1_regular("Provided date is invalid").color(color::RED)) } else { None }) .push_maybe(if past_possible_height { Some( p1_regular("Provided date earlier than the node prune height") - .style(color::RED), + .color(color::RED), ) } else { None }) .push_maybe(if future_date { - Some(p1_regular("Provided date is in the future").style(color::RED)) + Some(p1_regular("Provided date is in the future").color(color::RED)) } else { None }) @@ -913,13 +913,13 @@ pub fn wallet_settings<'a>( .align_y(Alignment::Center) .push( Button::new(text("Settings").size(30).bold()) - .style(theme::Button::Transparent) + .style(theme::button::transparent) .on_press(Message::Menu(Menu::Settings)), ) .push(icon::chevron_right().size(30)) .push( Button::new(text("Wallet").size(30).bold()) - .style(theme::Button::Transparent) + .style(theme::button::transparent) .on_press(Message::Settings(SettingsMessage::EditWalletSettings)), ), ) @@ -1000,8 +1000,8 @@ pub fn wallet_settings<'a>( Some( Row::new() .align_y(Alignment::Center) - .push(icon::circle_check_icon().style(color::GREEN)) - .push(text("Updated").style(color::GREEN)), + .push(icon::circle_check_icon().color(color::GREEN)) + .push(text("Updated").color(color::GREEN)), ) } else { None @@ -1063,7 +1063,7 @@ fn display_policy( text(k.to_string()), iced_tooltip::Position::Bottom, ) - .style(theme::Container::Card(theme::Card::Simple)), + .style(theme::card::simple), ) } else { Container::new(text(format!("[{}]", k)).bold()) @@ -1116,7 +1116,7 @@ fn display_policy( text(k.to_string()), iced_tooltip::Position::Bottom, ) - .style(theme::Container::Card(theme::Card::Simple)), + .style(theme::card::simple), ) } else { Container::new(text(format!("[{}]", k)).bold()) diff --git a/liana-gui/src/app/view/spend/mod.rs b/liana-gui/src/app/view/spend/mod.rs index 3c678dcf7..9100f6a86 100644 --- a/liana-gui/src/app/view/spend/mod.rs +++ b/liana-gui/src/app/view/spend/mod.rs @@ -57,8 +57,8 @@ pub fn spend_view<'a>( col.push( Row::new() .spacing(5) - .push(icon::warning_icon().style(color::ORANGE)) - .push(text(warning).style(color::ORANGE)), + .push(icon::warning_icon().color(color::ORANGE)) + .push(text(warning).color(color::ORANGE)), ) }, )) @@ -154,7 +154,7 @@ pub fn create_spend_tx<'a>( Some( Container::new( text("Two payment addresses are the same") - .style(color::RED), + .color(color::RED), ) .padding(10), ) @@ -226,7 +226,7 @@ pub fn create_spend_tx<'a>( ), P2_SIZE, )) - .push(p2_regular("selected").style(color::GREY_3)) + .push(p2_regular("selected").color(color::GREY_3)) } else if let Some(amount_left) = amount_left { if amount_left.to_sat() == 0 && !is_valid { // If amount left is set, the current configuration must be redraftable. @@ -237,20 +237,20 @@ pub fn create_spend_tx<'a>( // and it has the max selected. Row::new().push( text("Select at least one coin.") - .style(color::GREY_3), + .color(color::GREY_3), ) } else { // There must be a recipient with max selected and value 0. Row::new().push( text("Check max amount for recipient.") - .style(color::GREY_3), + .color(color::GREY_3), ) } } else { Row::new() .spacing(5) .push(amount_with_size(amount_left, P2_SIZE)) - .push(p2_regular("left to select").style(color::GREY_3)) + .push(p2_regular("left to select").color(color::GREY_3)) } } else { Row::new().push( @@ -259,7 +259,7 @@ pub fn create_spend_tx<'a>( } else { "Add recipient details." }) - .style(color::GREY_3), + .color(color::GREY_3), ) }) .width(Length::Fill), @@ -282,7 +282,7 @@ pub fn create_spend_tx<'a>( ), ) .padding(20) - .style(theme::Card::Simple), + .style(theme::card::simple), ) .push( Row::new() @@ -325,7 +325,7 @@ pub fn recipient_view<'a>( .push( Row::new().push(Space::with_width(Length::Fill)).push( Button::new(icon::cross_icon()) - .style(theme::Button::Transparent) + .style(theme::button::transparent) .on_press(CreateSpendMessage::DeleteRecipient(index)) .width(Length::Shrink), ), @@ -384,7 +384,7 @@ pub fn recipient_view<'a>( .map(amount_as_string) .unwrap_or(amount.value.clone()); Some( - Container::new(text(amount_txt).size(P1_SIZE).style(color::GREY_2)) + Container::new(text(amount_txt).size(P1_SIZE).color(color::GREY_2)) .padding(10) .width(Length::Fill), ) @@ -414,7 +414,7 @@ pub fn recipient_view<'a>( ), ) .padding(20) - .style(theme::Card::Simple) + .style(theme::card::simple) .into() } @@ -445,7 +445,7 @@ fn coin_list_view<'a>( // It is not possible to know if a coin is a // change coin or not so for now, From is // enough - p1_regular("From").style(color::GREY_3), + p1_regular("From").color(color::GREY_3), ) .push(p1_regular(label)), ) diff --git a/liana-gui/src/app/view/transactions.rs b/liana-gui/src/app/view/transactions.rs index 9dd29f72d..6f212d886 100644 --- a/liana-gui/src/app/view/transactions.rs +++ b/liana-gui/src/app/view/transactions.rs @@ -71,7 +71,7 @@ pub fn transactions_view<'a>( ) .width(Length::Fill) .padding(15) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) .on_press_maybe(if !processing { Some(Message::Next) } else { @@ -79,7 +79,7 @@ pub fn transactions_view<'a>( }), ) .width(Length::Fill) - .style(theme::Container::Card(theme::Card::Simple)), + .style(theme::card::simple), ) } else { None @@ -119,7 +119,7 @@ fn tx_list_view(i: usize, tx: &HistoryTransaction) -> Element<'_, Message> { .format("%b. %d, %Y - %T") .to_string(), ) - .style(color::GREY_3) + .color(color::GREY_3) .small(), ) })), @@ -158,9 +158,9 @@ fn tx_list_view(i: usize, tx: &HistoryTransaction) -> Element<'_, Message> { ) .padding(10) .on_press(Message::Select(i)) - .style(theme::Button::TransparentBorder), + .style(theme::button::transparent_border), ) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) .into() } @@ -236,9 +236,9 @@ pub fn create_rbf_modal<'a>( .align_y(Alignment::Center) .push(text(txid.to_string())) .push( - Button::new(icon::clipboard_icon().style(color::GREY_3)) + Button::new(icon::clipboard_icon().color(color::GREY_3)) .on_press(Message::Clipboard(txid.to_string())) - .style(theme::Button::TransparentBorder), + .style(theme::button::transparent_border), ), ) }, @@ -273,10 +273,10 @@ pub fn create_rbf_modal<'a>( Row::new() .spacing(10) .align_y(Alignment::Center) - .push(icon::circle_check_icon().style(color::GREEN)) + .push(icon::circle_check_icon().color(color::GREEN)) .push( text("Replacement PSBT created successfully and ready to be signed") - .style(color::GREEN), + .color(color::GREEN), ) })) .push_maybe(replacement_txid.map(|id| { @@ -341,7 +341,7 @@ pub fn tx_view<'a>( .push_maybe(tx.fee_amount.map(|fee_amount| { Row::new() .align_y(Alignment::Center) - .push(h3("Miner fee: ").style(color::GREY_3)) + .push(h3("Miner fee: ").color(color::GREY_3)) .push(amount_with_size(&fee_amount, H3_SIZE)) .push(text(" ").size(H3_SIZE)) .push( @@ -350,7 +350,7 @@ pub fn tx_view<'a>( fee_amount.to_sat() / tx.tx.vsize() as u64 )) .size(H4_SIZE) - .style(color::GREY_3), + .color(color::GREY_3), ) })), ), @@ -403,7 +403,7 @@ pub fn tx_view<'a>( .push( Button::new(icon::clipboard_icon()) .on_press(Message::Clipboard(txid.clone())) - .style(theme::Button::TransparentBorder), + .style(theme::button::transparent_border), ) .width(Length::Shrink), ), diff --git a/liana-gui/src/installer/view/editor/mod.rs b/liana-gui/src/installer/view/editor/mod.rs index e6330ad3a..bee354fe1 100644 --- a/liana-gui/src/installer/view/editor/mod.rs +++ b/liana-gui/src/installer/view/editor/mod.rs @@ -75,7 +75,7 @@ pub fn define_descriptor_advanced_settings<'a>(use_taproot: bool) -> Element<'a, .push_maybe(if use_taproot { Some( p1_regular("Taproot is only supported by Liana version 5.0 and above") - .style(color::GREY_2), + .color(color::GREY_2), ) } else { None @@ -124,7 +124,7 @@ pub fn path( }), ) .padding(10) - .style(theme::Container::Card(theme::Card::Border)) + .style(theme::card::border) .into() } @@ -139,7 +139,7 @@ pub fn uneditable_defined_key<'a>( .spacing(10) .width(Length::Fill) .align_y(Alignment::Center) - .push(icon::round_key_icon().size(H3_SIZE).style(color)) + .push(icon::round_key_icon().size(H3_SIZE).color(color)) .push( Column::new() .width(Length::Fill) @@ -147,13 +147,13 @@ pub fn uneditable_defined_key<'a>( .push( Row::new() .spacing(10) - .push(p1_regular(title).style(color::GREY_2)) + .push(p1_regular(title).color(color::GREY_2)) .push(p1_bold(alias)), ) - .push_maybe(warning.map(|w| p2_regular(w).style(color::RED))), + .push_maybe(warning.map(|w| p2_regular(w).color(color::RED))), ) .push_maybe(if warning.is_none() { - Some(icon::check_icon().style(color::GREEN)) + Some(icon::check_icon().color(color::GREEN)) } else { None }), @@ -173,7 +173,7 @@ pub fn defined_key<'a>( .spacing(10) .width(Length::Fill) .align_y(Alignment::Center) - .push(icon::round_key_icon().size(H3_SIZE).style(color)) + .push(icon::round_key_icon().size(H3_SIZE).color(color)) .push( Column::new() .width(Length::Fill) @@ -181,13 +181,13 @@ pub fn defined_key<'a>( .push( Row::new() .spacing(10) - .push(p1_regular(title).style(color::GREY_2)) + .push(p1_regular(title).color(color::GREY_2)) .push(p1_bold(alias)), ) - .push_maybe(warning.map(|w| p2_regular(w).style(color::RED))), + .push_maybe(warning.map(|w| p2_regular(w).color(color::RED))), ) .push_maybe(if warning.is_none() { - Some(icon::check_icon().style(color::GREEN)) + Some(icon::check_icon().color(color::GREEN)) } else { None }) @@ -200,7 +200,7 @@ pub fn defined_key<'a>( } else { Some( Button::new(icon::trash_icon()) - .style(theme::Button::Secondary) + .style(theme::button::secondary) .padding(5) .on_press(message::DefineKey::Delete), ) @@ -220,7 +220,7 @@ pub fn undefined_key<'a>( .spacing(10) .width(Length::Fill) .align_y(Alignment::Center) - .push(icon::round_key_icon().size(H3_SIZE).style(color)) + .push(icon::round_key_icon().size(H3_SIZE).color(color)) .push( Column::new() .width(Length::Fill) @@ -240,7 +240,7 @@ pub fn undefined_key<'a>( } else { Some( Button::new(icon::trash_icon()) - .style(theme::Button::Secondary) + .style(theme::button::secondary) .padding(5) .on_press(message::DefineKey::Delete), ) @@ -294,7 +294,7 @@ pub fn edit_key_modal<'a>( }) .width(Length::Fill) .on_press(Message::UseHotSigner) - .style(theme::Button::Border), + .style(theme::button::border), ) .push(if manually_imported_xpub { card::simple(Column::new() @@ -339,7 +339,7 @@ pub fn edit_key_modal<'a>( .on_press(Message::DefineDescriptor( message::DefineDescriptor::KeyModal(message::ImportKeyModal::ManuallyImportXpub) )) - .style(theme::Button::Secondary), + .style(theme::button::secondary), ) } ) @@ -355,7 +355,7 @@ pub fn edit_key_modal<'a>( .push(text("Key name:").bold()) .push(tooltip(prompt::DEFINE_DESCRIPTOR_FINGERPRINT_TOOLTIP)), ) - .push(p1_regular("Give this key a friendly name. It helps you identify it later").style(color::GREY_2)) + .push(p1_regular("Give this key a friendly name. It helps you identify it later").color(color::GREY_2)) .push( form::Form::new("Name", form_name, |msg| { Message::DefineDescriptor(message::DefineDescriptor::KeyModal( @@ -372,7 +372,7 @@ pub fn edit_key_modal<'a>( ) .push_maybe( if duplicate_master_fg { - Some(text("A single signing device may not be used more than once per path. (It can still be used in other paths.)").style(color::RED)) + Some(text("A single signing device may not be used more than once per path. (It can still be used in other paths.)").color(color::RED)) } else { None } @@ -592,7 +592,7 @@ mod threshsold_input { fn view(&self, _state: &Self::State) -> Element { let button = |label, on_press| { Button::new(label) - .style(theme::Button::Transparent) + .style(theme::button::transparent) .width(Length::Fixed(50.0)) .on_press(on_press) }; diff --git a/liana-gui/src/installer/view/editor/template/custom.rs b/liana-gui/src/installer/view/editor/template/custom.rs index bb7da333a..8c0828270 100644 --- a/liana-gui/src/installer/view/editor/template/custom.rs +++ b/liana-gui/src/installer/view/editor/template/custom.rs @@ -30,12 +30,12 @@ pub fn custom_template_description(progress: (usize, usize)) -> Element<'static, .max_width(800.0) .push(Container::new( p1_regular("For this setup you will need to define your primary and recovery spending policies. For security reasons, we suggest you use a separate Hardware Wallet for each key belonging to them.") - .style(color::GREY_2) + .color(color::GREY_2) .horizontal_alignment(alignment::Horizontal::Left) ).align_x(alignment::Horizontal::Left).width(Length::Fill)) .push(Container::new( p1_regular("The keys belonging to your primary policy can always spend. Those belonging to the recovery policies will be able to spend only after a defined time of wallet inactivity, allowing for secure recovery and advanced spending policies.") - .style(color::GREY_2) + .color(color::GREY_2) .horizontal_alignment(alignment::Horizontal::Left) ).align_x(alignment::Horizontal::Left).width(Length::Fill)) .push(image::custom_template_description().width(Length::Fill)) @@ -77,7 +77,7 @@ pub fn custom_template<'a>( .push(text("Advanced settings").small().bold()) .push(icon::collapse_icon()), ) - .style(theme::Button::Transparent) + .style(theme::button::transparent) }, || { Button::new( @@ -87,7 +87,7 @@ pub fn custom_template<'a>( .push(text("Advanced settings").small().bold()) .push(icon::collapsed_icon()), ) - .style(theme::Button::Transparent) + .style(theme::button::transparent) }, move || define_descriptor_advanced_settings(use_taproot), )) diff --git a/liana-gui/src/installer/view/editor/template/inheritance.rs b/liana-gui/src/installer/view/editor/template/inheritance.rs index ad393e0fd..58bc445de 100644 --- a/liana-gui/src/installer/view/editor/template/inheritance.rs +++ b/liana-gui/src/installer/view/editor/template/inheritance.rs @@ -31,7 +31,7 @@ pub fn inheritance_template_description(progress: (usize, usize)) -> Element<'st .max_width(800.0) .push(Container::new( p1_regular("For this setup you will need 2 Keys: Your Primary Key (for yourself) and an Inheritance Key (for your heir). For security reasons, we suggest you use a separate Hardware Wallet for each key.") - .style(color::GREY_2) + .color(color::GREY_2) .horizontal_alignment(alignment::Horizontal::Left) ).align_x(alignment::Horizontal::Left).width(Length::Fill)) .push(Row::new() @@ -40,19 +40,19 @@ pub fn inheritance_template_description(progress: (usize, usize)) -> Element<'st Row::new() .align_y(Alignment::Center) .spacing(10) - .push(icon::round_key_icon().size(H3_SIZE).style(color::GREEN)) + .push(icon::round_key_icon().size(H3_SIZE).color(color::GREEN)) .push(p1_regular("Primary key").bold()) ).push( Row::new() .align_y(Alignment::Center) .spacing(10) - .push(icon::round_key_icon().size(H3_SIZE).style(color::WHITE)) + .push(icon::round_key_icon().size(H3_SIZE).color(color::WHITE)) .push(p1_regular("Inheritance key").bold()) )) .push(Container::new( p1_regular("You will always be able to spend using your Primary Key. After a period of inactivity (but not before that) your Inheritance Key will become able to recover your funds.") - .style(color::GREY_2) + .color(color::GREY_2) .horizontal_alignment(alignment::Horizontal::Left) ).align_x(alignment::Horizontal::Left).width(Length::Fill)) .push(image::inheritance_template_description().width(Length::Fill)) @@ -88,7 +88,7 @@ pub fn inheritance_template<'a>( .push(text("Advanced settings").small().bold()) .push(icon::collapse_icon()), ) - .style(theme::Button::Transparent) + .style(theme::button::transparent) }, || { Button::new( @@ -98,7 +98,7 @@ pub fn inheritance_template<'a>( .push(text("Advanced settings").small().bold()) .push(icon::collapsed_icon()), ) - .style(theme::Button::Transparent) + .style(theme::button::transparent) }, move || define_descriptor_advanced_settings(use_taproot), )) diff --git a/liana-gui/src/installer/view/editor/template/mod.rs b/liana-gui/src/installer/view/editor/template/mod.rs index d9894316d..33e3fd57c 100644 --- a/liana-gui/src/installer/view/editor/template/mod.rs +++ b/liana-gui/src/installer/view/editor/template/mod.rs @@ -27,7 +27,7 @@ pub fn choose_descriptor_template(progress: (usize, usize)) -> Element<'static, Column::new() .align_x(Alignment::Start) .push(h3("Simple inheritance")) - .push(p2_regular("Two keys required, one for yourself to spend and another for your heir.").style(color::GREY_2)) + .push(p2_regular("Two keys required, one for yourself to spend and another for your heir.").color(color::GREY_2)) .width(Length::Fill) ) .padding(15) @@ -35,7 +35,7 @@ pub fn choose_descriptor_template(progress: (usize, usize)) -> Element<'static, Message::SelectDescriptorTemplate( context::DescriptorTemplate::SimpleInheritance, ) - ).style(theme::Button::Secondary) + ).style(theme::button::secondary) .width(Length::Fill), ) .push( @@ -43,7 +43,7 @@ pub fn choose_descriptor_template(progress: (usize, usize)) -> Element<'static, Column::new() .align_x(Alignment::Start) .push(h3("Expanding multisig")) - .push(p2_regular("Two keys required to spend, with an extra key as a backup.").style(color::GREY_2)) + .push(p2_regular("Two keys required to spend, with an extra key as a backup.").color(color::GREY_2)) .width(Length::Fill) ) .padding(15) @@ -51,7 +51,7 @@ pub fn choose_descriptor_template(progress: (usize, usize)) -> Element<'static, Message::SelectDescriptorTemplate( context::DescriptorTemplate::MultisigSecurity, ) - ).style(theme::Button::Secondary) + ).style(theme::button::secondary) .width(Length::Fill), ) .push( @@ -59,7 +59,7 @@ pub fn choose_descriptor_template(progress: (usize, usize)) -> Element<'static, Column::new() .align_x(Alignment::Start) .push(h3("Build your own")) - .push(p2_regular("Create a custom setup that fits all your needs.").style(color::GREY_2)) + .push(p2_regular("Create a custom setup that fits all your needs.").color(color::GREY_2)) .width(Length::Fill) ) .padding(15) @@ -67,7 +67,7 @@ pub fn choose_descriptor_template(progress: (usize, usize)) -> Element<'static, Message::SelectDescriptorTemplate( context::DescriptorTemplate::Custom, ) - ).style(theme::Button::Secondary) + ).style(theme::button::secondary) .width(Length::Fill), ) .spacing(20), diff --git a/liana-gui/src/installer/view/editor/template/multisig_security_wallet.rs b/liana-gui/src/installer/view/editor/template/multisig_security_wallet.rs index 7d56e4ff2..3be92c27d 100644 --- a/liana-gui/src/installer/view/editor/template/multisig_security_wallet.rs +++ b/liana-gui/src/installer/view/editor/template/multisig_security_wallet.rs @@ -36,7 +36,7 @@ pub fn multisig_security_template_description( .max_width(800.0) .push(Container::new( p1_regular("For this setup you will need 3 keys: two Primary Keys and a Recovery Key. For security reasons, we suggest you use a separate Hardware Wallet for each key.") - .style(color::GREY_2) + .color(color::GREY_2) .horizontal_alignment(alignment::Horizontal::Left) ).align_x(alignment::Horizontal::Left).width(Length::Fill)) .push(Row::new() @@ -45,24 +45,24 @@ pub fn multisig_security_template_description( Row::new() .align_y(Alignment::Center) .spacing(10) - .push(icon::round_key_icon().size(H3_SIZE).style(color::GREEN)) + .push(icon::round_key_icon().size(H3_SIZE).color(color::GREEN)) .push(p1_regular("Primary key #1").bold()) ).push( Row::new() .align_y(Alignment::Center) .spacing(10) - .push(icon::round_key_icon().size(H3_SIZE).style(color::GREEN)) + .push(icon::round_key_icon().size(H3_SIZE).color(color::GREEN)) .push(p1_regular("Primary key #2").bold()) ).push( Row::new() .align_y(Alignment::Center) .spacing(10) - .push(icon::round_key_icon().size(H3_SIZE).style(color::ORANGE)) + .push(icon::round_key_icon().size(H3_SIZE).color(color::ORANGE)) .push(p1_regular("Recovery key").bold()) )) .push(Container::new( p1_regular("The Primary Keys will compose a 2-of-2 multisig which will always be able to spend. In case one of your keys becomes unavailable, after a period of inactivity you will be able to recover your funds using the Recovery Key together with one of your Primary Keys (2-of-3 multisig):") - .style(color::GREY_2) + .color(color::GREY_2) .horizontal_alignment(alignment::Horizontal::Left) ).align_x(alignment::Horizontal::Left).width(Length::Fill)) .push(image::multisig_security_template_description().width(Length::Fill)) @@ -99,7 +99,7 @@ pub fn multisig_security_template<'a>( .push(text("Advanced settings").small().bold()) .push(icon::collapse_icon()), ) - .style(theme::Button::Transparent) + .style(theme::button::transparent) }, || { Button::new( @@ -109,7 +109,7 @@ pub fn multisig_security_template<'a>( .push(text("Advanced settings").small().bold()) .push(icon::collapsed_icon()), ) - .style(theme::Button::Transparent) + .style(theme::button::transparent) }, move || define_descriptor_advanced_settings(use_taproot), )) diff --git a/liana-gui/src/installer/view/mod.rs b/liana-gui/src/installer/view/mod.rs index 9f52d7036..a6a6639d9 100644 --- a/liana-gui/src/installer/view/mod.rs +++ b/liana-gui/src/installer/view/mod.rs @@ -60,7 +60,7 @@ pub fn import_wallet_or_descriptor<'a>( for (i, wallet) in wallets.into_iter().enumerate() { col_wallets = col_wallets.push( Button::new(h5_regular(wallet).width(Length::Fill)) - .style(theme::Button::Secondary) + .style(theme::button::secondary) .padding(10) .on_press(Message::Select(i)), ); @@ -76,29 +76,29 @@ pub fn import_wallet_or_descriptor<'a>( Button::new( Column::new() .spacing(5) - .push(h4_bold("Load a shared wallet").style(color::WHITE)) + .push(h4_bold("Load a shared wallet").color(color::WHITE)) .push( text("If you received an invitation to join a shared wallet") - .style(color::GREY_3), + .color(color::GREY_3), ), ) .padding(15) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) }, || { Button::new( Column::new() .spacing(5) - .push(h4_bold("Load a shared wallet").style(color::WHITE)) + .push(h4_bold("Load a shared wallet").color(color::WHITE)) .push( text("Type the invitation token you received by email") - .style(color::GREY_3), + .color(color::GREY_3), ), ) .padding(15) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) }, move || { if let Some(wallet) = invitation_wallet { @@ -170,23 +170,23 @@ pub fn import_wallet_or_descriptor<'a>( Button::new( Column::new() .spacing(5) - .push(h4_bold("Load a wallet from descriptor").style(color::WHITE)) - .push(text("Creates a new wallet from the descriptor").style(color::GREY_3)), + .push(h4_bold("Load a wallet from descriptor").color(color::WHITE)) + .push(text("Creates a new wallet from the descriptor").color(color::GREY_3)), ) .padding(15) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) }, || { Button::new( Column::new() .spacing(5) - .push(h4_bold("Load a wallet from descriptor").style(color::WHITE)) - .push(text("Creates a new wallet from the descriptor").style(color::GREY_3)), + .push(h4_bold("Load a wallet from descriptor").color(color::WHITE)) + .push(text("Creates a new wallet from the descriptor").color(color::GREY_3)), ) .padding(15) .width(Length::Fill) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) }, move || { Element::<'a, Message>::from( @@ -319,14 +319,14 @@ pub fn signer_xpubs<'a>( Row::new().align_y(Alignment::Center).push( Column::new() .push(text("Generate a new mnemonic").bold()) - .push(text(BACKUP_WARNING).small().style(color::ORANGE)) + .push(text(BACKUP_WARNING).small().color(color::ORANGE)) .spacing(5) .width(Length::Fill), ), ) .on_press(Message::UseHotSigner) .padding(10) - .style(theme::Button::TransparentBorder) + .style(theme::button::transparent_border) .width(Length::Fill), ) .push_maybe(if xpubs.is_empty() { @@ -398,7 +398,7 @@ pub fn signer_xpubs<'a>( None }), ) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) .into() } @@ -448,7 +448,7 @@ pub fn hardware_wallet_xpubs<'a>( kind, pairing_code, .. } => hw::locked_hardware_wallet(kind, pairing_code.as_ref()), }) - .style(theme::Button::Secondary) + .style(theme::button::secondary) .width(Length::Fill); if !processing && hw.is_supported() { bttn = bttn.on_press(Message::Select(i)); @@ -489,7 +489,7 @@ pub fn hardware_wallet_xpubs<'a>( }) })), ) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) .into() } @@ -510,7 +510,7 @@ pub fn share_xpubs<'a>( .width(Length::Fill), ) .push_maybe(if hws.is_empty() { - Some(p1_regular("No signing device connected").style(color::GREY_3)) + Some(p1_regular("No signing device connected").color(color::GREY_3)) } else { None }) @@ -702,7 +702,7 @@ pub fn backup_descriptor<'a>( .push(text("Learn more").small().bold()) .push(icon::collapse_icon()), ) - .style(theme::Button::Transparent) + .style(theme::button::transparent) }, || { Button::new( @@ -712,7 +712,7 @@ pub fn backup_descriptor<'a>( .push(text("Learn more").small().bold()) .push(icon::collapsed_icon()), ) - .style(theme::Button::Transparent) + .style(theme::button::transparent) }, help_backup, )) @@ -803,7 +803,7 @@ fn display_policy( text(k.to_string()), iced_tooltip::Position::Bottom, ) - .style(theme::Container::Card(theme::Card::Simple)), + .style(theme::card::simple), ) } else { Container::new(text(format!("[{}]", k)).bold()) @@ -850,7 +850,7 @@ fn display_policy( text(k.to_string()), iced_tooltip::Position::Bottom, ) - .style(theme::Container::Card(theme::Card::Simple)), + .style(theme::card::simple), ) } else { Container::new(text(format!("[{}]", k)).bold()) @@ -976,16 +976,16 @@ pub fn define_bitcoin_node<'a>( Row::new() .spacing(10) .align_y(Alignment::Center) - .push(icon::circle_check_icon().style(color::GREEN)) - .push(text("Connection checked").style(color::GREEN)), + .push(icon::circle_check_icon().color(color::GREEN)) + .push(text("Connection checked").color(color::GREEN)), ) } else { Container::new( Row::new() .spacing(10) .align_y(Alignment::Center) - .push(icon::circle_cross_icon().style(color::RED)) - .push(text("Connection failed").style(color::RED)), + .push(icon::circle_cross_icon().color(color::RED)) + .push(text("Connection failed").color(color::RED)), ) } }) @@ -1059,7 +1059,7 @@ pub fn define_bitcoind<'a>( is not supported. Insert an IP address bound to the same machine \ running Liana (ignore this warning if that's already the case)", ) - .style(color::ORANGE) + .color(color::ORANGE) .size(text::CAPTION_SIZE), ) } else { @@ -1286,8 +1286,8 @@ pub fn start_internal_bitcoind<'a>( DownloadState::Finished(_) => Row::new() .spacing(10) .align_y(Alignment::Center) - .push(icon::circle_check_icon().style(color::GREEN)) - .push(text("Download complete").style(color::GREEN)), + .push(icon::circle_check_icon().color(color::GREEN)) + .push(text("Download complete").color(color::GREEN)), DownloadState::Downloading { progress } => Row::new() .spacing(10) .align_y(Alignment::Center) @@ -1297,8 +1297,8 @@ pub fn start_internal_bitcoind<'a>( DownloadState::Errored(e) => Row::new() .spacing(10) .align_y(Alignment::Center) - .push(icon::circle_cross_icon().style(color::RED)) - .push(text(format!("Download failed: '{}'.", e)).style(color::RED)), + .push(icon::circle_cross_icon().color(color::RED)) + .push(text(format!("Download failed: '{}'.", e)).color(color::RED)), _ => Row::new().spacing(10).align_y(Alignment::Center), } })) @@ -1311,20 +1311,20 @@ pub fn start_internal_bitcoind<'a>( InstallState::Finished => Row::new() .spacing(10) .align_y(Alignment::Center) - .push(icon::circle_check_icon().style(color::GREEN)) - .push(text("Installation complete").style(color::GREEN)), + .push(icon::circle_check_icon().color(color::GREEN)) + .push(text("Installation complete").color(color::GREEN)), InstallState::Errored(e) => Row::new() .spacing(10) .align_y(Alignment::Center) - .push(icon::circle_cross_icon().style(color::RED)) - .push(text(format!("Installation failed: '{}'.", e)).style(color::RED)), + .push(icon::circle_cross_icon().color(color::RED)) + .push(text(format!("Installation failed: '{}'.", e)).color(color::RED)), } } else if exe_path.is_some() { Row::new() .spacing(10) .align_y(Alignment::Center) - .push(icon::circle_check_icon().style(color::GREEN)) - .push(text("Liana-managed bitcoind already installed").style(color::GREEN)) + .push(icon::circle_check_icon().color(color::GREEN)) + .push(text("Liana-managed bitcoind already installed").color(color::GREEN)) } else if let Some(DownloadState::Downloading { progress }) = download_state { Row::new() .spacing(10) @@ -1340,17 +1340,17 @@ pub fn start_internal_bitcoind<'a>( Row::new() .spacing(10) .align_y(Alignment::Center) - .push(icon::circle_check_icon().style(color::GREEN)) - .push(text("Started").style(color::GREEN)), + .push(icon::circle_check_icon().color(color::GREEN)) + .push(text("Started").color(color::GREEN)), ) } else { Container::new( Row::new() .spacing(10) .align_y(Alignment::Center) - .push(icon::circle_cross_icon().style(color::RED)) + .push(icon::circle_cross_icon().color(color::RED)) .push( - text(res.as_ref().err().unwrap().to_string()).style(color::RED), + text(res.as_ref().err().unwrap().to_string()).color(color::RED), ), ) } @@ -1412,8 +1412,8 @@ pub fn install<'a>( Row::new() .spacing(10) .align_y(Alignment::Center) - .push(icon::circle_check_icon().style(color::GREEN)) - .push(text("Installed").style(color::GREEN)), + .push(icon::circle_check_icon().color(color::GREEN)) + .push(text("Installed").color(color::GREEN)), ) } else { Container::new(Space::with_height(Length::Fixed(25.0))) @@ -1436,7 +1436,7 @@ pub fn defined_threshold<'a>( .spacing(10) .push((0..threshold.1).fold(Row::new(), |row, i| { if i < threshold.0 { - row.push(icon::round_key_icon().style(color)) + row.push(icon::round_key_icon().color(color)) } else { row.push(icon::round_key_icon()) } @@ -1451,7 +1451,7 @@ pub fn defined_threshold<'a>( ) .padding(10) .on_press(message::DefinePath::EditThreshold) - .style(theme::Button::Secondary) + .style(theme::button::secondary) .into() } else { card::simple( @@ -1459,7 +1459,7 @@ pub fn defined_threshold<'a>( .spacing(10) .push((0..threshold.1).fold(Row::new(), |row, i| { if i < threshold.0 { - row.push(icon::round_key_icon().style(color)) + row.push(icon::round_key_icon().color(color)) } else { row.push(icon::round_key_icon()) } @@ -1492,7 +1492,7 @@ pub fn defined_sequence<'a>( .spacing(5) .push( text::p1_regular("Available after inactivity of ~") - .style(color::GREY_2), + .color(color::GREY_2), ) .push( Button::new( @@ -1521,7 +1521,7 @@ pub fn defined_sequence<'a>( )) .push(icon::pencil_icon()), ) - .style(theme::Button::Secondary) + .style(theme::button::secondary) .on_press(message::DefinePath::EditSequence), ), ) @@ -1531,14 +1531,14 @@ pub fn defined_sequence<'a>( ) } else { Row::new() - .push(p1_regular("Able to move the funds at any time.").style(color::GREY_2)) + .push(p1_regular("Able to move the funds at any time.").color(color::GREY_2)) .padding(5) }) .push_maybe(if duplicate_sequence { Some( text("No two recovery options may become available at the very same date.") .small() - .style(color::RED), + .color(color::RED), ) } else { None @@ -1614,14 +1614,14 @@ pub fn hw_list_view( kind, pairing_code, .. } => hw::locked_hardware_wallet(kind, pairing_code.as_ref()), }) - .style(theme::Button::Border) + .style(theme::button::container_border) .width(Length::Fill); if !processing && hw.is_supported() { bttn = bttn.on_press(Message::Select(i)); } Container::new(bttn) .width(Length::Fill) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) .into() } @@ -1666,14 +1666,14 @@ pub fn key_list_view<'a>( Some(name), ) }) - .style(theme::Button::Border) + .style(theme::button::secondary) .width(Length::Fill) .on_press(Message::DefineDescriptor( message::DefineDescriptor::KeyModal(message::ImportKeyModal::SelectKey(i)), )); Container::new(bttn) .width(Length::Fill) - .style(theme::Container::Card(theme::Card::Simple)) + .style(theme::card::simple) .into() } @@ -1744,7 +1744,7 @@ pub fn recover_mnemonic<'a>( suggestions.iter().fold(Row::new().spacing(5), |row, sugg| { row.push( Button::new(text(sugg)) - .style(theme::Button::Secondary) + .style(theme::button::secondary) .on_press(Message::MnemonicWord( current, sugg.to_string(), @@ -1775,7 +1775,7 @@ pub fn recover_mnemonic<'a>( .width(Length::Fixed(100.0)), ) .push_maybe(if *valid { - Some(icon::circle_check_icon().style(color::GREEN)) + Some(icon::circle_check_icon().color(color::GREEN)) } else { None }), @@ -1783,7 +1783,7 @@ pub fn recover_mnemonic<'a>( }, )) .push(Space::with_height(Length::Fixed(50.0))) - .push_maybe(error.map(|e| card::invalid(text(e).style(color::RED)))), + .push_maybe(error.map(|e| card::invalid(text(e).color(color::RED)))), ) } else { None @@ -1839,14 +1839,14 @@ pub fn choose_backend(progress: (usize, usize)) -> Element<'static, Message> { .spacing(20) .width(Length::FillPortion(1)) .push(h3("Use your own node")) - .push(text::p2_medium(LOCAL_WALLET_DESC).style(color::GREY_3)), + .push(text::p2_medium(LOCAL_WALLET_DESC).color(color::GREY_3)), ) .push( Column::new() .spacing(20) .width(Length::FillPortion(1)) .push(h3("Use Liana Connect")) - .push(text::p2_medium(REMOTE_BACKEND_DESC).style(color::GREY_3)), + .push(text::p2_medium(REMOTE_BACKEND_DESC).color(color::GREY_3)), ), ) .push( @@ -1907,8 +1907,8 @@ pub fn connection_step_enter_email<'a>( ) -> Element<'a, Message> { Column::new() .spacing(20) - .push_maybe(connection_error.map(|e| text(e.to_string()).style(color::ORANGE))) - .push_maybe(auth_error.map(|e| text(e.to_string()).style(color::ORANGE))) + .push_maybe(connection_error.map(|e| text(e.to_string()).color(color::ORANGE))) + .push_maybe(auth_error.map(|e| text(e.to_string()).color(color::ORANGE))) .push(text( "Enter the email you want to associate with the wallet:", )) @@ -1941,10 +1941,10 @@ pub fn connection_step_enter_otp<'a>( ) -> Element<'a, Message> { Column::new() .spacing(20) - .push(text(email).style(color::GREEN)) + .push(text(email).color(color::GREEN)) .push(text("An authentication token has been emailed to you")) - .push_maybe(connection_error.map(|e| text(e.to_string()).style(color::ORANGE))) - .push_maybe(auth_error.map(|e| text(e.to_string()).style(color::ORANGE))) + .push_maybe(connection_error.map(|e| text(e.to_string()).color(color::ORANGE))) + .push_maybe(auth_error.map(|e| text(e.to_string()).color(color::ORANGE))) .push( form::Form::new_trimmed("Token", otp, |msg| { Message::SelectBackend(message::SelectBackend::OTPEdited(msg)) @@ -1979,9 +1979,9 @@ pub fn connection_step_connected<'a>( ) -> Element<'a, Message> { Column::new() .spacing(20) - .push(text(email).style(color::GREEN)) - .push_maybe(connection_error.map(|e| text(e.to_string()).style(color::ORANGE))) - .push_maybe(auth_error.map(|e| text(e.to_string()).style(color::ORANGE))) + .push(text(email).color(color::GREEN)) + .push_maybe(connection_error.map(|e| text(e.to_string()).color(color::ORANGE))) + .push_maybe(auth_error.map(|e| text(e.to_string()).color(color::ORANGE))) .push(Container::new( Row::new() .spacing(10) @@ -2020,7 +2020,7 @@ fn layout<'a>( Column::new() .width(Length::Fill) .push(Row::new().push(Space::with_width(Length::Fill)).push_maybe( - email.map(|e| Container::new(p1_regular(e).style(color::GREEN)).padding(20)), + email.map(|e| Container::new(p1_regular(e).color(color::GREEN)).padding(20)), )) .push(Space::with_height(Length::Fixed(100.0))) .push( @@ -2062,6 +2062,6 @@ fn layout<'a>( .center_x(Length::Fill) .height(Length::Fill) .width(Length::Fill) - .style(theme::Container::Background) + .style(theme::container::background) .into() } diff --git a/liana-gui/src/launcher.rs b/liana-gui/src/launcher.rs index c7c6c9c40..f0b76242e 100644 --- a/liana-gui/src/launcher.rs +++ b/liana-gui/src/launcher.rs @@ -220,25 +220,25 @@ impl Launcher { ))) .push_maybe(checksum.as_ref().map(|checksum| { p1_regular(format!("Liana-{}", checksum)) - .style(color::GREY_3) + .color(color::GREY_3) })) .push_maybe(email.as_ref().map(|email| { Row::new() .push(Space::with_width(Length::Fill)) .push( p1_regular(email) - .style(color::GREEN), + .color(color::GREEN), ) })), ) .on_press(ViewMessage::Run) - .style(theme::Button::Border) + .style(theme::button::container_border) .padding(10) .width(Length::Fill), ) .push( Button::new(icon::trash_icon()) - .style(theme::Button::Secondary) + .style(theme::button::secondary) .padding(10) .on_press(ViewMessage::DeleteWallet( DeleteWalletMessage::ShowModal, @@ -261,7 +261,7 @@ impl Launcher { ) .push( p1_regular("Create a new Liana wallet") - .style(color::GREY_3), + .color(color::GREY_3), ) .push( button::secondary(None, "Select") @@ -287,7 +287,7 @@ impl Launcher { p1_regular( "Add an existing Liana wallet", ) - .style(color::GREY_3), + .color(color::GREY_3), ) .push( button::secondary(None, "Select") @@ -392,7 +392,7 @@ impl DeleteWalletModal { fn view(&self) -> Element { let mut confirm_button = button::secondary(None, "Delete wallet") .width(Length::Fixed(200.0)) - .style(theme::Button::Destructive); + .style(theme::button::destructive); if self.warning.is_none() { confirm_button = confirm_button.on_press(ViewMessage::DeleteWallet(DeleteWalletMessage::Confirm)); @@ -415,12 +415,12 @@ impl DeleteWalletModal { .spacing(10) .push(Container::new( h4_bold(format!("Delete configuration for {}", &self.network)) - .style(color::RED) + .color(color::RED) .width(Length::Fill), )) .push(Row::new().push(text(help_text_1))) .push_maybe( - help_text_2.map(|t| Row::new().push(p1_regular(t).style(color::GREY_3))), + help_text_2.map(|t| Row::new().push(p1_regular(t).color(color::GREY_3))), ) .push(Row::new()) .push(Row::new().push(text(help_text_3))) @@ -433,8 +433,8 @@ impl DeleteWalletModal { } else { Row::new() .spacing(10) - .push(icon::circle_check_icon().style(color::GREEN)) - .push(text("Wallet successfully deleted").style(color::GREEN)) + .push(icon::circle_check_icon().color(color::GREEN)) + .push(text("Wallet successfully deleted").color(color::GREEN)) }) .align_x(Horizontal::Center) .width(Length::Fill), diff --git a/liana-gui/src/lianalite/login.rs b/liana-gui/src/lianalite/login.rs index 72ab5af86..cb91e621d 100644 --- a/liana-gui/src/lianalite/login.rs +++ b/liana-gui/src/lianalite/login.rs @@ -391,7 +391,7 @@ impl LianaLiteLogin { .spacing(20) .push_maybe( self.auth_error - .map(|e| text(e).style(color::ORANGE)), + .map(|e| text(e).color(color::ORANGE)), ) .push( form::Form::new_trimmed("email", email, |msg| { @@ -412,7 +412,7 @@ impl LianaLiteLogin { .push(text("An authentication was send to your email")) .push_maybe( self.auth_error - .map(|e| text(e).style(color::ORANGE)), + .map(|e| text(e).color(color::ORANGE)), ) .spacing(20) .push(