feat(ui): migrate Validate-address, Address-label & Contacts modals to reference design
Presentation-only reference-design migration of three more modals: - Validate Address: struct-form overlay (idSuffix validateaddr), 3 StyledButton -> TactileButton, drop the description divider, and TR() the hardcoded "Error: %s" (reuse the existing error_format key). The validateaddress RPC/worker path is untouched. - Address label: struct-form overlay (idSuffix addrlabel); drop the footer divider and zero its layout-reserve term (separatorH) so the fixed-height icon-picker card math stays consistent. Buttons were already TactileButton. - Contacts add/edit: struct-form overlay (keeps its idSuffix + BeginOverlayDialogFooter); StyledButton -> TactileButton across the file (3 modal + 4 contact-list buttons) for a consistent Contacts tab. The address-book add/update/notify logic is untouched. Build + hygiene clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -53,11 +53,13 @@ void ValidateAddressDialog::render(App* app)
|
||||
auto lbl = S.label("dialogs.validate-address", "label");
|
||||
auto closeBtn = S.button("dialogs.validate-address", "close-button");
|
||||
|
||||
if (material::BeginOverlayDialog(TR("validate_title"), &s_open, win.width, 0.94f)) {
|
||||
material::OverlayDialogSpec ov;
|
||||
ov.title = TR("validate_title"); ov.p_open = &s_open;
|
||||
ov.style = material::OverlayStyle::BlurFloat;
|
||||
ov.cardWidth = win.width; ov.idSuffix = "validateaddr";
|
||||
if (material::BeginOverlayDialog(ov)) {
|
||||
ImGui::TextWrapped("%s", TR("validate_description"));
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::Spacing();
|
||||
|
||||
// Address input
|
||||
@@ -74,7 +76,7 @@ void ValidateAddressDialog::render(App* app)
|
||||
ImGui::BeginDisabled();
|
||||
}
|
||||
|
||||
if (material::StyledButton(TR("validate_btn"), ImVec2(valBtn.width, 0), S.resolveFont(valBtn.font)) || (enter_pressed && can_validate)) {
|
||||
if (material::TactileButton(TR("validate_btn"), ImVec2(valBtn.width, 0), S.resolveFont(valBtn.font)) || (enter_pressed && can_validate)) {
|
||||
s_validating = true;
|
||||
s_validated = false;
|
||||
s_error_message.clear();
|
||||
@@ -150,7 +152,7 @@ void ValidateAddressDialog::render(App* app)
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
if (material::StyledButton(TR("paste"), ImVec2(pasteBtn.width, 0), S.resolveFont(pasteBtn.font))) {
|
||||
if (material::TactileButton(TR("paste"), ImVec2(pasteBtn.width, 0), S.resolveFont(pasteBtn.font))) {
|
||||
const char* clipboard = ImGui::GetClipboardText();
|
||||
if (clipboard) {
|
||||
strncpy(s_address_input, clipboard, sizeof(s_address_input) - 1);
|
||||
@@ -174,7 +176,7 @@ void ValidateAddressDialog::render(App* app)
|
||||
ImGui::Spacing();
|
||||
|
||||
if (!s_error_message.empty()) {
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.3f, 0.3f, 1.0f), "Error: %s", s_error_message.c_str());
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.3f, 0.3f, 1.0f), TR("error_format"), s_error_message.c_str());
|
||||
} else {
|
||||
// Valid/Invalid indicator
|
||||
ImGui::Text("%s", TR("validate_status"));
|
||||
@@ -210,7 +212,7 @@ void ValidateAddressDialog::render(App* app)
|
||||
// Close button at bottom
|
||||
float button_width = closeBtn.width;
|
||||
ImGui::SetCursorPosX((ImGui::GetWindowWidth() - button_width) / 2.0f);
|
||||
if (material::StyledButton(TR("close"), ImVec2(button_width, 0), S.resolveFont(closeBtn.font))) {
|
||||
if (material::TactileButton(TR("close"), ImVec2(button_width, 0), S.resolveFont(closeBtn.font))) {
|
||||
s_open = false;
|
||||
}
|
||||
material::EndOverlayDialog();
|
||||
|
||||
Reference in New Issue
Block a user