Commit 42cf90e
Initialize overview
Changed files (5)
modifiedbirdfont/Main.valamodifiedlibbirdfont/GlyphRange.valamodifiedlibbirdfont/MainWindow.valamodifiedlibbirdfont/OverView.valamodifiedlibbirdfont/RecentFiles.vala
Diff
@@ -34,7 +34,7 @@ public static int main (string[] arg) { native_window.init (); birdfont.load_font_from_command_line ();-+ Gtk.main (); return 0; }@@ -509,6 +509,10 @@ public class GlyphRange { stdout.printf (get_all_ranges ()); stdout.printf ("\n"); }+ + public string to_string () {+ return get_all_ranges ();+ } } }@@ -207,7 +207,7 @@ public class MainWindow : GLib.Object { over_view = new OverView(); tabs.add_unique_tab (over_view); - + return over_view; } @@ -98,6 +98,7 @@ public class OverView : FontDisplay { idle.set_callback (() => { selected_canvas ();+ use_default_character_set (); return false; }); @@ -108,6 +109,15 @@ public class OverView : FontDisplay { update_item_list (); } + public void use_default_character_set () {+ GlyphRange gr = new GlyphRange ();+ all_available = false;+ DefaultCharacterSet.use_default_range (gr);+ set_glyph_range (gr);+ OverviewTools.update_overview_characterset ();+ FontDisplay.dirty_scrollbar = true;+ }+ public GlyphCollection create_new_glyph (unichar character) { StringBuilder name = new StringBuilder (); TabBar tabs = MainWindow.get_tab_bar ();@@ -280,6 +290,16 @@ public class OverView : FontDisplay { update_item_list (); selected_item = get_selected_item (); GlyphCanvas.redraw ();++ IdleSource idle = new IdleSource ();++ idle.set_callback (() => { + use_default_character_set ();+ GlyphCanvas.redraw ();+ return false;+ });+ + idle.attach (null); } public void update_zoom_bar () {@@ -419,7 +439,7 @@ public class OverView : FontDisplay { visible_items.clear (); visible_items = new Gee.ArrayList<OverViewItem> ();- + // update item list index = (uint32) first_visible; x = OverViewItem.margin;@@ -479,7 +499,7 @@ public class OverView : FontDisplay { foreach (OverViewItem i in visible_items) { i.y += view_offset_y; i.x += view_offset_x;- }+ } } public override void draw (WidgetAllocation allocation, Context cr) {@@ -192,6 +192,11 @@ public class RecentFiles : Table { selected_canvas (); } + public override void draw (WidgetAllocation allocation, Context cr) {+ MainWindow.get_overview ().allocation = allocation;+ base.draw (allocation, cr);+ }+ public static void load_font (string fn) { Font font; SaveDialogListener dialog = new SaveDialogListener ();