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:
@@ -129,8 +129,12 @@ void RenderContactsTab(App* app)
|
||||
float actionGap = actionBtn.gap > 0 ? actionBtn.gap : Layout::kDialogActionGap();
|
||||
float notesH = notesInput.height > 0 ? notesInput.height : 60.0f;
|
||||
|
||||
if (material::BeginOverlayDialog(title, open, dialogW, 0.94f,
|
||||
Layout::kDialogCompactBottomRatio(), id)) {
|
||||
material::OverlayDialogSpec ov;
|
||||
ov.title = title; ov.p_open = open;
|
||||
ov.style = material::OverlayStyle::BlurFloat;
|
||||
ov.cardWidth = dialogW; ov.idSuffix = id;
|
||||
ov.cardBottomViewportRatio = Layout::kDialogCompactBottomRatio();
|
||||
if (material::BeginOverlayDialog(ov)) {
|
||||
// Focus the first field the frame the dialog opens so it's keyboard-ready.
|
||||
if (s_focus_edit_field) {
|
||||
ImGui::SetKeyboardFocusHere();
|
||||
@@ -145,7 +149,7 @@ void RenderContactsTab(App* app)
|
||||
s_edit_address, sizeof(s_edit_address), formW);
|
||||
if (!isEdit) {
|
||||
ImGui::SameLine();
|
||||
if (material::StyledButton(TR("paste"), ImVec2(0,0), S.resolveFont(actionBtn.font))) {
|
||||
if (material::TactileButton(TR("paste"), ImVec2(0,0), S.resolveFont(actionBtn.font))) {
|
||||
const char* clipboard = ImGui::GetClipboardText();
|
||||
if (clipboard) copyEditField(s_edit_address, sizeof(s_edit_address), clipboard);
|
||||
}
|
||||
@@ -167,7 +171,7 @@ void RenderContactsTab(App* app)
|
||||
if (!canSubmit) ImGui::BeginDisabled();
|
||||
|
||||
const char* primaryLabel = isEdit ? TR("save") : TR("add");
|
||||
if (material::StyledButton(primaryLabel, ImVec2(actionW, 0), S.resolveFont(actionBtn.font))) {
|
||||
if (material::TactileButton(primaryLabel, ImVec2(actionW, 0), S.resolveFont(actionBtn.font))) {
|
||||
// Trim the label/address (a pasted address often carries a trailing newline); keep notes as-is.
|
||||
auto trimAB = [](std::string s) {
|
||||
while (!s.empty() && (s.front()==' '||s.front()=='\t'||s.front()=='\n'||s.front()=='\r')) s.erase(s.begin());
|
||||
@@ -198,7 +202,7 @@ void RenderContactsTab(App* app)
|
||||
if (!canSubmit) ImGui::EndDisabled();
|
||||
|
||||
ImGui::SameLine(0, actionGap);
|
||||
if (material::StyledButton(TR("cancel"), ImVec2(actionW, 0), S.resolveFont(actionBtn.font))) {
|
||||
if (material::TactileButton(TR("cancel"), ImVec2(actionW, 0), S.resolveFont(actionBtn.font))) {
|
||||
*open = false;
|
||||
}
|
||||
|
||||
@@ -212,7 +216,7 @@ void RenderContactsTab(App* app)
|
||||
ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoScrollbar);
|
||||
|
||||
// Toolbar
|
||||
if (material::StyledButton(TR("address_book_add_new"), ImVec2(0,0), S.resolveFont(actionBtn.font))) {
|
||||
if (material::TactileButton(TR("address_book_add_new"), ImVec2(0,0), S.resolveFont(actionBtn.font))) {
|
||||
s_show_add_dialog = true;
|
||||
s_focus_edit_field = true;
|
||||
clearEditFields();
|
||||
@@ -222,7 +226,7 @@ void RenderContactsTab(App* app)
|
||||
|
||||
if (!has_selection) ImGui::BeginDisabled();
|
||||
|
||||
if (material::StyledButton(TR("edit"), ImVec2(0,0), S.resolveFont(actionBtn.font)))
|
||||
if (material::TactileButton(TR("edit"), ImVec2(0,0), S.resolveFont(actionBtn.font)))
|
||||
openEdit();
|
||||
|
||||
ImGui::SameLine();
|
||||
@@ -230,12 +234,12 @@ void RenderContactsTab(App* app)
|
||||
// Delete — relabel to a visible confirm prompt while armed (not just a toast).
|
||||
bool armed = has_selection && s_confirm_delete_idx == s_selected_index;
|
||||
const char* delLabel = armed ? TR("address_book_confirm_delete") : TR("delete");
|
||||
if (material::StyledButton(delLabel, ImVec2(0,0), S.resolveFont(actionBtn.font)))
|
||||
if (material::TactileButton(delLabel, ImVec2(0,0), S.resolveFont(actionBtn.font)))
|
||||
doDelete();
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
if (material::StyledButton(TR("copy_address"), ImVec2(0,0), S.resolveFont(actionBtn.font)))
|
||||
if (material::TactileButton(TR("copy_address"), ImVec2(0,0), S.resolveFont(actionBtn.font)))
|
||||
doCopy();
|
||||
|
||||
if (!has_selection) ImGui::EndDisabled();
|
||||
|
||||
Reference in New Issue
Block a user