Merge #1693: gui: review primary buttons in the application

8e98f828a0b61f6a2b2a988118e8557dd33f9d59 gui: review primary buttons in the application (Thomas Ballivet)

Pull request description:

  You can see below the updated GUI. If needed I can make the panel's "Broadcast" button secondary when the broadcast modal is displayed.

  ![Capture d’écran du 2025-05-04 18-04-02](https://github.com/user-attachments/assets/4737af03-c5c9-4bac-a215-3a008bc6a3f8)

  ![Capture d’écran du 2025-05-04 18-03-49](https://github.com/user-attachments/assets/d4bfc3ec-5aff-4957-8748-1171888daab7)

  ![Capture d’écran du 2025-05-04 17-51-13](https://github.com/user-attachments/assets/b7c1b069-0aa0-4c70-8c3e-3cee4636ec9f)

  ![Capture d’écran du 2025-05-04 17-46-38](https://github.com/user-attachments/assets/8c065795-9cf5-4e97-a2f2-8f2a654eba58)

  ![Capture d’écran du 2025-05-04 17-42-08](https://github.com/user-attachments/assets/750f7463-7aba-4287-8474-9f303926a6bf)

  ![Capture d’écran du 2025-05-04 17-41-33](https://github.com/user-attachments/assets/613ee1cc-beb6-4139-9f51-f4323d9224e6)

  ![Capture d’écran du 2025-05-04 17-38-52](https://github.com/user-attachments/assets/db04bfe1-77b6-418b-819a-04b208a9526c)

  ![Capture d’écran du 2025-05-04 17-38-38](https://github.com/user-attachments/assets/b3405548-363e-42cf-9471-26e5094d0fa1)

  ![Capture d’écran du 2025-05-04 17-37-02](https://github.com/user-attachments/assets/0451d4e8-fdbf-49ff-9a78-f9a245611aad)

ACKs for top commit:
  edouardparis:
    utACK 8e98f828a0b61f6a2b2a988118e8557dd33f9d59

Tree-SHA512: 80bed065f3eca6c92273aaa9fd62fd61f31121e14e66325efbcac3b95d2898f52982872debf4d8cf8238f2dd4f37d8858c644f240784888ea63b73a61d0cf487
This commit is contained in:
edouardparis 2025-05-05 10:41:25 +02:00
commit 13709aa302
No known key found for this signature in database
GPG Key ID: E65F7A089C20DC8F
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 {