Fixed grid alignment issue
This commit is contained in:
parent
c75c668bf7
commit
06dd550067
2 changed files with 2 additions and 3 deletions
|
|
@ -24,7 +24,7 @@ void GridScrollArea::layout(const Clay_ElementId& id, const Options& o) {
|
||||||
opts.entryCount = rowCount;
|
opts.entryCount = rowCount;
|
||||||
uint16_t xPadding = 0;
|
uint16_t xPadding = 0;
|
||||||
if(rowCount > 1 || (rowCount == 1 && ((options.entryCount + entriesPerRow) / entriesPerRow) > 1)) // More than 1 row or 1st row is full
|
if(rowCount > 1 || (rowCount == 1 && ((options.entryCount + entriesPerRow) / entriesPerRow) > 1)) // More than 1 row or 1st row is full
|
||||||
xPadding = static_cast<float>(std::max<float>(rowWidth - (entriesPerRow * options.entryWidth), 0) / (entriesPerRow * 2));
|
xPadding = static_cast<float>(std::max<float>(rowWidth - (entriesPerRow * options.entryWidth), 0) / (entriesPerRow + 1));
|
||||||
|
|
||||||
opts.elementContent = [&] (size_t rowIndex) {
|
opts.elementContent = [&] (size_t rowIndex) {
|
||||||
gui.new_id("grid row", [&] {
|
gui.new_id("grid row", [&] {
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,7 @@ void FileSelectScreen::gui_layout_run() {
|
||||||
}
|
}
|
||||||
}) {
|
}) {
|
||||||
CLAY_AUTO_ID({
|
CLAY_AUTO_ID({
|
||||||
.layout = { .sizing = {.width = CLAY_SIZING_FIXED(150), .height = CLAY_SIZING_GROW(0) }},
|
.layout = { .sizing = {.width = CLAY_SIZING_FIXED(150), .height = CLAY_SIZING_FIXED(150) }},
|
||||||
.aspectRatio = { .aspectRatio = 1.0f }
|
|
||||||
}) {
|
}) {
|
||||||
gui.element<ImageDisplay>("ico", ImageDisplay::Data{
|
gui.element<ImageDisplay>("ico", ImageDisplay::Data{
|
||||||
.imgPath = main.conf.configPath / "saveThumbnails" / (fileList[i].fileName + ".jpg"),
|
.imgPath = main.conf.configPath / "saveThumbnails" / (fileList[i].fileName + ".jpg"),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue