Calculate optimum number of columns for table
adloconwy at gmail.com
Mon Sep 7 17:15:51 CEST 2015
I am writing a program that displays previews of all open windows in a grid/table. Depending on factors such as the dimensions of the grid and the number of previews displayed, it would be useful to dynamically change the number of columns/rows in the grid, in order to ensure that the previews are as large as possible while making the best use of the available space.
For example, when there are only a few previews, the number of columns and rows can be reduced in order to ensure that the previews are as large as possible. However, if there are a lot of previews and there is some extra horizontal space, the number of columns should be increased.
It would be useful to have an algorithm that could calculate the optimum number of columns. Does anyone have any ideas?
More information about the Xfce4-dev