The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Select all glyphs in overview tab

These changes was commited to the Birdfont repository Wed, 26 Aug 2015 17:15:57 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Wed, 26 Aug 2015 17:15:57 +0000 (19:15 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Wed, 26 Aug 2015 17:15:57 +0000 (19:15 +0200)
commit 0bfb5e2fd4592ae21423c90173e24e9ceaf2412f
tree f0f195e9b180f228ad15770dccdb5115ad5bbcef
parent 7473f67b23d802feed988677547b93daf9b08135
Select all glyphs in overview tab

libbirdfont/BackgroundImage.vala
libbirdfont/Menu.vala
libbirdfont/OverView.vala
--- a/libbirdfont/BackgroundImage.vala +++ b/libbirdfont/BackgroundImage.vala @@ -687,7 +687,6 @@ double trace_resolution = DrawingTools.auto_trace_resolution.get_value (); double threshold = DrawingTools.background_threshold.get_value (); - double simplification = DrawingTools.auto_trace_simplify.get_value (); thres = (threshold - 0.5) * 255;
--- a/libbirdfont/Menu.vala +++ b/libbirdfont/Menu.vala @@ -137,6 +137,13 @@ show_menu = false; }); edit_menu.items.add (select_all_paths); + + MenuItem select_all_glyphs = add_menu_item (t_("Select All Glyphs"), "select all glyphs", "Overview"); + select_all_glyphs.action.connect (() => { + MainWindow.get_overview ().select_all_glyphs (); + show_menu = false; + }); + edit_menu.items.add (select_all_glyphs); MenuItem move_to_baseline = add_menu_item (t_("Move To Baseline"), "move to baseline", "Glyph"); move_to_baseline.action.connect (() => {
--- a/libbirdfont/OverView.vala +++ b/libbirdfont/OverView.vala @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 2014 Johan Mattsson + Copyright (C) 2012 2014 2015 Johan Mattsson This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -123,6 +123,26 @@ update_scrollbar (); reset_zoom (); update_item_list (); + } + + public void select_all_glyphs () { + Font f; + GlyphCollection? glyphs; + + f = BirdFont.get_current_font (); + + for (int index = 0; index < f.length (); index++) { + glyphs = f.get_glyph_collection_indice ((uint32) index); + return_if_fail (glyphs != null); + + selected_items.add ((!) glyphs); + } + + foreach (OverViewItem item in visible_items) { + item.selected = item.glyphs != null; + } + + GlyphCanvas.redraw (); } public void use_default_character_set () {