The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Fix text input in spacing tab

These changes was commited to the Birdfont repository Thu, 26 Mar 2015 08:03:05 +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>
Thu, 26 Mar 2015 08:03:05 +0000 (09:03 +0100)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Thu, 26 Mar 2015 08:03:05 +0000 (09:03 +0100)
commit 22062f2665c800610fdc50506c28e9b06ab24e43
tree 7e204e0c447642541abd8a6473632af65345aac5
parent 4887184e2145bcffe3543465c77ea46bc517d41f
Fix text input in spacing tab

libbirdfont/SpacingTab.vala
libbirdfont/TabContent.vala
--- a/libbirdfont/SpacingTab.vala +++ b/libbirdfont/SpacingTab.vala @@ -173,11 +173,28 @@ } public override void button_press (uint button, double ex, double ey) { + if (button == 3) { + return; + } + + if (!(ey >= allocation.height - height)) { + base.button_press (button, ex, ey); + } + } + + public override void button_release (int button, double ex, double ey) { GlyphSequence row; double p; Font font = BirdFont.get_current_font (); + + if (button == 3) { + return; + } if (ey >= allocation.height - height) { + + TabContent.hide_text_input (); + // TODO: add button for processing ligatures row = get_first_row ().process_ligatures (font); p = 0; @@ -193,16 +210,6 @@ p += box_size; } } else { - base.button_press (button, ex, ey); - } - } - - public override void button_release (int button, double ex, double ey) { - if (button == 3) { - return; - } - - if (!(ey >= allocation.height - height)) { base.button_release (button, ex, ey); } } @@ -216,13 +223,13 @@ return; } + text_input_glyph = (!) g; l = text_input_glyph.get_left_side_bearing (); if (Math.fabs (l) < 0.001) { l = 0; } - text_input_glyph = (!) g; listener = new TextListener (t_("Left"), @"$(l)", t_("Set")); listener.signal_text_input.connect ((text) => { @@ -255,18 +262,18 @@ TextListener listener; string submitted_value = ""; double r; - + if (g == null) { return; } + text_input_glyph = (!) g; r = text_input_glyph.get_right_side_bearing (); if (Math.fabs (r) < 0.001) { r = 0; } - - text_input_glyph = (!) g; + listener = new TextListener (t_("Right"), @"$(r)", t_("Set")); listener.signal_text_input.connect ((text) => {
--- a/libbirdfont/TabContent.vala +++ b/libbirdfont/TabContent.vala @@ -349,8 +349,9 @@ public static void hide_text_input () { text_input_visible = false; + text_callback = new TextListener ("", "", ""); } } }