Commit 405d159
bugfix: correct number of items per row in overview
Changed files (2)
Diff
@@ -144,7 +144,11 @@ class Glyph : FontDisplay { public Path? get_active_path () { return_if_fail (!is_null(active_paths));- return_if_fail (!is_null(active_paths.last ()));+ + if (!is_null(active_paths.last ())) {+ return null;+ }+ return active_paths.last ().data; } @@ -303,13 +303,15 @@ class OverView : FontDisplay { cr.save (); cr.set_line_width (1); - x = 20;+ x = 0; cr.set_font_size (14); left_margin = 0;+ + print (@"items_per_row: $items_per_row \n"); - while (x < width) {+ for (int j = 0; j < items_per_row; j++) { if (all_avail) { if (! (0 <= index < f.length ())) {@@ -446,9 +448,11 @@ class OverView : FontDisplay { scrollbar.draw (cr, allocation); } - n_items = ((allocation.width - 15) / nail_width);+ n_items = ((allocation.width - 40) / nail_width); rows = (allocation.height / nail_height); + print (@"n_items: $n_items (2)\n");+ if (items_per_row != n_items) { if (items_per_row == 0) { items_per_row = n_items;@@ -470,10 +474,10 @@ class OverView : FontDisplay { y = 0; t = first_visible; i = 0;- while (y < allocation.height + nail_height) {+ for (int j = 0; j < rows + 1; j++) { draw_caption (i, width, cr, y, t); - t += (allocation.width / nail_width);+ t += items_per_row; y += nail_height; i++; }@@ -871,14 +875,16 @@ class OverView : FontDisplay { unichar current = selected; // click in margin- int n_items = (allocation.width / nail_width);- double m = (allocation.width - (n_items * nail_width)) / 2.0;+ int n_items = (allocation.width - 40 / nail_width);+ double m = (allocation.width - 40 - (n_items * nail_width)) / 2.0; bool menu_action = false; Font f; uint len; + print (@"n_items: $n_items\n");+ if (all_avail) { f = Supplement.get_current_font (); len = f.length ();