refactor(ui): add material::LabeledInput helper + adopt at 8 form fields
UI-standardization audit: the labeled single-line form field (a plain ImGui::Text label above a fixed-width InputText/InputTextWithHint) was open-coded across dialogs. Add material::LabeledInput(label, id, buf, size, width=-1, hint=nullptr, flags=0) mirroring that idiom exactly — pixel-identical, but a single chokepoint so input styling (label typography, frame, spacing) can later evolve in one place. Returns the input's edited bool. Adopt at the clean vertical (label-above) single-line sites: address-book add/edit (label + address), shield from-address, export-all-keys + export- transactions filename, validate-address input, request-payment label + URI. Left as-is: horizontal label-beside-input rows (settings RPC host/port/user/ pass use Text + SameLine), multiline (InputTextMultiline), numeric (InputDouble), combos, and hint-only inputs — none match the vertical single-line idiom. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -61,10 +61,9 @@ void ValidateAddressDialog::render(App* app)
|
||||
ImGui::Spacing();
|
||||
|
||||
// Address input
|
||||
ImGui::Text("%s", TR("address_label"));
|
||||
ImGui::SetNextItemWidth(-1);
|
||||
bool enter_pressed = ImGui::InputText("##ValidateAddr", s_address_input, sizeof(s_address_input),
|
||||
ImGuiInputTextFlags_EnterReturnsTrue);
|
||||
bool enter_pressed = material::LabeledInput(TR("address_label"), "##ValidateAddr", s_address_input,
|
||||
sizeof(s_address_input), -1.0f, nullptr,
|
||||
ImGuiInputTextFlags_EnterReturnsTrue);
|
||||
|
||||
ImGui::Spacing();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user