summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2017-04-07 16:08:59 +0200
committerraveit65 <[email protected]>2017-04-19 22:23:09 +0200
commit26a0aa2823f6411916f5ad37437bb797cf2cff26 (patch)
tree91928f30bf2b0c72142f4c80d5ead92cfcf850cc
parent3481a5408f08580e2484d50b3a2914c4913e852a (diff)
downloadcaja-26a0aa2823f6411916f5ad37437bb797cf2cff26.tar.bz2
caja-26a0aa2823f6411916f5ad37437bb797cf2cff26.tar.xz
Expand grid width to canvas
Minimum of one column taken from: https://github.com/linuxmint/nemo/commit/78d4a4f https://github.com/linuxmint/nemo/commit/21ea094 fix
-rw-r--r--libcaja-private/caja-icon-container.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c
index 1a92caec..a6064905 100644
--- a/libcaja-private/caja-icon-container.c
+++ b/libcaja-private/caja-icon-container.c
@@ -1356,6 +1356,7 @@ lay_down_icons_horizontal (CajaIconContainer *container,
double max_text_width, max_icon_width;
int icon_width;
int i;
+ int num_columns;
GtkAllocation allocation;
g_assert (CAJA_IS_ICON_CONTAINER (container));
@@ -1390,7 +1391,11 @@ lay_down_icons_horizontal (CajaIconContainer *container,
}
else
{
- grid_width = STANDARD_ICON_GRID_WIDTH;
+ num_columns = floor(canvas_width / STANDARD_ICON_GRID_WIDTH);
+ num_columns = fmax(num_columns, 1);
+ /* Minimum of one column */
+ grid_width = canvas_width / num_columns - 1;
+ /* -1 prevents jitter */
}
gridded_layout = !caja_icon_container_is_tighter_layout (container);