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);