From c25da0d26d26ebd3618f4884037aabcc55a18f5e Mon Sep 17 00:00:00 2001 From: DanS Date: Mon, 13 Jul 2026 16:04:23 -0500 Subject: [PATCH] feat(settings): stack the rescan slider above the height field Lay the optional scan-from-height control out vertically: the send-tab-style slider spans the full row on top, with the numeric field full-width directly beneath it (both were previously side by side). Reads more clearly and gives the slider room; the unsynced fallback (field only) is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/app.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/app.cpp b/src/app.cpp index 62a4a1b..1cde3c2 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -2762,9 +2762,10 @@ static std::string formatIntWithCommas(long long v) } // A send-tab-style slider (mirrors RenderAmountBar in send_tab.cpp: rounded track, accent fill, glass -// thumb) for the optional rescan start height, paired with a numeric field for exact entry. Both share -// `buf` — the height as a decimal string — so it's the single source of truth. `tipHeight` is the chain -// tip = the slider's max; when <= 0 (height unknown) the slider is omitted and the field spans the row. +// thumb) for the optional rescan start height, stacked above a full-width numeric field for exact +// entry. Both share `buf` — the height as a decimal string — so it's the single source of truth. +// `tipHeight` is the chain tip = the slider's max; when <= 0 (height unknown) the slider is omitted +// and only the field shows. static void RenderScanHeightControl(char* buf, size_t bufSize, int tipHeight, bool enabled, float dp) { namespace m = ui::material; @@ -2773,13 +2774,9 @@ static void RenderScanHeightControl(char* buf, size_t bufSize, int tipHeight, bo ImGui::BeginDisabled(!enabled); - const float inputW = 148.0f * dp; if (tipHeight > 0) { - const float gap = ui::Layout::spacingSm(); - float barW = ImGui::GetContentRegionAvail().x - inputW - gap; - const float minBar = 120.0f * dp; - if (barW < minBar) barW = minBar; - const float barH = ImGui::GetFrameHeight(); // match the numeric field's height so the two align (already dp-scaled) + const float barW = ImGui::GetContentRegionAvail().x; // slider spans the full row, stacked above the field + const float barH = ImGui::GetFrameHeight(); // match the numeric field's height (already dp-scaled) const float barRound = barH * 0.5f; const float thumbR = barH * 0.5f; @@ -2817,11 +2814,10 @@ static void RenderScanHeightControl(char* buf, size_t bufSize, int tipHeight, bo m::Tooltip("%s / %s (%.0f%%)", formatIntWithCommas(cur).c_str(), formatIntWithCommas(tipHeight).c_str(), pct * 100.0f); } - ImGui::SameLine(0, gap); } - // Exact numeric entry — fills the remaining row (or the whole row when there's no slider). - ImGui::SetNextItemWidth(tipHeight > 0 ? inputW : ImGui::GetContentRegionAvail().x); + // Exact numeric entry — full-width row beneath the slider. + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); ImGui::InputText("##importscanheight", buf, bufSize, ImGuiInputTextFlags_CharsDecimal); ImGui::EndDisabled();