The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Toolbox label

These changes was commited to the Birdfont repository Fri, 29 May 2015 07:25:29 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Fri, 29 May 2015 07:25:29 +0000]

Updated Files

birdfont/GtkWindow.vala
libbirdfont/Expander.vala
libbirdfont/LabelTool.vala
libbirdfont/Renderer/FallbackFont.vala
--- a/birdfont/GtkWindow.vala +++ b/birdfont/GtkWindow.vala @@ -774,6 +774,7 @@ }); motion_notify_event.connect ((sen, e)=> { + // FIXME: e.y is two pixels off in GTK under Gnome tb.move (e.x, e.y); return true; });
--- a/libbirdfont/Expander.vala +++ b/libbirdfont/Expander.vala @@ -116,7 +116,7 @@ t.h = 7 * scale; } else if (t is LabelTool) { t.w = Toolbox.allocation_width * scale; - t.h = 15 * scale; + t.h = 22 * scale; } else if (t is FontName) { t.w = Toolbox.allocation_width * scale; t.h = 20 * scale; @@ -150,7 +150,13 @@ if (new_row && !first_row) { content_height += previous.h + margin_small; xt = x; - yt += previous.h + 7 * scale; + yt += previous.h; + + if (t is LabelTool) { + yt += 0 * scale; + } else { + yt += 7 * scale; + } } t.x = xt;
--- a/libbirdfont/LabelTool.vala +++ b/libbirdfont/LabelTool.vala @@ -25,8 +25,8 @@ public signal void delete_action (LabelTool self); public string data = ""; - double counter_box_width = 24; - double counter_box_height = 11; + double counter_box_width = 24 * Toolbox.get_scale (); + double counter_box_height = 11 * Toolbox.get_scale (); public LabelTool (string label) { base (); @@ -38,7 +38,7 @@ has_counter = false; panel_press_action.connect ((selected, button, tx, ty) => { - if (has_delete_button && y <= ty <= y + h && tx >= w - 30) { + if (has_delete_button && y <= ty <= y + h && tx >= w - 30 * Toolbox.get_scale ()) { delete_action (this); } }); @@ -58,7 +58,7 @@ if (is_selected ()) { cr.save (); Theme.color (cr, "Menu Background"); - cr.rectangle (0, y - 2, w, h + 7); + cr.rectangle (0, y - 2 * Toolbox.get_scale (), w, h ); // labels overlap with 2 pixels cr.fill (); cr.restore (); } @@ -67,7 +67,7 @@ cr.save (); label_text = new Text (); label_text.set_text (label); - text_height = 18 * Toolbox.get_scale (); + text_height = 17 * Toolbox.get_scale (); if (is_selected ()) { Theme.text_color (label_text, "Text Tool Box"); @@ -76,7 +76,7 @@ } label_text.set_font_size (text_height); - label_text.draw_at_baseline (cr, x + 14, y + h - 1.5); + label_text.draw_at_top (cr, x, y); cr.restore (); // glyph count
--- a/libbirdfont/Renderer/FallbackFont.vala +++ b/libbirdfont/Renderer/FallbackFont.vala @@ -77,7 +77,6 @@ public Font get_single_glyph_font (unichar c) { Font f; unichar last; - int last_index; CachePair p; if (likely (glyphs.has_key (c))) { @@ -101,8 +100,6 @@ int j = 0; for (int i = cached.size - 1; i > 0; i--) { - CachePair ca = cached.get (i); - if (j > 100) { break; }