feat(wallets): subtle empty-state hint in the fixed-height list

With the list now pinned at max height, a few wallets leave blank space below
the cards. Fill it — only when there's real room to spare — with a subtle
centered folder glyph + "Scan a folder to find more wallets" (OnSurfaceDisabled),
so the area reads as a gentle nudge toward the scan action rather than dead
space. Purely decorative (draw-list only, clipped to the list); the actions stay
below. New i18n key wallets_empty_hint, translated across all 8 languages.

Verified on the sweep: the hint centers in the gap and reads subtly on both dark
and light themes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-12 07:17:34 -05:00
parent 6310f51f65
commit 2f86bec98e
12 changed files with 41 additions and 0 deletions

View File

@@ -386,6 +386,28 @@ public:
ImGui::Dummy(ImVec2(rowW, walRowH));
if (i + 1 < s_rows.size()) ImGui::Dummy(ImVec2(rowW, cardGap));
}
// Empty-state nudge: the list sits at a fixed max height, so a handful of wallets leave blank
// space below. When there's real room to spare, fill it with a subtle centered hint (a folder
// glyph + one line) instead of dead space; it's purely decorative — the actions live below.
{
const float remainY = ImGui::GetContentRegionAvail().y;
if (remainY > walRowH * 1.6f) {
ImDrawList* wdl = ImGui::GetWindowDrawList();
ImFont* hIco = Type().iconLarge();
ImFont* hTxt = Type().caption();
const char* icon = ICON_MD_CREATE_NEW_FOLDER;
const char* hint = TR("wallets_empty_hint");
const ImU32 col = OnSurfaceDisabled();
const ImVec2 is = hIco->CalcTextSizeA(hIco->LegacySize, FLT_MAX, 0, icon);
const ImVec2 ts = hTxt->CalcTextSizeA(hTxt->LegacySize, FLT_MAX, 0, hint);
const float gap = Layout::spacingXs();
const ImVec2 o = ImGui::GetCursorScreenPos();
const float cx = o.x + ImGui::GetContentRegionAvail().x * 0.5f;
const float top = o.y + (remainY - (is.y + gap + ts.y)) * 0.5f;
wdl->AddText(hIco, hIco->LegacySize, ImVec2(cx - is.x * 0.5f, top), col, icon);
wdl->AddText(hTxt, hTxt->LegacySize, ImVec2(cx - ts.x * 0.5f, top + is.y + gap), col, hint);
}
}
ImGui::PopStyleVar(); // ItemSpacing
ImGui::EndChild();

View File

@@ -289,6 +289,7 @@ void I18n::loadBuiltinEnglish()
strings_["wallets_scan_folder"] = "Scan another folder for wallets\xE2\x80\xA6";
strings_["wallets_scanned_folders"] = "Scanned folders:";
strings_["wallets_remove_folder"] = "Stop scanning this folder";
strings_["wallets_empty_hint"] = "Scan a folder to find more wallets";
strings_["wallets_folder_invalid"] = "That folder doesn't exist.";
strings_["wallets_new_label"] = "Create a new wallet:";
strings_["wallets_new_hint"] = "Name (e.g. savings)";