From e1df5ea798132c5474db47aaedf08c3b2aefbb06 Mon Sep 17 00:00:00 2001 From: DanS Date: Wed, 15 Jul 2026 09:43:23 -0500 Subject: [PATCH] feat(image-picker): thumbnails fill width at 6 per row Fix the thumbnail grid to a constant 6 columns whose square cells scale to the available width, instead of fixed 96px cells that left dead space on the right. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/ui/windows/image_picker.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/windows/image_picker.h b/src/ui/windows/image_picker.h index c023c47..f67b898 100644 --- a/src/ui/windows/image_picker.h +++ b/src/ui/windows/image_picker.h @@ -207,12 +207,12 @@ public: if (!s_images.empty()) ImGui::Dummy(ImVec2(0, Layout::spacingSm())); // gap before the thumbnails } - // Thumbnail grid. + // Thumbnail grid: a fixed 6 columns whose square cells scale to fill the width. { const float availW = ImGui::GetContentRegionAvail().x; - const float cell = 96.0f * dp; const float gap = Layout::spacingSm(); - const int cols = std::max(1, (int)((availW + gap) / (cell + gap))); + const int cols = 6; + const float cell = std::max(24.0f * dp, (availW - gap * (cols - 1)) / (float)cols); int col = 0; for (std::size_t i = 0; i < s_images.size(); ++i) { if (col != 0) ImGui::SameLine(0, gap);