From 881621f03b901198f47f31e44b1599f3dc75df06 Mon Sep 17 00:00:00 2001 From: Thomas Ballivet Date: Tue, 6 May 2025 20:32:40 +0200 Subject: [PATCH 1/3] Improve visibility of primary button text --- liana-ui/src/component/button.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/liana-ui/src/component/button.rs b/liana-ui/src/component/button.rs index 9d4e46ba..0d7769fd 100644 --- a/liana-ui/src/component/button.rs +++ b/liana-ui/src/component/button.rs @@ -1,16 +1,16 @@ +use super::text::text; +use crate::font::MEDIUM; use crate::{theme, widget::*}; use iced::alignment::{Horizontal, Vertical}; use iced::widget::{button, container, row}; -use super::text::text; - pub fn menu<'a, T: 'a>(icon: Option>, t: &'static str) -> Button<'a, T> { - button::Button::new(content_menu(icon.map(|i| i.style(theme::text::secondary)), t).padding(10)) + Button::new(content_menu(icon.map(|i| i.style(theme::text::secondary)), t).padding(10)) .style(theme::button::menu) } pub fn menu_active<'a, T: 'a>(icon: Option>, t: &'static str) -> Button<'a, T> { - button::Button::new(content_menu(icon.map(|i| i.style(theme::text::secondary)), t).padding(10)) + Button::new(content_menu(icon.map(|i| i.style(theme::text::secondary)), t).padding(10)) .style(theme::button::menu_pressed) } @@ -22,33 +22,33 @@ fn content_menu<'a, T: 'a>(icon: Option>, t: &'static str) -> Container } pub fn alert<'a, T: 'a>(icon: Option>, t: &'static str) -> Button<'a, T> { - button::Button::new(content(icon, t)).style(theme::button::destructive) + Button::new(content(icon, text(t))).style(theme::button::destructive) } pub fn primary<'a, T: 'a>(icon: Option>, t: &'static str) -> Button<'a, T> { - button::Button::new(content(icon, t)).style(theme::button::primary) + Button::new(content(icon, text(t).font(MEDIUM))).style(theme::button::primary) } pub fn transparent<'a, T: 'a>(icon: Option>, t: &'static str) -> Button<'a, T> { - button::Button::new(content(icon, t)).style(theme::button::container) + Button::new(content(icon, text(t))).style(theme::button::container) } pub fn secondary<'a, T: 'a>(icon: Option>, t: &'static str) -> Button<'a, T> { - button::Button::new(content(icon, t)).style(theme::button::secondary) + Button::new(content(icon, text(t))).style(theme::button::secondary) } pub fn border<'a, T: 'a>(icon: Option>, t: &'static str) -> Button<'a, T> { - button::Button::new(content(icon, t)).style(theme::button::secondary) + Button::new(content(icon, text(t))).style(theme::button::secondary) } pub fn transparent_border<'a, T: 'a>(icon: Option>, t: &'static str) -> Button<'a, T> { - button(content(icon, t)).style(theme::button::container_border) + button(content(icon, text(t))).style(theme::button::container_border) } -fn content<'a, T: 'a>(icon: Option>, t: &'static str) -> Container<'a, T> { +fn content<'a, T: 'a>(icon: Option>, text: Text<'a>) -> Container<'a, T> { match icon { - None => container(text(t)).align_x(Horizontal::Center).padding(5), - Some(i) => container(row![i, text(t)].spacing(10).align_y(Vertical::Center)) + None => container(text).align_x(Horizontal::Center).padding(5), + Some(i) => container(row![i, text].spacing(10).align_y(Vertical::Center)) .align_x(Horizontal::Center) .padding(5), } From 15f4dc1ed145e49f52576c0aaabd0608847c698f Mon Sep 17 00:00:00 2001 From: Thomas Ballivet Date: Tue, 6 May 2025 20:33:37 +0200 Subject: [PATCH 2/3] fix: set "Go to replacement" as primary --- liana-gui/src/app/view/transactions.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liana-gui/src/app/view/transactions.rs b/liana-gui/src/app/view/transactions.rs index fc373c2e..7116a0e6 100644 --- a/liana-gui/src/app/view/transactions.rs +++ b/liana-gui/src/app/view/transactions.rs @@ -291,7 +291,7 @@ pub fn create_rbf_modal<'a>( })) .push_maybe(replacement_txid.map(|id| { Row::new().push( - button::secondary(None, "Go to replacement") + button::primary(None, "Go to replacement") .width(Length::Fixed(200.0)) .on_press(Message::Menu(Menu::PsbtPreSelected(id))), ) From d2c6f9bb96fa01b8f590fb67f5fdb34eedeca45a Mon Sep 17 00:00:00 2001 From: Thomas Ballivet Date: Tue, 6 May 2025 20:36:21 +0200 Subject: [PATCH 3/3] fix: "Generate address" become secondary after generation --- liana-gui/src/app/view/receive.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/liana-gui/src/app/view/receive.rs b/liana-gui/src/app/view/receive.rs index 8b76314a..febd8ebf 100644 --- a/liana-gui/src/app/view/receive.rs +++ b/liana-gui/src/app/view/receive.rs @@ -108,10 +108,15 @@ pub fn receive<'a>( Row::new() .align_y(Alignment::Center) .push(Container::new(h3("Receive")).width(Length::Fill)) - .push( - button::primary(Some(icon::plus_icon()), "Generate address") - .on_press(Message::NextReceiveAddress), - ), + .push({ + let (icon, label) = (Some(icon::plus_icon()), "Generate address"); + if addresses.is_empty() { + button::primary(icon, label) + } else { + button::secondary(icon, label) + } + .on_press(Message::NextReceiveAddress) + }), ) .push(text("Always generate a new address for each deposit.")) .push(