Skip to content

Commit 949ea47

Browse files
Claudius-Maginificentlklimekclaude
authored
refactor(ui): unify action buttons to use ComponentStyles helpers (#708)
* fix(ui): improve dialog button visibility and add close-on-click-outside (#682) - Theme-aware secondary button colors: light mode uses warm gray fill, dark mode uses dark neutral fill, ensuring buttons are always visible against the dialog background - Extract DIALOG_BUTTON_MIN_SIZE constant (96×36) for consistent sizing - Add .strong() to all dialog button labels for better scannability - Add clicked_outside_window() utility in new modal_overlay module - Apply close-on-click-outside to all non-destructive/non-sensitive dialogs - Standardize WalletUnlockPopup Cancel button (was transparent, now themed) - Standardize WalletUnlockPopup button layout to right-to-left (primary right) - Update DataContractJsonPopup: primary Close button, DashColors constants, add Escape key handling - Project-wide pass: update ~12 ad-hoc dialogs across identities, wallets, contracts, tools, DPNS, DashPay, and tokens screens to use ComponentStyles - Add manual test scenarios document Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor(ui): replace ad-hoc identity removal dialog with ConfirmationDialog Replace hand-rolled egui::Window confirmation dialog in identities_screen with the shared ConfirmationDialog component. This ensures consistent button styling (theme-aware secondary buttons, danger mode) and behavior (Escape key, X button close) via the reusable component. Net reduction of 74 lines — all styling, overlay, and dismiss logic now handled by ConfirmationDialog. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ui): darken secondary button fill and text for better light-mode contrast Fill: (235,238,243) → (215,220,228) Text: (60,70,85) → (45,55,72) Stroke: (200,206,215) → (185,192,205) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ui): revert secondary button fill, keep darker text, darken border more Fill: reverted to (235,238,243) Text: kept at (45,55,72) Stroke: (185,192,205) → (170,178,192) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ui): align secondary button colors with default widget (column header) styling Secondary buttons now use the same fill/text/stroke as egui's default inactive widget style (used by column title buttons), ensuring visual consistency across the app. Light: fill (240,242,247), text (17,25,33), stroke (226,232,240) Dark: fill (18,18,18), text (240,240,240), stroke (60,60,60) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ui): ensure secondary button fill contrasts against dialog background Previous fill (240,242,247) was identical to window_fill, making buttons invisible on dialogs. New fill (218,222,230) is ~20 points darker. Light: fill (218,222,230), text BLACK, stroke (195,200,212) Dark: fill (50,52,58), text (240,240,240), stroke (72,75,82) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor(ui): replace ad-hoc dialogs with ConfirmationDialog in key_info and masternode_list_diff Replace custom confirmation dialog implementations with the shared ConfirmationDialog component for consistency and reduced duplication. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ui): extract button helpers, zeroize keys, add modal overlays, scope Enter key - Extract ComponentStyles::{primary,secondary,danger}_button() helpers, replacing ~38 copy-pasted button construction sites across 13 files - Use Zeroizing<String> for private key WIF in dialogs and asset lock screen - Replace .clear() with .zeroize() for SK wallet unlock password - Add modal overlay + click-outside-to-close to Send Dash, Reward Calculation, and Avatar popups - Scope Enter key confirmation to only fire when no widget has focus (ConfirmationDialog and InfoPopup) - Standardize button order: Cancel left, Action right across all dialogs - Add Cancel button to Send Dash confirmation dialog - Update manual test scenarios with correct RGB values and expanded coverage (5 → 13 dialog types) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ui): address PR review comments — Enter guard, ComboBox dismiss, alias ordering - Gate Enter-to-confirm on confirm_text.is_some() so hidden confirm buttons can't be triggered via keyboard - Add !combo_open guard to SelectionDialog outside-click handler, preventing ComboBox dropdown clicks from closing the dialog - Add outside-click dismissal to Token Configuration Details and Select Properties popups - Reorder alias rename: persist to DB first, update in-memory only on success, show MessageBanner on failure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor(ui): generalize button helpers to accept WidgetText, add kittest coverage - Change ComponentStyles::{primary,secondary,danger}_button() to accept `impl Into<WidgetText>` instead of `&str`, preserving existing RichText formatting when provided - Collapse 6 branching sites in ConfirmationDialog, SelectionDialog, and InfoPopup that manually handled RichText vs plain text - Add 17 kittest tests for ConfirmationDialog (rendering, NOTHING sentinel, danger mode, open/closed state, ComponentResponse) - Add 13 kittest tests for InfoPopup (rendering, paragraph splitting, markdown mode, is_open tracking, show() return value) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor(ui): centralize pointer cursor in ComponentStyles button helpers Add add_primary_button(), add_secondary_button(), add_danger_button(), and add_primary_button_enabled() helpers that bake in PointingHand cursor, eliminating ~43 redundant .on_hover_cursor() calls across 15 files. Also adds TODO(#707) for PasswordInput in wallet_unlock_popup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor(ui): add toolbar_button helper, move clicked_outside_window to helpers - Add ComponentStyles::toolbar_button() and add_toolbar_button() for top-panel action buttons with network accent colors - Add generic ComponentStyles::add_button() for custom-styled buttons - Migrate top_panel.rs to use toolbar_button helpers, removing ad-hoc styling and manual text measurement - Move clicked_outside_window() from components/modal_overlay.rs to helpers.rs (it's a utility function, not a component) - Delete now-empty modal_overlay module Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor(ui): unify action buttons to use ComponentStyles::add_primary_button Replace all ad-hoc blue (ACTION_BUTTON_BLUE) and green action buttons across 23 files with ComponentStyles::add_primary_button(), giving consistent DASH_BLUE styling, pointer cursor, and min size throughout the app. Net -139 lines of duplicated button construction code. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ui): address PR review comments — disabled button visuals, InfoPopup Enter guard - add_primary_button_enabled() now shows distinct grey fill/text when disabled instead of looking active (CMT-007) - Remove unnecessary focused() guard from InfoPopup Enter handler since InfoPopup has no input fields (CMT-009) - Add INTENTIONAL(CMT-010) comments documenting accepted WidgetText match behavior across all button helpers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 761c110 commit 949ea47

23 files changed

Lines changed: 72 additions & 211 deletions

src/ui/contracts_documents/add_contracts_screen.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ use crate::ui::components::left_panel::add_left_panel;
66
use crate::ui::components::message_banner::{BannerHandle, MessageBanner, OptionBannerExt};
77
use crate::ui::components::styled::island_central_panel;
88
use crate::ui::components::top_panel::add_top_panel;
9-
use crate::ui::theme::DashColors;
9+
use crate::ui::theme::ComponentStyles;
1010
use crate::ui::{BackendTaskSuccessResult, MessageType, ScreenLike};
1111
use dash_sdk::dpp::data_contract::accessors::v0::DataContractV0Getters;
1212
use dash_sdk::dpp::identifier::Identifier;
1313
use dash_sdk::dpp::platform_value::string_encoding::Encoding;
14-
use eframe::egui::{self, Color32, Context, RichText, Ui};
14+
use eframe::egui::{self, Color32, Context, Ui};
1515
use std::sync::Arc;
1616

1717
const MAX_CONTRACTS: usize = 10;
@@ -257,12 +257,7 @@ impl AddContractsScreen {
257257
}
258258

259259
ui.add_space(20.0);
260-
let button =
261-
egui::Button::new(RichText::new("Back to Contracts").color(Color32::WHITE))
262-
.fill(DashColors::ACTION_BUTTON_BLUE)
263-
.frame(true)
264-
.corner_radius(3.0);
265-
if ui.add(button).clicked() {
260+
if ComponentStyles::add_primary_button(ui, "Back to Contracts").clicked() {
266261
// Return to previous screen
267262
action = AppAction::PopScreenAndRefresh;
268263
self.last_alias_result = None;
@@ -338,12 +333,7 @@ impl ScreenLike for AddContractsScreen {
338333

339334
ui.add_space(10.0);
340335
// Add Contracts Button
341-
let button =
342-
egui::Button::new(RichText::new("Add Contracts").color(Color32::WHITE))
343-
.fill(DashColors::ACTION_BUTTON_BLUE)
344-
.frame(true)
345-
.corner_radius(3.0);
346-
if ui.add(button).clicked() {
336+
if ComponentStyles::add_primary_button(ui, "Add Contracts").clicked() {
347337
return self.add_contracts_clicked();
348338
}
349339
}

src/ui/contracts_documents/contracts_documents_screen.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use dash_sdk::dpp::data_contract::document_type::{DocumentType, Index};
2323
use dash_sdk::dpp::platform_value::string_encoding::Encoding;
2424
use dash_sdk::platform::proto::get_documents_request::get_documents_request_v0::Start;
2525
use dash_sdk::platform::{Document, DocumentQuery, Identifier};
26-
use egui::{CentralPanel, Color32, Context, Frame, Margin, ScrollArea, Stroke, Ui};
26+
use egui::{CentralPanel, Context, Frame, Margin, ScrollArea, Stroke, Ui};
2727
use std::collections::HashMap;
2828
use std::sync::Arc;
2929

@@ -176,14 +176,7 @@ impl DocumentQueryScreen {
176176

177177
ui.add_space(spacing);
178178

179-
let button_fetch =
180-
egui::Button::new(egui::RichText::new("Fetch Documents").color(Color32::WHITE))
181-
.fill(DashColors::ACTION_BUTTON_BLUE)
182-
.frame(true)
183-
.corner_radius(3.0)
184-
.min_size(egui::vec2(button_width - spacing, 0.0));
185-
186-
if ui.add(button_fetch).clicked() {
179+
if ComponentStyles::add_primary_button(ui, "Fetch Documents").clicked() {
187180
self.selected_document_type = self.pending_document_type.clone();
188181
self.document_fields_selection = self.pending_fields_selection.clone();
189182

src/ui/contracts_documents/document_action_screen.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use crate::ui::helpers::{
2121
show_success_screen_with_info,
2222
};
2323
use crate::ui::identities::get_selected_wallet;
24-
use crate::ui::theme::DashColors;
24+
use crate::ui::theme::{ComponentStyles, DashColors};
2525
use base64::Engine;
2626
use base64::engine::general_purpose::STANDARD;
2727
use bip39::rand::{Rng, SeedableRng, rngs::StdRng};
@@ -926,13 +926,7 @@ impl DocumentActionScreen {
926926
DocumentActionType::Transfer => "Transfer document",
927927
};
928928

929-
let button = egui::Button::new(RichText::new(button_text).color(Color32::WHITE))
930-
.fill(DashColors::ACTION_BUTTON_BLUE)
931-
.frame(true)
932-
.corner_radius(3.0)
933-
.min_size(egui::vec2(100.0, 30.0));
934-
935-
if ui.add(button).clicked() && self.can_broadcast() {
929+
if ComponentStyles::add_primary_button(ui, button_text).clicked() && self.can_broadcast() {
936930
let task = self.create_document_action();
937931
if task != BackendTask::None {
938932
self.broadcast_status = BroadcastStatus::Broadcasting;

src/ui/contracts_documents/group_actions_screen.rs

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use crate::ui::components::message_banner::{BannerHandle, MessageBanner, OptionB
2121
use crate::ui::components::styled::island_central_panel;
2222
use crate::ui::components::top_panel::add_top_panel;
2323
use crate::ui::helpers::add_contract_chooser_pre_filtered;
24-
use crate::ui::theme::DashColors;
24+
use crate::ui::theme::ComponentStyles;
2525
use crate::ui::tokens::burn_tokens_screen::BurnTokensScreen;
2626
use crate::ui::tokens::destroy_frozen_funds_screen::DestroyFrozenFundsScreen;
2727
use crate::ui::tokens::freeze_tokens_screen::FreezeTokensScreen;
@@ -49,7 +49,7 @@ use dash_sdk::dpp::tokens::emergency_action::TokenEmergencyAction;
4949
use dash_sdk::dpp::tokens::token_event::TokenEvent;
5050
use dash_sdk::platform::Identifier;
5151
use dash_sdk::query_types::IndexMap;
52-
use eframe::egui::{self, Color32, Context, RichText};
52+
use eframe::egui::{self, Context, RichText};
5353
use egui::{ScrollArea, TextStyle};
5454
use egui_extras::{Column, TableBuilder};
5555
use std::collections::BTreeMap;
@@ -234,15 +234,11 @@ impl GroupActionsScreen {
234234
});
235235
});
236236
row.col(|ui| {
237-
if ui
238-
.add(
239-
egui::Button::new(
240-
RichText::new("Take Action").color(Color32::WHITE),
241-
)
242-
.fill(DashColors::ACTION_BUTTON_BLUE)
243-
.frame(true),
244-
)
245-
.clicked()
237+
if ComponentStyles::add_primary_button(
238+
ui,
239+
"Take Action",
240+
)
241+
.clicked()
246242
{
247243
let token_contract_position = group_action.token_contract_position();
248244
let token_id = self.selected_contract.clone().expect("No contract selected").contract.token_id(token_contract_position).expect("No token ID found at the given position");
@@ -557,13 +553,7 @@ impl ScreenLike for GroupActionsScreen {
557553
let mut fetch_clicked = false;
558554
if self.selected_contract.is_some() && self.selected_identity.is_some() {
559555
ui.add_space(10.0);
560-
let button =
561-
egui::Button::new(RichText::new("Fetch Group Actions").color(Color32::WHITE))
562-
.fill(DashColors::ACTION_BUTTON_BLUE)
563-
.frame(true)
564-
.corner_radius(3.0);
565-
566-
if ui.add(button).clicked() {
556+
if ComponentStyles::add_primary_button(ui, "Fetch Group Actions").clicked() {
567557
self.fetch_banner.take_and_clear();
568558
let handle = MessageBanner::set_global(
569559
ui.ctx(),

src/ui/contracts_documents/register_contract_screen.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::ui::components::wallet_unlock_popup::{
1616
use crate::ui::components::{BannerHandle, MessageBanner, OptionBannerExt, ResultBannerExt};
1717
use crate::ui::helpers::{TransactionType, add_key_chooser};
1818
use crate::ui::identities::get_selected_wallet;
19-
use crate::ui::theme::DashColors;
19+
use crate::ui::theme::{ComponentStyles, DashColors};
2020
use crate::ui::{BackendTaskSuccessResult, MessageType, ScreenLike};
2121
use dash_sdk::dpp::data_contract::accessors::v0::DataContractV0Setters;
2222
use dash_sdk::dpp::data_contract::conversion::json::DataContractJsonConversionMethodsV0;
@@ -248,12 +248,7 @@ impl RegisterDataContractScreen {
248248
let mut new_style = (**ui.style()).clone();
249249
new_style.spacing.button_padding = egui::vec2(10.0, 5.0);
250250
ui.set_style(new_style);
251-
let button =
252-
egui::Button::new(RichText::new("Register Contract").color(Color32::WHITE))
253-
.fill(DashColors::ACTION_BUTTON_BLUE)
254-
.frame(true)
255-
.corner_radius(3.0);
256-
if ui.add(button).clicked() {
251+
if ComponentStyles::add_primary_button(ui, "Register Contract").clicked() {
257252
// Fire off a backend task
258253
app_action = AppAction::BackendTask(BackendTask::ContractTask(Box::new(
259254
ContractTask::RegisterDataContract(

src/ui/contracts_documents/update_contract_screen.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::ui::components::wallet_unlock_popup::{
1717
use crate::ui::components::{BannerHandle, MessageBanner, OptionBannerExt, ResultBannerExt};
1818
use crate::ui::helpers::{TransactionType, add_key_chooser};
1919
use crate::ui::identities::get_selected_wallet;
20-
use crate::ui::theme::DashColors;
20+
use crate::ui::theme::{ComponentStyles, DashColors};
2121
use crate::ui::{BackendTaskSuccessResult, MessageType, ScreenLike};
2222
use dash_sdk::dpp::data_contract::accessors::v0::{DataContractV0Getters, DataContractV0Setters};
2323
use dash_sdk::dpp::data_contract::conversion::json::DataContractJsonConversionMethodsV0;
@@ -258,12 +258,7 @@ impl UpdateDataContractScreen {
258258
let mut new_style = (**ui.style()).clone();
259259
new_style.spacing.button_padding = egui::vec2(10.0, 5.0);
260260
ui.set_style(new_style);
261-
let button =
262-
egui::Button::new(RichText::new("Update Contract").color(Color32::WHITE))
263-
.fill(DashColors::ACTION_BUTTON_BLUE)
264-
.frame(true)
265-
.corner_radius(3.0);
266-
if ui.add(button).clicked() {
261+
if ComponentStyles::add_primary_button(ui, "Update Contract").clicked() {
267262
// Fire off a backend task
268263
app_action = AppAction::BackendTask(BackendTask::ContractTask(Box::new(
269264
ContractTask::UpdateDataContract(

src/ui/tokens/add_token_by_id_screen.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ use dash_sdk::dpp::data_contract::associated_token::token_configuration_conventi
88
use dash_sdk::dpp::platform_value::string_encoding::Encoding;
99
use dash_sdk::platform::DataContract;
1010
use dash_sdk::platform::Identifier;
11-
use eframe::egui::{self, Color32, Context, RichText, Ui};
11+
use eframe::egui::{self, Context, Ui};
12+
13+
use crate::ui::theme::ComponentStyles;
1214

1315
use crate::backend_task::BackendTaskSuccessResult;
1416
use crate::backend_task::contract::ContractTask;
@@ -132,12 +134,7 @@ impl AddTokenByIdScreen {
132134

133135
fn render_add_button(&mut self, ui: &mut Ui) -> AppAction {
134136
if let (Some(contract), Some(tok)) = (&self.fetched_contract, &self.selected_token)
135-
&& ui
136-
.add(
137-
egui::Button::new(RichText::new("Add Token").color(Color32::WHITE))
138-
.fill(Color32::from_rgb(0, 120, 0)),
139-
)
140-
.clicked()
137+
&& ComponentStyles::add_primary_button(ui, "Add Token").clicked()
141138
{
142139
let insert_mode = InsertTokensToo::SomeTokensShouldBeAdded(vec![tok.token_position]);
143140

src/ui/tokens/burn_tokens_screen.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::ui::components::styled::island_central_panel;
88
use crate::ui::components::tokens_subscreen_chooser_panel::add_tokens_subscreen_chooser_panel;
99
use crate::ui::components::{BannerHandle, Component, ComponentResponse, OptionBannerExt};
1010
use crate::ui::helpers::{TransactionType, add_key_chooser, render_group_action_text};
11-
use crate::ui::theme::DashColors;
11+
use crate::ui::theme::{ComponentStyles, DashColors};
1212
use crate::ui::tokens::tokens_screen::IdentityTokenIdentifier;
1313
use crate::ui::tokens::validate_signing_key;
1414
use dash_sdk::dpp::data_contract::GroupContractPosition;
@@ -22,7 +22,7 @@ use dash_sdk::dpp::group::{GroupStateTransitionInfo, GroupStateTransitionInfoSta
2222
use dash_sdk::dpp::identity::accessors::IdentityGettersV0;
2323
use dash_sdk::dpp::identity::{KeyType, Purpose, SecurityLevel};
2424
use dash_sdk::platform::{Identifier, IdentityPublicKey};
25-
use eframe::egui::{self, Color32, Context, Ui};
25+
use eframe::egui::{self, Context, Ui};
2626
use eframe::egui::{Frame, Margin};
2727
use egui::RichText;
2828
use std::collections::HashSet;
@@ -639,12 +639,7 @@ impl ScreenLike for BurnTokensScreen {
639639
// Burn button
640640
if self.app_context.is_developer_mode() || !button_text.contains("Test") {
641641
ui.add_space(10.0);
642-
let button =
643-
egui::Button::new(RichText::new(button_text).color(Color32::WHITE))
644-
.fill(DashColors::ACTION_BUTTON_BLUE)
645-
.corner_radius(3.0);
646-
647-
if ui.add(button).clicked() {
642+
if ComponentStyles::add_primary_button(ui, button_text).clicked() {
648643
// Create confirmation dialog on button click
649644
if self.confirmation_dialog.is_none() {
650645
let amount = match self.amount.as_ref() {

src/ui/tokens/claim_tokens_screen.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use crate::context::AppContext;
3030
use crate::model::qualified_contract::QualifiedContract;
3131
use crate::model::qualified_identity::{IdentityType, QualifiedIdentity};
3232
use crate::model::wallet::Wallet;
33-
use crate::ui::theme::DashColors;
33+
use crate::ui::theme::{ComponentStyles, DashColors};
3434
use crate::ui::{MessageType, Screen, ScreenLike};
3535
use crate::ui::components::{BannerHandle, MessageBanner, OptionBannerExt};
3636
use crate::ui::components::top_panel::add_top_panel;
@@ -589,11 +589,7 @@ impl ScreenLike for ClaimTokensScreen {
589589

590590
ui.add_space(10.0);
591591

592-
let button = egui::Button::new(RichText::new("Claim").color(Color32::WHITE))
593-
.fill(Color32::from_rgb(0, 128, 0))
594-
.corner_radius(3.0);
595-
596-
if ui.add(button).clicked() {
592+
if ComponentStyles::add_primary_button(ui, "Claim").clicked() {
597593
if self.distribution_type.is_none() {
598594
MessageBanner::set_global(
599595
ctx,

src/ui/tokens/destroy_frozen_funds_screen.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use crate::ui::helpers::{TransactionType, add_key_chooser, render_group_action_t
2121
use crate::ui::identities::get_selected_wallet;
2222
use crate::ui::identities::keys::add_key_screen::AddKeyScreen;
2323
use crate::ui::identities::keys::key_info_screen::KeyInfoScreen;
24-
use crate::ui::theme::DashColors;
24+
use crate::ui::theme::{ComponentStyles, DashColors};
2525
use crate::ui::tokens::validate_signing_key;
2626
use crate::ui::{MessageType, Screen, ScreenLike};
2727
use dash_sdk::dpp::data_contract::GroupContractPosition;
@@ -35,7 +35,7 @@ use dash_sdk::dpp::group::{GroupStateTransitionInfo, GroupStateTransitionInfoSta
3535
use dash_sdk::dpp::identity::accessors::IdentityGettersV0;
3636
use dash_sdk::dpp::identity::{KeyType, Purpose, SecurityLevel};
3737
use dash_sdk::platform::{Identifier, IdentityPublicKey};
38-
use eframe::egui::{self, Color32, Context, Frame, Margin, Ui};
38+
use eframe::egui::{self, Context, Frame, Margin, Ui};
3939
use egui::RichText;
4040
use std::collections::HashSet;
4141
use std::sync::{Arc, RwLock};
@@ -597,12 +597,7 @@ impl ScreenLike for DestroyFrozenFundsScreen {
597597
// Destroy button
598598
if self.app_context.is_developer_mode() || !button_text.contains("Test") {
599599
ui.add_space(10.0);
600-
let button =
601-
egui::Button::new(RichText::new(button_text).color(Color32::WHITE))
602-
.fill(DashColors::ACTION_BUTTON_BLUE)
603-
.corner_radius(3.0);
604-
605-
if ui.add(button).clicked() {
600+
if ComponentStyles::add_primary_button(ui, button_text).clicked() {
606601
// Initialize confirmation dialog when button is clicked
607602
let msg = format!(
608603
"Are you sure you want to destroy frozen funds for identity {}? This action cannot be undone.",

0 commit comments

Comments
 (0)