Movie list window: correct calculation of movies per screen
authorPhilipp Zabel <philipp.zabel@gmail.com>
Sun, 8 Aug 2010 13:51:08 +0000 (15:51 +0200)
committerPhilipp Zabel <philipp.zabel@gmail.com>
Sun, 8 Aug 2010 14:06:18 +0000 (16:06 +0200)
Factor in search bar visibility.

src/movie-list-window.vala

index 6cc6add..5d702ef 100644 (file)
@@ -268,11 +268,17 @@ public class MovieListWindow : StackableWindow {
 
        private int movies_per_screen () {
                if (portrait_mode) {
-                       // 3x3 full posters or 10 full list items
-                       return movie_list.poster_mode ? 9 : 10;
+                       // 3x3 full posters or 10 full list items,
+                       // 10 full list items in list mode without search bar
+                       return (search_bar_visible || movie_list.poster_mode) ? 9 : 10;
                } else {
-                       // 5x2 posters or 6 list items
-                       return movie_list.poster_mode ? 10 : 6;
+                       if (search_bar_visible) {
+                               // 5x1 full posters or 5 list items
+                               return 5;
+                       } else {
+                               // 5x2 posters or 6 list items
+                               return movie_list.poster_mode ? 10 : 6;
+                       }
                }
        }