gui: review primary buttons in the application

This commit is contained in:
Thomas Ballivet 2025-05-04 17:54:26 +02:00
parent 473dd425cc
commit 8e98f828a0
7 changed files with 23 additions and 18 deletions

View File

@ -63,6 +63,7 @@ fn coin_list_view<'a>(
let outpoint = coin.outpoint.to_string();
let address = coin.address.to_string();
let txid = coin.outpoint.txid.to_string();
let seq = remaining_sequence(coin, blockheight, timelock);
Container::new(
Column::new()
.push(
@ -120,7 +121,6 @@ fn coin_list_view<'a>(
} else if coin.block_height.is_none() {
badge::unconfirmed()
} else {
let seq = remaining_sequence(coin, blockheight, timelock);
coin_sequence_label(seq, timelock as u32)
})
.spacing(10)
@ -298,12 +298,18 @@ fn coin_list_view<'a>(
.spacing(5)
} else {
Column::new().push(
Row::new().push(Space::with_width(Length::Fill)).push(
button::secondary(Some(icon::arrow_repeat()), "Refresh coin")
.on_press(Message::Menu(Menu::RefreshCoins(vec![
coin.outpoint,
]))),
),
Row::new().push(Space::with_width(Length::Fill)).push({
let (icon, label) =
(Some(icon::arrow_repeat()), "Refresh coin");
let refresh_btn = if seq == 0 {
button::primary(icon, label)
} else {
button::secondary(icon, label)
};
refresh_btn.on_press(Message::Menu(Menu::RefreshCoins(vec![
coin.outpoint,
])))
}),
)
}),
)

View File

@ -174,10 +174,9 @@ pub fn home_view<'a>(
.width(Length::Fill),
)
.push(
button::secondary(Some(icon::arrow_repeat()), "Refresh coins")
.on_press(Message::Menu(Menu::RefreshCoins(
expiring_coins.to_owned(),
))),
button::primary(Some(icon::arrow_repeat()), "Refresh coins").on_press(
Message::Menu(Menu::RefreshCoins(expiring_coins.to_owned())),
),
),
)
.padding(25)

View File

@ -215,7 +215,7 @@ pub fn broadcast_action<'a>(
})
.push(
Row::new().push(Column::new().width(Length::Fill)).push(
button::secondary(None, "Broadcast")
button::primary(None, "Broadcast")
.on_press(Message::Spend(SpendTxMessage::Confirm)),
),
),
@ -383,13 +383,13 @@ pub fn spend_overview_view<'a>(
.push(Space::with_width(Length::Fill))
.push_maybe(if tx.path_ready().is_none() {
Some(
button::secondary(None, "Sign")
button::primary(None, "Sign")
.on_press(Message::Spend(SpendTxMessage::Sign))
.width(Length::Fixed(150.0)),
)
} else {
Some(
button::secondary(None, "Broadcast")
button::primary(None, "Broadcast")
.on_press(Message::Spend(SpendTxMessage::Broadcast))
.width(Length::Fixed(150.0)),
)

View File

@ -44,7 +44,7 @@ pub fn receive<'a>(
.align_y(Alignment::Center)
.push(Container::new(h3("Receive")).width(Length::Fill))
.push(
button::secondary(Some(icon::plus_icon()), "Generate address")
button::primary(Some(icon::plus_icon()), "Generate address")
.on_press(Message::Next),
),
)

View File

@ -75,7 +75,7 @@ pub fn recovery<'a>(
Row::new()
.push(Space::with_width(Length::Fill))
.push(
button::secondary(None, "Next")
button::primary(None, "Next")
.on_press_maybe(selected_path.map(|_| Message::Next))
.width(Length::Fixed(200.0)),
)

View File

@ -915,7 +915,7 @@ pub fn rescan<'a>(
&& is_ok_and(&u32::from_str(&day.value), |&v| v > 0 && v <= 31))
{
Row::new().push(Column::new().width(Length::Fill)).push(
button::secondary(None, "Start rescan")
button::primary(None, "Start rescan")
.on_press(SettingsEditMessage::Confirm)
.width(Length::Shrink),
)

View File

@ -334,7 +334,7 @@ pub fn create_spend_tx<'a>(
|| recovery_timelock.is_some()
|| Some(&Amount::from_sat(0)) == amount_left)
{
button::secondary(None, "Next")
button::primary(None, "Next")
.on_press(Message::CreateSpend(CreateSpendMessage::Generate))
.width(Length::Fixed(100.0))
} else {