The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Drop help texts

These changes was commited to the Birdfont repository Sat, 08 Oct 2016 15:45:48 +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>
Sat, 08 Oct 2016 15:45:48 +0000 (17:45 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sat, 08 Oct 2016 15:45:48 +0000 (17:45 +0200)
commit e6b5ede3c12fa98df30ed92f09cde95d9dc99a65
tree ea7c385afa29e266034a9cbd4e64401b9e0f606c
parent a661ec6610a6697ea26b01707df774e84ddc8fa4
Drop help texts

libbirdfont/Help.vala [deleted ]
libbirdfont/KerningDisplay.vala
libbirdfont/LayerLabel.vala
libbirdfont/Menu.vala
libbirdfont/TabContent.vala
libbirdfont/Tool.vala
libbirdfont/ToolItem.vala
diff --git libbirdfont/Help.vala(deleted)
--- a/libbirdfont/Help.vala +++ /dev/null @@ -1,124 +1,1 @@ - /* - Copyright (C) 2016 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 - published by the Free Software Foundation; either version 3 of the - License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - */ - - using Cairo; - - namespace BirdFont { - - public class Help { - - bool visible; - TextArea help_text; - Text close; - const int box_margin = 7; - - public Help () { - string v = Preferences.get ("help_visible"); - visible = v == "true"; - help_text = create_help_text (t_("BirdFont is a font editor.")); - - Color color = Theme.get_color ("Menu Foreground"); - close = new Text ("close", 30, 0, color); - close.load_font ("icons.bf"); - } - - public static TextArea create_help_text (string lines) { - Color color = Theme.get_color ("Menu Foreground"); - TextArea text = new TextArea (17, color); - text.min_width = 200; - text.min_height = 100; - text.width = 200; - text.height = 100; - text.allocation = new WidgetAllocation.for_area (0, 0, (int)text.min_width, (int)text.min_height); - text.set_text (lines); - text.layout (); - text.set_editable (false); - text.draw_border = false; - return text; - } - - public void set_help_text (TextArea text) { - if (text != help_text && is_visible ()) { - help_text = text; - GlyphCanvas.redraw (); - } - } - - public void set_visible (bool v) { - visible = v; - Preferences.set ("help_visible", @"$v"); - } - - public bool is_visible () { - return visible; - } - - public void draw (Context cr, WidgetAllocation allocation) { - int margin_x = 10; - int margin_y = 15; - - help_text.allocation = allocation; - help_text.widget_x = allocation.width - help_text.width - margin_x; - help_text.widget_y = allocation.height - help_text.height - margin_y; - - draw_box (cr, allocation); - - help_text.draw (cr); - - double close_x = allocation.width; - close_x -= close.get_sidebearing_extent (); - close_x -= margin_x; - close_x -= box_margin; - - double close_y = allocation.height; - close_y -= help_text.height; - close_y -= margin_y; - close_y -= 2 * box_margin; - - close.widget_x = close_x; - close.widget_y = close_y; - close.draw (cr); - } - - public bool button_press (uint button, double x, double y) { - if (close.widget_x < x < close.widget_x + close.get_sidebearing_extent () - && close.widget_y < y < close.widget_y + close.font_size) { - - set_visible (false); - GlyphCanvas.redraw (); - return true; - } - - return false; - } - - public void draw_box (Context cr, WidgetAllocation allocation) { - cr.save(); - - Theme.color (cr, "Menu Background"); - double x, y, w, h; - x = help_text.widget_x - 2 * box_margin; - y = help_text.widget_y - 2 * box_margin; - w = help_text.width + 2 * box_margin; - h = help_text.height + 2 * box_margin; - Widget.draw_rounded_rectangle (cr, x, y, w, h, 7); - cr.fill (); - - cr.restore(); - } - - } - - }
--- a/libbirdfont/KerningDisplay.vala +++ b/libbirdfont/KerningDisplay.vala @@ -60,8 +60,6 @@ redo_items = new Gee.ArrayList <UndoItem> (); w.set_otf_tags (KerningTools.get_otf_tags ()); first_row.add (w); - - description = Help.create_help_text (t_("Kerning is the process of adjusting the space between two letters. You can cahnge the space between one letter and all other letters in the spacing tab.")); } public GlyphSequence get_first_row () {
--- a/libbirdfont/LayerLabel.vala +++ b/libbirdfont/LayerLabel.vala @@ -32,10 +32,6 @@ public LayerLabel (Layer layer) { base (); - - if (help_text_hide == null) { - update_description (); - } this.layer = layer; this.label = layer.name; @@ -85,13 +81,6 @@ MainWindow.get_toolbox ().update_expanders (); redraw (); - } - - if (y <= ty <= y + h) { - if (tx < 25 && help_text_hide != null) { - Help help = MainWindow.get_help (); - help.set_help_text ((!) help_text_hide); - } } return false; @@ -101,14 +90,9 @@ active_layer = false; }); } - - void update_description () { - help_text_hide = Help.create_help_text (t_("Hide the layer.")); - } - + public override void clear_cache () { base.clear_cache (); - update_description (); } void move_layer_up () {
--- a/libbirdfont/Menu.vala +++ b/libbirdfont/Menu.vala @@ -493,15 +493,6 @@ show_menu = false; }); menu.items.add (version); - - MenuItem help = add_menu_item (t_("Help"), "help"); - help.action.connect (() => { - Help help_box = MainWindow.get_help (); - help_box.set_visible (!help_box.is_visible ()); - GlyphCanvas.redraw (); - show_menu = false; - }); - menu.items.add (help); set_current_menu (menu); top_menu = menu;
--- a/libbirdfont/TabContent.vala +++ b/libbirdfont/TabContent.vala @@ -119,12 +119,6 @@ if (MainWindow.has_scrollbar()) { MainWindow.scrollbar.draw (cr, allocation, scollbar_width); } - } - - Help help = MainWindow.get_help (); - - if (help.is_visible ()) { - help.draw (cr, allocation); } } @@ -243,12 +237,6 @@ } last_press_time = GLib.get_real_time (); - - Help help = MainWindow.get_help (); - - if (help.button_press (button, x, y)) { - return; // event consumed by help text - } if (MainWindow.get_dialog ().visible) { MainWindow.get_dialog ().button_press (button, x, y);
--- a/libbirdfont/Tool.vala +++ b/libbirdfont/Tool.vala @@ -125,14 +125,6 @@ panel_move_action.connect ((self, x, y) => { if (is_active ()) { wait_for_tooltip (); - - Help help_box = MainWindow.get_help (); - - if (help == null) { - help = update_help (); - } - - help_box.set_help_text ((!) help); redraw (); } return false; @@ -141,21 +133,6 @@ public virtual void clear_cache () { help = null; - } - - public TextArea? update_help () { - string t = get_tip (); - string description = t; - - if (t != "" && extented_description != "") { - description += "\n\n"; - } - - if (extented_description != "") { - description += extented_description; - } - - return Help.create_help_text (description); } public virtual string get_tip () {
--- a/libbirdfont/ToolItem.vala +++ b/libbirdfont/ToolItem.vala @@ -25,7 +25,6 @@ set { base.modifiers = value; - tool.update_help (); } } @@ -36,7 +35,6 @@ set { base.key = value; - tool.update_help (); } }