From: Johan Mattsson Date: Sat, 09 May 2015 12:23:05 +0000 Subject: Default character set in glyph selection X-Git-Url: https://birdfont.org/gitphp-glip/index.php?p=birdfont.git&a=commitdiff&h=85dd509039708912e87fa59d25fe2abb21c3dc33 --- Default character set in glyph selection --- --- a/libbirdfont/GlyphSelection.vala +++ b/libbirdfont/GlyphSelection.vala @@ -20,7 +20,17 @@ public GlyphSelection () { base (null, false); - display_all_available_glyphs (); + + if (BirdFont.get_current_font ().length () > 0) { + display_all_available_glyphs (); + } else { + GlyphRange gr = new GlyphRange (); + DefaultCharacterSet.use_default_range (gr); + set_glyph_range (gr); + } + + OverviewTools.update_overview_characterset (this); + FontDisplay.dirty_scrollbar = true; open_glyph_signal.connect ((gc) => { selected_glyph (gc); --- a/libbirdfont/OverviewTools.vala +++ b/libbirdfont/OverviewTools.vala @@ -101,11 +101,11 @@ all_glyphs.select_action (all_glyphs); } - public static void update_overview_characterset () { + public static void update_overview_characterset (OverView? tab = null) { GlyphRange gr; uint size; OverView overview; - + // All characters size = BirdFont.get_current_font ().length (); all_glyphs.number = get_display_value (size); @@ -122,7 +122,7 @@ size = gr.get_length (); unicode.number = get_display_value (size); - overview = MainWindow.get_overview (); + overview = (tab == null) ? MainWindow.get_overview () : (!) tab; // set selected item all_glyphs.set_selected (false);