[KPhotoAlbum] Cleaning up thumbnail view when the selection is small

Robert L Krawitz rlk at alum.mit.edu
Sun Feb 12 02:19:57 GMT 2006


This change ensures that the entire grid is drawn even if the number
of active images is very small.  Currently the bottom-most partial row
of the grid isn't drawn; what I see is 6 rows of grid squares (some of
which aren't populated), with no grid lines at the bottom, which looks
annoying.  You might want to do this differently or toss it out.

Index: ThumbnailView/ThumbnailView.cpp
===================================================================
--- ThumbnailView/ThumbnailView.cpp     (revision 508519)
+++ ThumbnailView/ThumbnailView.cpp     (working copy)
@@ -296,7 +302,7 @@
 void ThumbnailView::ThumbnailView::updateGridSize()
 {
     int thumbnailsPerRow = width() / cellWidth();
-    int numRowsPerPage = height() / cellHeight();
+    int numRowsPerPage = (height() + cellHeight() - 1) / cellHeight();
     setNumCols( thumbnailsPerRow );
     setNumRows( QMAX( numRowsPerPage, (int) ceil( 1.0 * _imageList.size() / thumbnailsPerRow ) ) );
 }




More information about the Kphotoalbum mailing list