refactor(ui): consolidate raw ImGui buttons onto material::TactileButton
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) <noreply@anthropic.com>
This commit is contained in:
36
src/app.cpp
36
src/app.cpp
@@ -2345,7 +2345,7 @@ void App::renderLiteFirstRunPrompt()
|
|||||||
creating = false; // back to the buttons so the user can retry
|
creating = false; // back to the buttons so the user can retry
|
||||||
}
|
}
|
||||||
} else {
|
} 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
|
// 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.
|
// server falls through to the next). On success the wizard reveals the seed.
|
||||||
if (lite_wallet_->beginCreateWallet()) {
|
if (lite_wallet_->beginCreateWallet()) {
|
||||||
@@ -2355,11 +2355,11 @@ void App::renderLiteFirstRunPrompt()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
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)
|
step = 3; // inline seed-entry restore (see step 3 below)
|
||||||
}
|
}
|
||||||
ImGui::Spacing();
|
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))) {
|
ImVec2(btnW * 2 + ImGui::GetStyle().ItemSpacing.x, 0))) {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
@@ -2394,7 +2394,7 @@ void App::renderLiteFirstRunPrompt()
|
|||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
ImGui::Spacing(); ImGui::Spacing();
|
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();
|
chips.clear();
|
||||||
for (const auto& w : words) chips.emplace_back(w, false);
|
for (const auto& w : words) chips.emplace_back(w, false);
|
||||||
std::mt19937 rng{std::random_device{}()};
|
std::mt19937 rng{std::random_device{}()};
|
||||||
@@ -2403,9 +2403,9 @@ void App::renderLiteFirstRunPrompt()
|
|||||||
step = 2;
|
step = 2;
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Copy", ImVec2(80, 0))) copySecretToClipboard(seed);
|
if (ui::material::TactileButton("Copy", ImVec2(80, 0))) copySecretToClipboard(seed);
|
||||||
ImGui::SameLine();
|
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);
|
ui::Notifications::instance().success(TR("lite_welcome_created"), 6.0f);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
@@ -2433,9 +2433,9 @@ void App::renderLiteFirstRunPrompt()
|
|||||||
ImGui::PushID((int)i);
|
ImGui::PushID((int)i);
|
||||||
if (chips[i].second) {
|
if (chips[i].second) {
|
||||||
ImGui::BeginDisabled();
|
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();
|
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]) {
|
if (progress < (int)words.size() && chips[i].first == words[progress]) {
|
||||||
chips[i].second = true; // correct next word
|
chips[i].second = true; // correct next word
|
||||||
++progress;
|
++progress;
|
||||||
@@ -2450,15 +2450,15 @@ void App::renderLiteFirstRunPrompt()
|
|||||||
|
|
||||||
const bool verified = progress == (int)words.size();
|
const bool verified = progress == (int)words.size();
|
||||||
if (!verified) ImGui::BeginDisabled();
|
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);
|
ui::Notifications::instance().success("Wallet created and backed up.", 6.0f);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
if (!verified) ImGui::EndDisabled();
|
if (!verified) ImGui::EndDisabled();
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Back", ImVec2(80, 0))) step = 1;
|
if (ui::material::TactileButton("Back", ImVec2(80, 0))) step = 1;
|
||||||
ImGui::SameLine();
|
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);
|
ui::Notifications::instance().success(TR("lite_welcome_created"), 6.0f);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
@@ -2510,7 +2510,7 @@ void App::renderLiteFirstRunPrompt()
|
|||||||
while (!seedTrim.empty() && std::isspace((unsigned char)seedTrim.back())) seedTrim.pop_back();
|
while (!seedTrim.empty() && std::isspace((unsigned char)seedTrim.back())) seedTrim.pop_back();
|
||||||
|
|
||||||
ImGui::BeginDisabled(seedTrim.empty());
|
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;
|
wallet::LiteWalletRestoreRequest req;
|
||||||
req.seedPhrase = seedTrim;
|
req.seedPhrase = seedTrim;
|
||||||
req.birthday = static_cast<unsigned long long>(std::max(0, restoreBirthday));
|
req.birthday = static_cast<unsigned long long>(std::max(0, restoreBirthday));
|
||||||
@@ -2526,7 +2526,7 @@ void App::renderLiteFirstRunPrompt()
|
|||||||
}
|
}
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Back", ImVec2(80, 0))) {
|
if (ui::material::TactileButton("Back", ImVec2(80, 0))) {
|
||||||
sodium_memzero(restoreSeed, sizeof(restoreSeed));
|
sodium_memzero(restoreSeed, sizeof(restoreSeed));
|
||||||
restoreErr.clear();
|
restoreErr.clear();
|
||||||
step = 0;
|
step = 0;
|
||||||
@@ -2561,7 +2561,7 @@ void App::renderLiteUnlockPrompt()
|
|||||||
ImGuiInputTextFlags_Password | ImGuiInputTextFlags_EnterReturnsTrue);
|
ImGuiInputTextFlags_Password | ImGuiInputTextFlags_EnterReturnsTrue);
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
const float btnW = 130.0f;
|
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) {
|
if (doUnlock) {
|
||||||
const bool ok = lite_wallet_->unlockWallet(pass);
|
const bool ok = lite_wallet_->unlockWallet(pass);
|
||||||
sodium_memzero(pass, sizeof(pass));
|
sodium_memzero(pass, sizeof(pass));
|
||||||
@@ -2574,7 +2574,7 @@ void App::renderLiteUnlockPrompt()
|
|||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button(TR("cancel"), ImVec2(btnW, 0))) {
|
if (ui::material::TactileButton(TR("cancel"), ImVec2(btnW, 0))) {
|
||||||
sodium_memzero(pass, sizeof(pass));
|
sodium_memzero(pass, sizeof(pass));
|
||||||
lite_unlock_prompt_ = false;
|
lite_unlock_prompt_ = false;
|
||||||
ImGui::CloseCurrentPopup();
|
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_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_ButtonHovered, ImVec4(0.75f, 0.2f, 0.2f, 1.0f));
|
||||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(0.5f, 0.1f, 0.1f, 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;
|
force_quit_confirm_ = true;
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemHovered()) {
|
if (ImGui::IsItemHovered()) {
|
||||||
@@ -3580,7 +3580,7 @@ void App::renderShutdownScreen()
|
|||||||
float totalW = btnW * 2 + ImGui::GetStyle().ItemSpacing.x;
|
float totalW = btnW * 2 + ImGui::GetStyle().ItemSpacing.x;
|
||||||
ImGui::SetCursorPosX((ImGui::GetWindowWidth() - totalW) * 0.5f);
|
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::CloseCurrentPopup();
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
@@ -3588,7 +3588,7 @@ void App::renderShutdownScreen()
|
|||||||
ImGui::PushStyleColor(ImGuiCol_Button, ImGui::ColorConvertU32ToFloat4(WithAlpha(Error(), 210)));
|
ImGui::PushStyleColor(ImGuiCol_Button, ImGui::ColorConvertU32ToFloat4(WithAlpha(Error(), 210)));
|
||||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImGui::ColorConvertU32ToFloat4(Error()));
|
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImGui::ColorConvertU32ToFloat4(Error()));
|
||||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImGui::ColorConvertU32ToFloat4(WithAlpha(Error(), 160)));
|
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_);
|
DEBUG_LOGF("Force quit confirmed by user after %.0fs\n", shutdown_timer_);
|
||||||
shutdown_complete_ = true;
|
shutdown_complete_ = true;
|
||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
|
|||||||
@@ -1011,7 +1011,7 @@ void App::renderLockScreen() {
|
|||||||
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary()));
|
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary()));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f);
|
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f);
|
||||||
ImGui::BeginDisabled(!canSubmit);
|
ImGui::BeginDisabled(!canSubmit);
|
||||||
bool btnClicked = ImGui::Button("Unlock", ImVec2(unlockW, unlockH));
|
bool btnClicked = ui::material::TactileButton("Unlock", ImVec2(unlockW, unlockH));
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
ImGui::PopStyleVar();
|
ImGui::PopStyleVar();
|
||||||
ImGui::PopStyleColor(3);
|
ImGui::PopStyleColor(3);
|
||||||
@@ -1176,7 +1176,7 @@ void App::renderEncryptWalletDialog() {
|
|||||||
|
|
||||||
float btnW = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f;
|
float btnW = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f;
|
||||||
ImGui::BeginDisabled(!valid || encrypt_in_progress_);
|
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_);
|
std::string pass(encrypt_pass_buf_);
|
||||||
enc_dlg_saved_passphrase_ = pass;
|
enc_dlg_saved_passphrase_ = pass;
|
||||||
memset(encrypt_pass_buf_, 0, sizeof(encrypt_pass_buf_));
|
memset(encrypt_pass_buf_, 0, sizeof(encrypt_pass_buf_));
|
||||||
@@ -1188,7 +1188,7 @@ void App::renderEncryptWalletDialog() {
|
|||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
|
|
||||||
ImGui::SameLine();
|
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_pass_buf_, 0, sizeof(encrypt_pass_buf_));
|
||||||
memset(encrypt_confirm_buf_, 0, sizeof(encrypt_confirm_buf_));
|
memset(encrypt_confirm_buf_, 0, sizeof(encrypt_confirm_buf_));
|
||||||
show_encrypt_dialog_ = false;
|
show_encrypt_dialog_ = false;
|
||||||
@@ -1270,7 +1270,7 @@ void App::renderEncryptWalletDialog() {
|
|||||||
float btnW = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f;
|
float btnW = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f;
|
||||||
|
|
||||||
ImGui::BeginDisabled(!pinValid || !hasPassphrase || pin_in_progress_);
|
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;
|
pin_in_progress_ = true;
|
||||||
enc_dlg_pin_status_.clear();
|
enc_dlg_pin_status_.clear();
|
||||||
std::string savedPass = enc_dlg_saved_passphrase_;
|
std::string savedPass = enc_dlg_saved_passphrase_;
|
||||||
@@ -1307,7 +1307,7 @@ void App::renderEncryptWalletDialog() {
|
|||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Skip", ImVec2(btnW, 40))) {
|
if (ui::material::TactileButton("Skip", ImVec2(btnW, 40))) {
|
||||||
if (!enc_dlg_saved_passphrase_.empty()) {
|
if (!enc_dlg_saved_passphrase_.empty()) {
|
||||||
util::SecureVault::secureZero(&enc_dlg_saved_passphrase_[0],
|
util::SecureVault::secureZero(&enc_dlg_saved_passphrase_[0],
|
||||||
enc_dlg_saved_passphrase_.size());
|
enc_dlg_saved_passphrase_.size());
|
||||||
@@ -1362,7 +1362,7 @@ void App::renderEncryptWalletDialog() {
|
|||||||
strlen(change_new_pass_buf_) >= 8 &&
|
strlen(change_new_pass_buf_) >= 8 &&
|
||||||
strcmp(change_new_pass_buf_, change_confirm_buf_) == 0;
|
strcmp(change_new_pass_buf_, change_confirm_buf_) == 0;
|
||||||
ImGui::BeginDisabled(!valid || encrypt_in_progress_);
|
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_),
|
changePassphrase(std::string(change_old_pass_buf_),
|
||||||
std::string(change_new_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;
|
float btnW = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f;
|
||||||
ImGui::BeginDisabled(!valid || decryptState.inProgress);
|
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_);
|
std::string passphrase(decrypt_pass_buf_);
|
||||||
memset(decrypt_pass_buf_, 0, sizeof(decrypt_pass_buf_));
|
memset(decrypt_pass_buf_, 0, sizeof(decrypt_pass_buf_));
|
||||||
wallet_security_workflow_.start(std::chrono::steady_clock::now());
|
wallet_security_workflow_.start(std::chrono::steady_clock::now());
|
||||||
@@ -1619,7 +1619,7 @@ void App::renderDecryptWalletDialog() {
|
|||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
|
|
||||||
ImGui::SameLine();
|
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_));
|
memset(decrypt_pass_buf_, 0, sizeof(decrypt_pass_buf_));
|
||||||
show_decrypt_dialog_ = false;
|
show_decrypt_dialog_ = false;
|
||||||
}
|
}
|
||||||
@@ -1737,7 +1737,7 @@ void App::renderDecryptWalletDialog() {
|
|||||||
"was saved as wallet.dat.encrypted.bak in your data directory.");
|
"was saved as wallet.dat.encrypted.bak in your data directory.");
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
if (ImGui::Button("Close", ImVec2(-1, 40))) {
|
if (ui::material::TactileButton("Close", ImVec2(-1, 40))) {
|
||||||
show_decrypt_dialog_ = false;
|
show_decrypt_dialog_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1754,11 +1754,11 @@ void App::renderDecryptWalletDialog() {
|
|||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
float btnW = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f;
|
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();
|
wallet_security_workflow_.reset();
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Close", ImVec2(btnW, 40))) {
|
if (ui::material::TactileButton("Close", ImVec2(btnW, 40))) {
|
||||||
show_decrypt_dialog_ = false;
|
show_decrypt_dialog_ = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1814,7 +1814,7 @@ void App::renderPinDialogs() {
|
|||||||
strcmp(pin_buf_, pin_confirm_buf_) == 0;
|
strcmp(pin_buf_, pin_confirm_buf_) == 0;
|
||||||
|
|
||||||
ImGui::BeginDisabled(!valid || pin_in_progress_);
|
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_in_progress_ = true;
|
||||||
pin_status_ = "Verifying passphrase...";
|
pin_status_ = "Verifying passphrase...";
|
||||||
|
|
||||||
@@ -1910,7 +1910,7 @@ void App::renderPinDialogs() {
|
|||||||
strcmp(pin_buf_, pin_confirm_buf_) == 0;
|
strcmp(pin_buf_, pin_confirm_buf_) == 0;
|
||||||
|
|
||||||
ImGui::BeginDisabled(!valid || pin_in_progress_);
|
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_in_progress_ = true;
|
||||||
pin_status_ = "Changing PIN...";
|
pin_status_ = "Changing PIN...";
|
||||||
std::string oldPin(pin_old_buf_);
|
std::string oldPin(pin_old_buf_);
|
||||||
@@ -1969,7 +1969,7 @@ void App::renderPinDialogs() {
|
|||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
bool valid = strlen(pin_old_buf_) >= 4;
|
bool valid = strlen(pin_old_buf_) >= 4;
|
||||||
ImGui::BeginDisabled(!valid || pin_in_progress_);
|
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_in_progress_ = true;
|
||||||
pin_status_ = "Verifying PIN...";
|
pin_status_ = "Verifying PIN...";
|
||||||
std::string oldPin(pin_old_buf_);
|
std::string oldPin(pin_old_buf_);
|
||||||
|
|||||||
@@ -611,7 +611,7 @@ void App::renderFirstRunWizard() {
|
|||||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImGui::ColorConvertU32ToFloat4(ui::material::PrimaryVariant()));
|
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImGui::ColorConvertU32ToFloat4(ui::material::PrimaryVariant()));
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary()));
|
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary()));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp);
|
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
|
// Save appearance choices, advance to Bootstrap
|
||||||
settings_->setAcrylicEnabled(wiz_blur_amount > 0.001f);
|
settings_->setAcrylicEnabled(wiz_blur_amount > 0.001f);
|
||||||
settings_->setAcrylicQuality(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;
|
float cancelBX = rightX + (colW - cancelW) * 0.5f;
|
||||||
ImGui::SetCursorScreenPos(ImVec2(cancelBX, cy));
|
ImGui::SetCursorScreenPos(ImVec2(cancelBX, cy));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp);
|
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();
|
bootstrap_->cancel();
|
||||||
}
|
}
|
||||||
ImGui::PopStyleVar();
|
ImGui::PopStyleVar();
|
||||||
@@ -812,7 +812,7 @@ void App::renderFirstRunWizard() {
|
|||||||
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary()));
|
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary()));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp);
|
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp);
|
||||||
ImGui::BeginDisabled(!supportsFullNodeLifecycleActions());
|
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
|
// Stop embedded daemon before bootstrap to avoid chain data corruption
|
||||||
stopDaemonForBootstrap();
|
stopDaemonForBootstrap();
|
||||||
bootstrap_ = std::make_unique<util::Bootstrap>();
|
bootstrap_ = std::make_unique<util::Bootstrap>();
|
||||||
@@ -826,7 +826,7 @@ void App::renderFirstRunWizard() {
|
|||||||
|
|
||||||
ImGui::SetCursorScreenPos(ImVec2(bx + btnW2 + 12.0f * dp, cy));
|
ImGui::SetCursorScreenPos(ImVec2(bx + btnW2 + 12.0f * dp, cy));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp);
|
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;
|
wizard_phase_ = WizardPhase::EncryptOffer;
|
||||||
}
|
}
|
||||||
ImGui::PopStyleVar();
|
ImGui::PopStyleVar();
|
||||||
@@ -896,7 +896,7 @@ void App::renderFirstRunWizard() {
|
|||||||
IM_COL32(220, 60, 60, 255)));
|
IM_COL32(220, 60, 60, 255)));
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(255, 255, 255, 255));
|
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(255, 255, 255, 255));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp);
|
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_stopping_external_ = true;
|
||||||
wizard_stop_status_ = "Sending stop command...";
|
wizard_stop_status_ = "Sending stop command...";
|
||||||
async_tasks_.submit("wizard-stop-external-daemon", [this](const util::AsyncTaskManager::Token& token) {
|
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::SetCursorScreenPos(ImVec2(bx + stopW + 12.0f * dp, cy));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp);
|
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;
|
wizard_phase_ = WizardPhase::EncryptOffer;
|
||||||
}
|
}
|
||||||
ImGui::PopStyleVar();
|
ImGui::PopStyleVar();
|
||||||
@@ -995,7 +995,7 @@ void App::renderFirstRunWizard() {
|
|||||||
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary()));
|
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary()));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp);
|
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp);
|
||||||
ImGui::BeginDisabled(!supportsFullNodeLifecycleActions());
|
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
|
// Stop embedded daemon before bootstrap to avoid chain data corruption
|
||||||
stopDaemonForBootstrap();
|
stopDaemonForBootstrap();
|
||||||
bootstrap_ = std::make_unique<util::Bootstrap>();
|
bootstrap_ = std::make_unique<util::Bootstrap>();
|
||||||
@@ -1014,7 +1014,7 @@ void App::renderFirstRunWizard() {
|
|||||||
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnSurface()));
|
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnSurface()));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp);
|
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp);
|
||||||
ImGui::BeginDisabled(!supportsFullNodeLifecycleActions());
|
ImGui::BeginDisabled(!supportsFullNodeLifecycleActions());
|
||||||
if (ImGui::Button("Mirror##bs_mirror", ImVec2(mirrorW, btnH2))) {
|
if (ui::material::TactileButton("Mirror##bs_mirror", ImVec2(mirrorW, btnH2))) {
|
||||||
stopDaemonForBootstrap();
|
stopDaemonForBootstrap();
|
||||||
bootstrap_ = std::make_unique<util::Bootstrap>();
|
bootstrap_ = std::make_unique<util::Bootstrap>();
|
||||||
std::string dataDir = util::Platform::getDragonXDataDir();
|
std::string dataDir = util::Platform::getDragonXDataDir();
|
||||||
@@ -1032,7 +1032,7 @@ void App::renderFirstRunWizard() {
|
|||||||
// --- Skip button ---
|
// --- Skip button ---
|
||||||
ImGui::SetCursorScreenPos(ImVec2(bx + dlBtnW + 8.0f * dp + mirrorW + 8.0f * dp, cy));
|
ImGui::SetCursorScreenPos(ImVec2(bx + dlBtnW + 8.0f * dp + mirrorW + 8.0f * dp, cy));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp);
|
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;
|
wizard_phase_ = WizardPhase::EncryptOffer;
|
||||||
}
|
}
|
||||||
ImGui::PopStyleVar();
|
ImGui::PopStyleVar();
|
||||||
@@ -1127,7 +1127,7 @@ void App::renderFirstRunWizard() {
|
|||||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImGui::ColorConvertU32ToFloat4(ui::material::PrimaryVariant()));
|
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImGui::ColorConvertU32ToFloat4(ui::material::PrimaryVariant()));
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary()));
|
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary()));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp);
|
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;
|
wizard_phase_ = WizardPhase::Done;
|
||||||
settings_->setWizardCompleted(true);
|
settings_->setWizardCompleted(true);
|
||||||
settings_->save();
|
settings_->save();
|
||||||
@@ -1310,7 +1310,7 @@ void App::renderFirstRunWizard() {
|
|||||||
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary()));
|
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::material::OnPrimary()));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp);
|
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp);
|
||||||
ImGui::BeginDisabled(!canEncrypt);
|
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
|
// Save passphrase + optional PIN for background processing
|
||||||
wallet_security_.beginDeferredEncryption(
|
wallet_security_.beginDeferredEncryption(
|
||||||
std::string(encrypt_pass_buf_),
|
std::string(encrypt_pass_buf_),
|
||||||
@@ -1341,7 +1341,7 @@ void App::renderFirstRunWizard() {
|
|||||||
|
|
||||||
ImGui::SetCursorScreenPos(ImVec2(bx + encBtnW + 12.0f * dp, cy));
|
ImGui::SetCursorScreenPos(ImVec2(bx + encBtnW + 12.0f * dp, cy));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 8.0f * dp);
|
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;
|
wizard_phase_ = WizardPhase::Done;
|
||||||
settings_->setWizardCompleted(true);
|
settings_->setWizardCompleted(true);
|
||||||
settings_->save();
|
settings_->save();
|
||||||
|
|||||||
@@ -1508,7 +1508,7 @@ void RenderSettingsPage(App* app) {
|
|||||||
TR("lite_servers_network_tab"));
|
TR("lite_servers_network_tab"));
|
||||||
|
|
||||||
ImGui::Dummy(ImVec2(0, Layout::spacingSm()));
|
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;
|
s_settingsState.lite_lifecycle_expanded = !s_settingsState.lite_lifecycle_expanded;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2696,12 +2696,12 @@ void RenderSettingsPage(App* app) {
|
|||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
||||||
float btnW = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f;
|
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;
|
s_settingsState.confirm_rescan = false;
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::BeginDisabled(detecting);
|
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) {
|
if (bootstrapped) {
|
||||||
app->runtimeRescan(s_settingsState.rescan_start_height);
|
app->runtimeRescan(s_settingsState.rescan_start_height);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ public:
|
|||||||
// "No icon" option
|
// "No icon" option
|
||||||
if (showClearIcon) {
|
if (showClearIcon) {
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
if (ImGui::SmallButton(TR("clear_icon"))) {
|
if (material::TactileSmallButton(TR("clear_icon"))) {
|
||||||
s_selectedIcon = -1;
|
s_selectedIcon = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public:
|
|||||||
|
|
||||||
// Max button
|
// Max button
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::SmallButton(TR("max"))) {
|
if (material::TactileSmallButton(TR("max"))) {
|
||||||
snprintf(s_amount, sizeof(s_amount), "%.8f",
|
snprintf(s_amount, sizeof(s_amount), "%.8f",
|
||||||
maxSendableAmount(s_info.fromBalance, s_fee));
|
maxSendableAmount(s_info.fromBalance, s_fee));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1467,7 +1467,7 @@ void ConsoleTab::renderCommandsPopup()
|
|||||||
ImGui::Dummy(ImVec2(0, Layout::spacingXs()));
|
ImGui::Dummy(ImVec2(0, Layout::spacingXs()));
|
||||||
|
|
||||||
// Close button
|
// Close button
|
||||||
if (ImGui::Button(TR("console_close"), ImVec2(-1, 0))) {
|
if (material::TactileButton(TR("console_close"), ImVec2(-1, 0))) {
|
||||||
cmdFilter[0] = '\0';
|
cmdFilter[0] = '\0';
|
||||||
show_commands_popup_ = false;
|
show_commands_popup_ = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1043,7 +1043,7 @@ static void renderBlockDetailModal(App* app) {
|
|||||||
if (s_detail_height > 1) {
|
if (s_detail_height > 1) {
|
||||||
ImGui::PushFont(Type().iconMed());
|
ImGui::PushFont(Type().iconMed());
|
||||||
ImGui::PushID("prevBlock");
|
ImGui::PushID("prevBlock");
|
||||||
if (ImGui::SmallButton(ICON_MD_CHEVRON_LEFT)) {
|
if (material::TactileSmallButton(ICON_MD_CHEVRON_LEFT)) {
|
||||||
if (app->rpc() && app->rpc()->isConnected())
|
if (app->rpc() && app->rpc()->isConnected())
|
||||||
fetchBlockDetail(app, s_detail_height - 1);
|
fetchBlockDetail(app, s_detail_height - 1);
|
||||||
}
|
}
|
||||||
@@ -1057,7 +1057,7 @@ static void renderBlockDetailModal(App* app) {
|
|||||||
if (!s_detail_next_hash.empty()) {
|
if (!s_detail_next_hash.empty()) {
|
||||||
ImGui::PushFont(Type().iconMed());
|
ImGui::PushFont(Type().iconMed());
|
||||||
ImGui::PushID("nextBlock");
|
ImGui::PushID("nextBlock");
|
||||||
if (ImGui::SmallButton(ICON_MD_CHEVRON_RIGHT)) {
|
if (material::TactileSmallButton(ICON_MD_CHEVRON_RIGHT)) {
|
||||||
if (app->rpc() && app->rpc()->isConnected())
|
if (app->rpc() && app->rpc()->isConnected())
|
||||||
fetchBlockDetail(app, s_detail_height + 1);
|
fetchBlockDetail(app, s_detail_height + 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -590,9 +590,9 @@ static void pfDrawAddressSection(App* app)
|
|||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 12.0f * dp);
|
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 12.0f * dp);
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, pillPad);
|
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, pillPad);
|
||||||
ImGui::SetCursorScreenPos(ImVec2(grpX, rowStart.y + (rowH - pillH) * 0.5f));
|
ImGui::SetCursorScreenPos(ImVec2(grpX, rowStart.y + (rowH - pillH) * 0.5f));
|
||||||
if (ImGui::Button(selLbl)) selAllClicked = true;
|
if (material::TactileButton(selLbl)) selAllClicked = true;
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button(clrLbl)) s_pfEdit.addrs.clear();
|
if (material::TactileButton(clrLbl)) s_pfEdit.addrs.clear();
|
||||||
ImGui::PopStyleVar(2);
|
ImGui::PopStyleVar(2);
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::SetCursorScreenPos(ImVec2(ImGui::GetCursorScreenPos().x,
|
ImGui::SetCursorScreenPos(ImVec2(ImGui::GetCursorScreenPos().x,
|
||||||
@@ -825,7 +825,7 @@ static void RenderPortfolioEditor(App* app)
|
|||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
ImGui::Dummy(ImVec2(0, Layout::spacingSm()));
|
ImGui::Dummy(ImVec2(0, Layout::spacingSm()));
|
||||||
// Add immediately creates a persisted "Untitled" group and selects it for editing.
|
// 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.
|
// Adding switches to a new group; uncommitted edits to the current one are discarded.
|
||||||
auto es = settings->getPortfolioEntries();
|
auto es = settings->getPortfolioEntries();
|
||||||
config::Settings::PortfolioEntry ne;
|
config::Settings::PortfolioEntry ne;
|
||||||
@@ -952,11 +952,11 @@ static void RenderPortfolioEditor(App* app)
|
|||||||
material::RightAlignX(grp);
|
material::RightAlignX(grp);
|
||||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + Layout::spacingSm());
|
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + Layout::spacingSm());
|
||||||
ImGui::BeginDisabled(!selDirty);
|
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
|
PortfolioBeginEdit(app, s_pfEdit.sel); // reload the working set from the stored entry
|
||||||
ImGui::SameLine(0, sp);
|
ImGui::SameLine(0, sp);
|
||||||
ImGui::BeginDisabled(s_pfEdit.label[0] == '\0');
|
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();
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
}
|
}
|
||||||
@@ -967,7 +967,7 @@ static void RenderPortfolioEditor(App* app)
|
|||||||
{
|
{
|
||||||
float bh = 40.0f * dp, bw = 120.0f * dp;
|
float bh = 40.0f * dp, bw = 120.0f * dp;
|
||||||
material::RightAlignX(bw);
|
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();
|
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;
|
float mBtnW = body2->CalcTextSizeA(body2->LegacySize, FLT_MAX, 0, ml).x + Layout::spacingMd() * 2;
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
material::RightAlignX(mBtnW);
|
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).
|
// Open the combined editor selecting the first group (or the empty state if none).
|
||||||
PortfolioBeginEdit(app, app->settings()->getPortfolioEntries().empty() ? -1 : 0);
|
PortfolioBeginEdit(app, app->settings()->getPortfolioEntries().empty() ? -1 : 0);
|
||||||
s_pfEdit.open = true;
|
s_pfEdit.open = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user