Commit 6f92a5f
create folder for backgrounds
Changed files (4)
modifiedbirdfont/GtkWindow.valamodifiedlibbirdfont/BirdFontFile.valamodifiedlibbirdfont/KerningList.valamodifiedlibbirdfont/OverView.vala
Diff
@@ -356,7 +356,7 @@ public class GtkWindow : Gtk.Window, NativeWindow { public void set_scrollbar_position (double position) { scrollbar_supress_signal = true;- scrollbar.adjustment.value = (1 - scrollbar.adjustment.page_size) * position;+ scrollbar.adjustment.value = position * (1 - scrollbar.adjustment.page_size); scrollbar_supress_signal = false; } @@ -702,6 +702,10 @@ class BirdFontFile { data = attr_content; } }++ if (!font.get_backgrounds_folder ().query_exists ()) {+ DirUtils.create ((!) font.get_backgrounds_folder ().get_path (), 0xFFFFFF);+ } img_dir = font.get_backgrounds_folder ().get_child ("parts"); @@ -104,6 +104,10 @@ public class KerningList : FontDisplay { scroll = (int) (pairs - visible_rows); } + if (visible_rows > pairs) {+ scroll = 0;+ } + update_scrollbar (); redraw_area (0, 0, allocation.width, allocation.height); }@@ -791,6 +791,7 @@ public class OverView : FontDisplay { double nrows = 0; double pos = 0; double size;+ double visible_rows; if (rows == 0) { MainWindow.set_scrollbar_size (0);@@ -809,9 +810,11 @@ public class OverView : FontDisplay { nrows = 1; } - scroll_size = rows / (nrows - rows);+ // FIXME: this is not correct+ visible_rows = allocation.height / OverViewItem.height;+ scroll_size = visible_rows / nrows; MainWindow.set_scrollbar_size (scroll_size);- pos = first_visible / (nrows * items_per_row - rows * items_per_row);+ pos = first_visible / (nrows * items_per_row - visible_rows * items_per_row); MainWindow.set_scrollbar_position (pos); } }