From da56bb73a0f79f60c5cb724b235e2e4effb11609 Mon Sep 17 00:00:00 2001 From: DanS Date: Sat, 4 Jul 2026 19:00:14 -0500 Subject: [PATCH] refactor(ui): consolidate raw ImGui buttons onto material::TactileButton MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UI-standardization audit: ~66 call sites still used raw ImGui::Button / ImGui::SmallButton instead of the app's canonical TactileButton, so those buttons missed the standard glass fill + rim + tactile overlay (and the light-theme flat treatment). Convert 59 plain action-button sites across the wizard, security dialogs, settings, market/console/explorer tabs, and the address dialogs to material::TactileButton / TactileSmallButton (drop-in: same signature/return, args preserved verbatim). Danger buttons keep their PushStyleColor wrappers — Tactile renders through them then overlays. Deliberately left raw (not plain buttons): InvisibleButton hit-targets, the frameless transparent-bg collapsible-header toggles (RPC/Debug), the icon-only pagination chevrons, and the receive All/Z/T segmented filter — a glass rim would clash with those intentionally borderless/segmented looks. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/app.cpp | 36 ++++++++++++------------ src/app_security.cpp | 28 +++++++++--------- src/app_wizard.cpp | 24 ++++++++-------- src/ui/pages/settings_page.cpp | 6 ++-- src/ui/windows/address_label_dialog.h | 2 +- src/ui/windows/address_transfer_dialog.h | 2 +- src/ui/windows/console_tab.cpp | 2 +- src/ui/windows/explorer_tab.cpp | 4 +-- src/ui/windows/market_tab.cpp | 14 ++++----- 9 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/app.cpp b/src/app.cpp index caac6f4..c809fb1 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -2345,7 +2345,7 @@ void App::renderLiteFirstRunPrompt() creating = false; // back to the buttons so the user can retry } } else { - if (ImGui::Button(TR("lite_welcome_create"), ImVec2(btnW, 0))) { + if (ui::material::TactileButton(TR("lite_welcome_create"), ImVec2(btnW, 0))) { // Async create with the same server failover as open (no UI freeze; a dead // server falls through to the next). On success the wizard reveals the seed. if (lite_wallet_->beginCreateWallet()) { @@ -2355,11 +2355,11 @@ void App::renderLiteFirstRunPrompt() } } ImGui::SameLine(); - if (ImGui::Button(TR("lite_welcome_restore"), ImVec2(btnW, 0))) { + if (ui::material::TactileButton(TR("lite_welcome_restore"), ImVec2(btnW, 0))) { step = 3; // inline seed-entry restore (see step 3 below) } ImGui::Spacing(); - if (ImGui::Button(TR("lite_welcome_later"), + if (ui::material::TactileButton(TR("lite_welcome_later"), ImVec2(btnW * 2 + ImGui::GetStyle().ItemSpacing.x, 0))) { finish(); } @@ -2394,7 +2394,7 @@ void App::renderLiteFirstRunPrompt() ImGui::PopStyleColor(); ImGui::Spacing(); ImGui::Spacing(); - if (ImGui::Button("I've written it down", ImVec2(btnW, 0))) { + if (ui::material::TactileButton("I've written it down", ImVec2(btnW, 0))) { chips.clear(); for (const auto& w : words) chips.emplace_back(w, false); std::mt19937 rng{std::random_device{}()}; @@ -2403,9 +2403,9 @@ void App::renderLiteFirstRunPrompt() step = 2; } ImGui::SameLine(); - if (ImGui::Button("Copy", ImVec2(80, 0))) copySecretToClipboard(seed); + if (ui::material::TactileButton("Copy", ImVec2(80, 0))) copySecretToClipboard(seed); ImGui::SameLine(); - if (ImGui::Button("Skip", ImVec2(80, 0))) { + if (ui::material::TactileButton("Skip", ImVec2(80, 0))) { ui::Notifications::instance().success(TR("lite_welcome_created"), 6.0f); finish(); } @@ -2433,9 +2433,9 @@ void App::renderLiteFirstRunPrompt() ImGui::PushID((int)i); if (chips[i].second) { ImGui::BeginDisabled(); - ImGui::Button(chips[i].first.c_str(), ImVec2(125, 0)); + ui::material::TactileButton(chips[i].first.c_str(), ImVec2(125, 0)); ImGui::EndDisabled(); - } else if (ImGui::Button(chips[i].first.c_str(), ImVec2(125, 0))) { + } else if (ui::material::TactileButton(chips[i].first.c_str(), ImVec2(125, 0))) { if (progress < (int)words.size() && chips[i].first == words[progress]) { chips[i].second = true; // correct next word ++progress; @@ -2450,15 +2450,15 @@ void App::renderLiteFirstRunPrompt() const bool verified = progress == (int)words.size(); if (!verified) ImGui::BeginDisabled(); - if (ImGui::Button("Done", ImVec2(btnW, 0))) { + if (ui::material::TactileButton("Done", ImVec2(btnW, 0))) { ui::Notifications::instance().success("Wallet created and backed up.", 6.0f); finish(); } if (!verified) ImGui::EndDisabled(); ImGui::SameLine(); - if (ImGui::Button("Back", ImVec2(80, 0))) step = 1; + if (ui::material::TactileButton("Back", ImVec2(80, 0))) step = 1; ImGui::SameLine(); - if (ImGui::Button("Skip", ImVec2(80, 0))) { + if (ui::material::TactileButton("Skip", ImVec2(80, 0))) { ui::Notifications::instance().success(TR("lite_welcome_created"), 6.0f); finish(); } @@ -2510,7 +2510,7 @@ void App::renderLiteFirstRunPrompt() while (!seedTrim.empty() && std::isspace((unsigned char)seedTrim.back())) seedTrim.pop_back(); ImGui::BeginDisabled(seedTrim.empty()); - if (ImGui::Button(TR("lite_restore_btn"), ImVec2(btnW, 0))) { + if (ui::material::TactileButton(TR("lite_restore_btn"), ImVec2(btnW, 0))) { wallet::LiteWalletRestoreRequest req; req.seedPhrase = seedTrim; req.birthday = static_cast(std::max(0, restoreBirthday)); @@ -2526,7 +2526,7 @@ void App::renderLiteFirstRunPrompt() } ImGui::EndDisabled(); ImGui::SameLine(); - if (ImGui::Button("Back", ImVec2(80, 0))) { + if (ui::material::TactileButton("Back", ImVec2(80, 0))) { sodium_memzero(restoreSeed, sizeof(restoreSeed)); restoreErr.clear(); step = 0; @@ -2561,7 +2561,7 @@ void App::renderLiteUnlockPrompt() ImGuiInputTextFlags_Password | ImGuiInputTextFlags_EnterReturnsTrue); ImGui::Spacing(); const float btnW = 130.0f; - bool doUnlock = ImGui::Button(TR("lite_unlock_btn"), ImVec2(btnW, 0)) || entered; + bool doUnlock = ui::material::TactileButton(TR("lite_unlock_btn"), ImVec2(btnW, 0)) || entered; if (doUnlock) { const bool ok = lite_wallet_->unlockWallet(pass); sodium_memzero(pass, sizeof(pass)); @@ -2574,7 +2574,7 @@ void App::renderLiteUnlockPrompt() ImGui::CloseCurrentPopup(); } ImGui::SameLine(); - if (ImGui::Button(TR("cancel"), ImVec2(btnW, 0))) { + if (ui::material::TactileButton(TR("cancel"), ImVec2(btnW, 0))) { sodium_memzero(pass, sizeof(pass)); lite_unlock_prompt_ = false; ImGui::CloseCurrentPopup(); @@ -3551,7 +3551,7 @@ void App::renderShutdownScreen() ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.6f, 0.15f, 0.15f, 0.9f)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.75f, 0.2f, 0.2f, 1.0f)); ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(0.5f, 0.1f, 0.1f, 1.0f)); - if (ImGui::Button(forceLabel, btnSize)) { + if (ui::material::TactileButton(forceLabel, btnSize)) { force_quit_confirm_ = true; } if (ImGui::IsItemHovered()) { @@ -3580,7 +3580,7 @@ void App::renderShutdownScreen() float totalW = btnW * 2 + ImGui::GetStyle().ItemSpacing.x; ImGui::SetCursorPosX((ImGui::GetWindowWidth() - totalW) * 0.5f); - if (ImGui::Button(TR("cancel"), ImVec2(btnW, 0))) { + if (ui::material::TactileButton(TR("cancel"), ImVec2(btnW, 0))) { ImGui::CloseCurrentPopup(); } ImGui::SameLine(); @@ -3588,7 +3588,7 @@ void App::renderShutdownScreen() ImGui::PushStyleColor(ImGuiCol_Button, ImGui::ColorConvertU32ToFloat4(WithAlpha(Error(), 210))); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImGui::ColorConvertU32ToFloat4(Error())); ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImGui::ColorConvertU32ToFloat4(WithAlpha(Error(), 160))); - if (ImGui::Button(TR("force_quit_yes"), ImVec2(btnW, 0))) { + if (ui::material::TactileButton(TR("force_quit_yes"), ImVec2(btnW, 0))) { DEBUG_LOGF("Force quit confirmed by user after %.0fs\n", shutdown_timer_); shutdown_complete_ = true; ImGui::CloseCurrentPopup(); diff --git a/src/app_security.cpp b/src/app_security.cpp index 7759be7..60b3898 100644 --- a/src/app_security.cpp +++ b/src/app_security.cpp @@ -1011,7 +1011,7 @@ void App::renderLockScreen() { ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary())); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f); ImGui::BeginDisabled(!canSubmit); - bool btnClicked = ImGui::Button("Unlock", ImVec2(unlockW, unlockH)); + bool btnClicked = ui::material::TactileButton("Unlock", ImVec2(unlockW, unlockH)); ImGui::EndDisabled(); ImGui::PopStyleVar(); ImGui::PopStyleColor(3); @@ -1176,7 +1176,7 @@ void App::renderEncryptWalletDialog() { float btnW = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f; ImGui::BeginDisabled(!valid || encrypt_in_progress_); - if (ImGui::Button("Encrypt Wallet", ImVec2(btnW, 40))) { + if (ui::material::TactileButton("Encrypt Wallet", ImVec2(btnW, 40))) { std::string pass(encrypt_pass_buf_); enc_dlg_saved_passphrase_ = pass; memset(encrypt_pass_buf_, 0, sizeof(encrypt_pass_buf_)); @@ -1188,7 +1188,7 @@ void App::renderEncryptWalletDialog() { ImGui::EndDisabled(); ImGui::SameLine(); - if (ImGui::Button("Cancel", ImVec2(btnW, 40))) { + if (ui::material::TactileButton("Cancel", ImVec2(btnW, 40))) { memset(encrypt_pass_buf_, 0, sizeof(encrypt_pass_buf_)); memset(encrypt_confirm_buf_, 0, sizeof(encrypt_confirm_buf_)); show_encrypt_dialog_ = false; @@ -1270,7 +1270,7 @@ void App::renderEncryptWalletDialog() { float btnW = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f; ImGui::BeginDisabled(!pinValid || !hasPassphrase || pin_in_progress_); - if (ImGui::Button("Set PIN", ImVec2(btnW, 40))) { + if (ui::material::TactileButton("Set PIN", ImVec2(btnW, 40))) { pin_in_progress_ = true; enc_dlg_pin_status_.clear(); std::string savedPass = enc_dlg_saved_passphrase_; @@ -1307,7 +1307,7 @@ void App::renderEncryptWalletDialog() { ImGui::EndDisabled(); ImGui::SameLine(); - if (ImGui::Button("Skip", ImVec2(btnW, 40))) { + if (ui::material::TactileButton("Skip", ImVec2(btnW, 40))) { if (!enc_dlg_saved_passphrase_.empty()) { util::SecureVault::secureZero(&enc_dlg_saved_passphrase_[0], enc_dlg_saved_passphrase_.size()); @@ -1362,7 +1362,7 @@ void App::renderEncryptWalletDialog() { strlen(change_new_pass_buf_) >= 8 && strcmp(change_new_pass_buf_, change_confirm_buf_) == 0; ImGui::BeginDisabled(!valid || encrypt_in_progress_); - if (ImGui::Button("Change Passphrase", ImVec2(-1, 40))) { + if (ui::material::TactileButton("Change Passphrase", ImVec2(-1, 40))) { changePassphrase(std::string(change_old_pass_buf_), std::string(change_new_pass_buf_)); } @@ -1428,7 +1428,7 @@ void App::renderDecryptWalletDialog() { float btnW = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f; ImGui::BeginDisabled(!valid || decryptState.inProgress); - if (ImGui::Button("Remove Encryption", ImVec2(btnW, 40)) || (enterPressed && valid)) { + if (ui::material::TactileButton("Remove Encryption", ImVec2(btnW, 40)) || (enterPressed && valid)) { std::string passphrase(decrypt_pass_buf_); memset(decrypt_pass_buf_, 0, sizeof(decrypt_pass_buf_)); wallet_security_workflow_.start(std::chrono::steady_clock::now()); @@ -1619,7 +1619,7 @@ void App::renderDecryptWalletDialog() { ImGui::EndDisabled(); ImGui::SameLine(); - if (ImGui::Button("Cancel", ImVec2(btnW, 40))) { + if (ui::material::TactileButton("Cancel", ImVec2(btnW, 40))) { memset(decrypt_pass_buf_, 0, sizeof(decrypt_pass_buf_)); show_decrypt_dialog_ = false; } @@ -1737,7 +1737,7 @@ void App::renderDecryptWalletDialog() { "was saved as wallet.dat.encrypted.bak in your data directory."); ImGui::Spacing(); - if (ImGui::Button("Close", ImVec2(-1, 40))) { + if (ui::material::TactileButton("Close", ImVec2(-1, 40))) { show_decrypt_dialog_ = false; } @@ -1754,11 +1754,11 @@ void App::renderDecryptWalletDialog() { ImGui::Spacing(); float btnW = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f; - if (ImGui::Button("Try Again", ImVec2(btnW, 40))) { + if (ui::material::TactileButton("Try Again", ImVec2(btnW, 40))) { wallet_security_workflow_.reset(); } ImGui::SameLine(); - if (ImGui::Button("Close", ImVec2(btnW, 40))) { + if (ui::material::TactileButton("Close", ImVec2(btnW, 40))) { show_decrypt_dialog_ = false; } } @@ -1814,7 +1814,7 @@ void App::renderPinDialogs() { strcmp(pin_buf_, pin_confirm_buf_) == 0; ImGui::BeginDisabled(!valid || pin_in_progress_); - if (ImGui::Button("Set PIN", ImVec2(-1, 40))) { + if (ui::material::TactileButton("Set PIN", ImVec2(-1, 40))) { pin_in_progress_ = true; pin_status_ = "Verifying passphrase..."; @@ -1910,7 +1910,7 @@ void App::renderPinDialogs() { strcmp(pin_buf_, pin_confirm_buf_) == 0; ImGui::BeginDisabled(!valid || pin_in_progress_); - if (ImGui::Button("Change PIN", ImVec2(-1, 40))) { + if (ui::material::TactileButton("Change PIN", ImVec2(-1, 40))) { pin_in_progress_ = true; pin_status_ = "Changing PIN..."; std::string oldPin(pin_old_buf_); @@ -1969,7 +1969,7 @@ void App::renderPinDialogs() { ImGui::Spacing(); bool valid = strlen(pin_old_buf_) >= 4; ImGui::BeginDisabled(!valid || pin_in_progress_); - if (ImGui::Button("Remove PIN", ImVec2(-1, 40))) { + if (ui::material::TactileButton("Remove PIN", ImVec2(-1, 40))) { pin_in_progress_ = true; pin_status_ = "Verifying PIN..."; std::string oldPin(pin_old_buf_); diff --git a/src/app_wizard.cpp b/src/app_wizard.cpp index e076ef2..44c687c 100644 --- a/src/app_wizard.cpp +++ b/src/app_wizard.cpp @@ -611,7 +611,7 @@ void App::renderFirstRunWizard() { ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImGui::ColorConvertU32ToFloat4(ui::material::PrimaryVariant())); ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary())); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp); - if (ImGui::Button("Continue##app", ImVec2(btnW, btnH))) { + if (ui::material::TactileButton("Continue##app", ImVec2(btnW, btnH))) { // Save appearance choices, advance to Bootstrap settings_->setAcrylicEnabled(wiz_blur_amount > 0.001f); settings_->setAcrylicQuality(wiz_blur_amount > 0.001f @@ -763,7 +763,7 @@ void App::renderFirstRunWizard() { float cancelBX = rightX + (colW - cancelW) * 0.5f; ImGui::SetCursorScreenPos(ImVec2(cancelBX, cy)); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp); - if (ImGui::Button("Cancel##bs", ImVec2(cancelW, cancelH))) { + if (ui::material::TactileButton("Cancel##bs", ImVec2(cancelW, cancelH))) { bootstrap_->cancel(); } ImGui::PopStyleVar(); @@ -812,7 +812,7 @@ void App::renderFirstRunWizard() { ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary())); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp); ImGui::BeginDisabled(!supportsFullNodeLifecycleActions()); - if (ImGui::Button("Retry##bs", ImVec2(btnW2, btnH2))) { + if (ui::material::TactileButton("Retry##bs", ImVec2(btnW2, btnH2))) { // Stop embedded daemon before bootstrap to avoid chain data corruption stopDaemonForBootstrap(); bootstrap_ = std::make_unique(); @@ -826,7 +826,7 @@ void App::renderFirstRunWizard() { ImGui::SetCursorScreenPos(ImVec2(bx + btnW2 + 12.0f * dp, cy)); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp); - if (ImGui::Button("Skip##bsfail", ImVec2(btnW2, btnH2))) { + if (ui::material::TactileButton("Skip##bsfail", ImVec2(btnW2, btnH2))) { wizard_phase_ = WizardPhase::EncryptOffer; } ImGui::PopStyleVar(); @@ -896,7 +896,7 @@ void App::renderFirstRunWizard() { IM_COL32(220, 60, 60, 255))); ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(255, 255, 255, 255)); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp); - if (ImGui::Button("Stop Daemon##wiz", ImVec2(stopW, btnH2))) { + if (ui::material::TactileButton("Stop Daemon##wiz", ImVec2(stopW, btnH2))) { wizard_stopping_external_ = true; wizard_stop_status_ = "Sending stop command..."; async_tasks_.submit("wizard-stop-external-daemon", [this](const util::AsyncTaskManager::Token& token) { @@ -929,7 +929,7 @@ void App::renderFirstRunWizard() { ImGui::SetCursorScreenPos(ImVec2(bx + stopW + 12.0f * dp, cy)); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp); - if (ImGui::Button("Skip##extd", ImVec2(skipW2, btnH2))) { + if (ui::material::TactileButton("Skip##extd", ImVec2(skipW2, btnH2))) { wizard_phase_ = WizardPhase::EncryptOffer; } ImGui::PopStyleVar(); @@ -995,7 +995,7 @@ void App::renderFirstRunWizard() { ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary())); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp); ImGui::BeginDisabled(!supportsFullNodeLifecycleActions()); - if (ImGui::Button("Download##bs", ImVec2(dlBtnW, btnH2))) { + if (ui::material::TactileButton("Download##bs", ImVec2(dlBtnW, btnH2))) { // Stop embedded daemon before bootstrap to avoid chain data corruption stopDaemonForBootstrap(); bootstrap_ = std::make_unique(); @@ -1014,7 +1014,7 @@ void App::renderFirstRunWizard() { ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnSurface())); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp); ImGui::BeginDisabled(!supportsFullNodeLifecycleActions()); - if (ImGui::Button("Mirror##bs_mirror", ImVec2(mirrorW, btnH2))) { + if (ui::material::TactileButton("Mirror##bs_mirror", ImVec2(mirrorW, btnH2))) { stopDaemonForBootstrap(); bootstrap_ = std::make_unique(); std::string dataDir = util::Platform::getDragonXDataDir(); @@ -1032,7 +1032,7 @@ void App::renderFirstRunWizard() { // --- Skip button --- ImGui::SetCursorScreenPos(ImVec2(bx + dlBtnW + 8.0f * dp + mirrorW + 8.0f * dp, cy)); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp); - if (ImGui::Button("Skip##bs", ImVec2(skipW2, btnH2))) { + if (ui::material::TactileButton("Skip##bs", ImVec2(skipW2, btnH2))) { wizard_phase_ = WizardPhase::EncryptOffer; } ImGui::PopStyleVar(); @@ -1127,7 +1127,7 @@ void App::renderFirstRunWizard() { ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImGui::ColorConvertU32ToFloat4(ui::material::PrimaryVariant())); ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary())); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp); - if (ImGui::Button("Continue##encok", ImVec2(btnW2, btnH2))) { + if (ui::material::TactileButton("Continue##encok", ImVec2(btnW2, btnH2))) { wizard_phase_ = WizardPhase::Done; settings_->setWizardCompleted(true); settings_->save(); @@ -1310,7 +1310,7 @@ void App::renderFirstRunWizard() { ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary())); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp); ImGui::BeginDisabled(!canEncrypt); - if (ImGui::Button("Encrypt & Continue##wiz", ImVec2(encBtnW, btnH2))) { + if (ui::material::TactileButton("Encrypt & Continue##wiz", ImVec2(encBtnW, btnH2))) { // Save passphrase + optional PIN for background processing wallet_security_.beginDeferredEncryption( std::string(encrypt_pass_buf_), @@ -1341,7 +1341,7 @@ void App::renderFirstRunWizard() { ImGui::SetCursorScreenPos(ImVec2(bx + encBtnW + 12.0f * dp, cy)); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp); - if (ImGui::Button("Skip##enc", ImVec2(skipW2, btnH2))) { + if (ui::material::TactileButton("Skip##enc", ImVec2(skipW2, btnH2))) { wizard_phase_ = WizardPhase::Done; settings_->setWizardCompleted(true); settings_->save(); diff --git a/src/ui/pages/settings_page.cpp b/src/ui/pages/settings_page.cpp index da3f949..6364dd4 100644 --- a/src/ui/pages/settings_page.cpp +++ b/src/ui/pages/settings_page.cpp @@ -1508,7 +1508,7 @@ void RenderSettingsPage(App* app) { TR("lite_servers_network_tab")); ImGui::Dummy(ImVec2(0, Layout::spacingSm())); - if (ImGui::Button(TrId("lite_wallet_request", "LiteLifecycleToggle").c_str(), ImVec2(liteInputW, 0))) { + if (material::TactileButton(TrId("lite_wallet_request", "LiteLifecycleToggle").c_str(), ImVec2(liteInputW, 0))) { s_settingsState.lite_lifecycle_expanded = !s_settingsState.lite_lifecycle_expanded; } @@ -2696,12 +2696,12 @@ void RenderSettingsPage(App* app) { ImGui::Spacing(); float btnW = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f; - if (ImGui::Button(TrId("cancel", "rescan_cancel").c_str(), ImVec2(btnW, 40))) { + if (material::TactileButton(TrId("cancel", "rescan_cancel").c_str(), ImVec2(btnW, 40))) { s_settingsState.confirm_rescan = false; } ImGui::SameLine(); ImGui::BeginDisabled(detecting); - if (ImGui::Button(TrId("rescan", "rescan_confirm").c_str(), ImVec2(btnW, 40))) { + if (material::TactileButton(TrId("rescan", "rescan_confirm").c_str(), ImVec2(btnW, 40))) { if (bootstrapped) { app->runtimeRescan(s_settingsState.rescan_start_height); } else { diff --git a/src/ui/windows/address_label_dialog.h b/src/ui/windows/address_label_dialog.h index 1c1dc23..dcb92a1 100644 --- a/src/ui/windows/address_label_dialog.h +++ b/src/ui/windows/address_label_dialog.h @@ -189,7 +189,7 @@ public: // "No icon" option if (showClearIcon) { ImGui::Spacing(); - if (ImGui::SmallButton(TR("clear_icon"))) { + if (material::TactileSmallButton(TR("clear_icon"))) { s_selectedIcon = -1; } } diff --git a/src/ui/windows/address_transfer_dialog.h b/src/ui/windows/address_transfer_dialog.h index 3094de7..8cb9617 100644 --- a/src/ui/windows/address_transfer_dialog.h +++ b/src/ui/windows/address_transfer_dialog.h @@ -119,7 +119,7 @@ public: // Max button ImGui::SameLine(); - if (ImGui::SmallButton(TR("max"))) { + if (material::TactileSmallButton(TR("max"))) { snprintf(s_amount, sizeof(s_amount), "%.8f", maxSendableAmount(s_info.fromBalance, s_fee)); } diff --git a/src/ui/windows/console_tab.cpp b/src/ui/windows/console_tab.cpp index 9b5716a..4b73c7b 100644 --- a/src/ui/windows/console_tab.cpp +++ b/src/ui/windows/console_tab.cpp @@ -1467,7 +1467,7 @@ void ConsoleTab::renderCommandsPopup() ImGui::Dummy(ImVec2(0, Layout::spacingXs())); // Close button - if (ImGui::Button(TR("console_close"), ImVec2(-1, 0))) { + if (material::TactileButton(TR("console_close"), ImVec2(-1, 0))) { cmdFilter[0] = '\0'; show_commands_popup_ = false; } diff --git a/src/ui/windows/explorer_tab.cpp b/src/ui/windows/explorer_tab.cpp index b357fd6..b85df9f 100644 --- a/src/ui/windows/explorer_tab.cpp +++ b/src/ui/windows/explorer_tab.cpp @@ -1043,7 +1043,7 @@ static void renderBlockDetailModal(App* app) { if (s_detail_height > 1) { ImGui::PushFont(Type().iconMed()); ImGui::PushID("prevBlock"); - if (ImGui::SmallButton(ICON_MD_CHEVRON_LEFT)) { + if (material::TactileSmallButton(ICON_MD_CHEVRON_LEFT)) { if (app->rpc() && app->rpc()->isConnected()) fetchBlockDetail(app, s_detail_height - 1); } @@ -1057,7 +1057,7 @@ static void renderBlockDetailModal(App* app) { if (!s_detail_next_hash.empty()) { ImGui::PushFont(Type().iconMed()); ImGui::PushID("nextBlock"); - if (ImGui::SmallButton(ICON_MD_CHEVRON_RIGHT)) { + if (material::TactileSmallButton(ICON_MD_CHEVRON_RIGHT)) { if (app->rpc() && app->rpc()->isConnected()) fetchBlockDetail(app, s_detail_height + 1); } diff --git a/src/ui/windows/market_tab.cpp b/src/ui/windows/market_tab.cpp index 7b573a5..a4cf8d3 100644 --- a/src/ui/windows/market_tab.cpp +++ b/src/ui/windows/market_tab.cpp @@ -590,9 +590,9 @@ static void pfDrawAddressSection(App* app) ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 12.0f * dp); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, pillPad); ImGui::SetCursorScreenPos(ImVec2(grpX, rowStart.y + (rowH - pillH) * 0.5f)); - if (ImGui::Button(selLbl)) selAllClicked = true; + if (material::TactileButton(selLbl)) selAllClicked = true; ImGui::SameLine(); - if (ImGui::Button(clrLbl)) s_pfEdit.addrs.clear(); + if (material::TactileButton(clrLbl)) s_pfEdit.addrs.clear(); ImGui::PopStyleVar(2); ImGui::SameLine(); ImGui::SetCursorScreenPos(ImVec2(ImGui::GetCursorScreenPos().x, @@ -825,7 +825,7 @@ static void RenderPortfolioEditor(App* app) ImGui::EndChild(); ImGui::Dummy(ImVec2(0, Layout::spacingSm())); // Add immediately creates a persisted "Untitled" group and selects it for editing. - if (ImGui::Button(TR("portfolio_add_entry"), ImVec2(masterW, addH))) { + if (material::TactileButton(TR("portfolio_add_entry"), ImVec2(masterW, addH))) { // Adding switches to a new group; uncommitted edits to the current one are discarded. auto es = settings->getPortfolioEntries(); config::Settings::PortfolioEntry ne; @@ -952,11 +952,11 @@ static void RenderPortfolioEditor(App* app) material::RightAlignX(grp); ImGui::SetCursorPosY(ImGui::GetCursorPosY() + Layout::spacingSm()); ImGui::BeginDisabled(!selDirty); - if (ImGui::Button(TR("portfolio_revert"), ImVec2(bw, addH))) + if (material::TactileButton(TR("portfolio_revert"), ImVec2(bw, addH))) PortfolioBeginEdit(app, s_pfEdit.sel); // reload the working set from the stored entry ImGui::SameLine(0, sp); ImGui::BeginDisabled(s_pfEdit.label[0] == '\0'); - if (ImGui::Button(TR("portfolio_save"), ImVec2(bw, addH))) pfCommitIfNeeded(settings); + if (material::TactileButton(TR("portfolio_save"), ImVec2(bw, addH))) pfCommitIfNeeded(settings); ImGui::EndDisabled(); ImGui::EndDisabled(); } @@ -967,7 +967,7 @@ static void RenderPortfolioEditor(App* app) { float bh = 40.0f * dp, bw = 120.0f * dp; material::RightAlignX(bw); - if (ImGui::Button(TR("portfolio_close"), ImVec2(bw, bh))) { pfCommitIfNeeded(settings); s_pfEdit.open = false; } + if (material::TactileButton(TR("portfolio_close"), ImVec2(bw, bh))) { pfCommitIfNeeded(settings); s_pfEdit.open = false; } } material::EndOverlayDialog(); @@ -1672,7 +1672,7 @@ static void mktDrawPortfolio(const MktCtx& cx) float mBtnW = body2->CalcTextSizeA(body2->LegacySize, FLT_MAX, 0, ml).x + Layout::spacingMd() * 2; ImGui::SameLine(); material::RightAlignX(mBtnW); - if (ImGui::Button(ml, ImVec2(mBtnW, 0))) { + if (material::TactileButton(ml, ImVec2(mBtnW, 0))) { // Open the combined editor selecting the first group (or the empty state if none). PortfolioBeginEdit(app, app->settings()->getPortfolioEntries().empty() ? -1 : 0); s_pfEdit.open = true;