The Birdfont Source Code


All Repositories / birdfont.git / blobdiff – RSS feed

Use bf font for spin button label

Changes made to libbirdfont/SpinButton.vala

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
--- libbirdfont/SpinButton.vala +++ libbirdfont/SpinButton.vala @@ -440,30 +440,24 @@ double scale = Toolbox.get_scale (); double xt = x + w / 2; - double yt = y + h / 2; + double yt = y; - double text_x = -15 * scale; - double text_y = 3 * scale; + double text_x = -14 * scale; + double text_y = 7 * scale; + Text text = new Text (get_short_display_value (), 15); base.draw (cr); if (!show_icon_tool_icon || waiting_for_icon_switch) { - cr.save (); - Theme.color (cr, "Background 2"); - cr.set_font_size (10 * scale); - cr.select_font_face ("Cantarell", FontSlant.NORMAL, FontWeight.NORMAL); - - if (BirdFont.android) { - cr.move_to (xt + text_x + 0.6 * MainWindow.units, yt + text_y); - } else if (BirdFont.mac || BirdFont.win32) { - cr.move_to (xt + text_x + 2, yt + text_y); + if (is_selected ()) { + Theme.text_color (text, "Selected Tool Foreground"); } else { - cr.move_to (xt + text_x, yt + text_y); + Theme.text_color (text, "Tool Foreground"); } - cr.show_text (get_short_display_value ()); - - cr.restore (); + text.widget_x = xt + text_x; + text.widget_y = yt + text_y; + text.draw (cr); } }