The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

More colors

These changes was commited to the Birdfont repository Fri, 17 Apr 2015 15:05: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
author Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 17 Apr 2015 15:05:29 +0000 (17:05 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 17 Apr 2015 15:05:29 +0000 (17:05 +0200)
commit 8123a8904e93a4a920ffd8f22f193d60df00bd31
tree fe7d6ceaad7d7d58f0cb11b21177c8bb149714db
parent a577624e0844bdee5c69fe99cae2a385a70aa004
More colors

13 files changed:
libbirdfont/CheckBox.vala
libbirdfont/DescriptionDisplay.vala
libbirdfont/Headline.vala
libbirdfont/LigatureList.vala
libbirdfont/OverViewItem.vala
libbirdfont/SettingsItem.vala
libbirdfont/SpinButton.vala
libbirdfont/TabBar.vala
libbirdfont/Table.vala
libbirdfont/Theme.vala
libbirdfont/Toolbox.vala
libbirdfont/ZoomBar.vala
--- a/libbirdfont/CheckBox.vala +++ b/libbirdfont/CheckBox.vala @@ -36,6 +36,7 @@ } label = new Text (text, font_size); + Theme.text_color (label, "Text Foreground"); } public void set_checked (bool c) { @@ -67,7 +68,7 @@ if (has_focus) { Theme.color (cr, "Highlighted 1"); } else { - Theme.color (cr, "Foreground 1"); + Theme.color (cr, "Text Foreground"); } draw_rounded_rectangle (cr, widget_x, widget_y + center_y, w, h - padding, padding); @@ -77,7 +78,7 @@ if (checked) { cr.save (); - Theme.color (cr, "Foreground 1"); + Theme.color (cr, "Text Foreground"); cr.set_line_width (1); cr.move_to (widget_x + d, widget_y + d + center_y);
--- a/libbirdfont/DescriptionDisplay.vala +++ b/libbirdfont/DescriptionDisplay.vala @@ -166,6 +166,12 @@ focus_ring.add (copyright); set_focus (postscript_name); + + foreach (Widget w in widgets) { + if (w is Text) { + Theme.text_color ((Text) w, "Text Foreground"); + } + } } public static void set_copyright_editable (bool t) {
--- a/libbirdfont/Headline.vala +++ b/libbirdfont/Headline.vala @@ -28,7 +28,7 @@ public override void draw (Context cr) { cr.save (); - Theme.color (cr, "Dialog Background"); + Theme.color (cr, "Headline Background"); cr.rectangle (0, widget_y, allocation.width, 40 * MainWindow.units); cr.fill (); cr.restore ();
--- a/libbirdfont/LigatureList.vala +++ b/libbirdfont/LigatureList.vala @@ -103,6 +103,9 @@ rows.clear (); + row = new Row.headline (t_("Add")); + rows.add (row); + row = new Row.columns_2 (t_("New Ligature"), t_("New Contextual Substitution"), NEW_LIGATURE, false); rows.add (row);
--- a/libbirdfont/OverViewItem.vala +++ b/libbirdfont/OverViewItem.vala @@ -117,7 +117,7 @@ cr.restore (); cr.save (); - Theme.color (cr, "Text Foreground"); + Theme.color (cr, "Overview Item Border"); cr.rectangle (x, y, width, height); cr.set_line_width (1); cr.stroke (); @@ -229,16 +229,16 @@ cr.save (); - p = new Cairo.Pattern.linear (0.0, y + height - 20, 0.0, y + height); + cr.rectangle (x + 1, y + height - 20, width - 2, 20 - 1); - if (selected) { - Theme.gradient (p, "Selected Overview Item 1", "Selected Overview Item 2"); - } else { + if (!selected) { + p = new Cairo.Pattern.linear (0.0, y + height - 20, 0.0, y + height); Theme.gradient (p, "Overview Item 1", "Overview Item 2"); + cr.set_source (p); + } else { + Theme.color (cr, "Selected Overview Item"); } - - cr.rectangle (x + 1, y + height - 20, width - 2, 20 - 1); - cr.set_source (p); + cr.fill (); if (has_icons ()) {
--- a/libbirdfont/SettingsItem.vala +++ b/libbirdfont/SettingsItem.vala @@ -90,7 +90,7 @@ if (headline) { cr.save (); - Theme.color (cr, "Background 2"); + Theme.color (cr, "Headline Background"); cr.rectangle (0, y, allocation.width, 40 * MainWindow.units); cr.fill (); cr.restore ();
--- a/libbirdfont/SpinButton.vala +++ b/libbirdfont/SpinButton.vala @@ -444,15 +444,25 @@ double text_x = -13 * scale; double text_y = 7 * scale; + Text text = new Text (get_short_display_value (), 15); - if (is_selected ()) { - base.icon_color = "Active Spin Button"; + if (!show_icon_tool_icon || waiting_for_icon_switch) { + if (is_selected ()) { + base.icon_color = "Active Spin Button"; + } else { + base.icon_color = "Spin Button"; + } } else { - base.icon_color = "Spin Button"; + if (is_selected ()) { + base.icon_color = "Selected Tool Foreground"; + } else { + base.icon_color = "Tool Foreground"; + } } base.draw (cr); + if (!show_icon_tool_icon || waiting_for_icon_switch) { if (is_selected ()) {
--- a/libbirdfont/TabBar.vala +++ b/libbirdfont/TabBar.vala @@ -784,7 +784,7 @@ center_y = (int) (tab_height / 2.0 + 4 / scale); if (tab_index == selected) { - Theme.text_color (label, "Foreground Inverted"); + Theme.text_color (label, "Selected Tab Foreground"); } else { Theme.text_color (label, "Text Foreground"); } @@ -796,7 +796,7 @@ if (tab_index != selected) { // don't draw edges for the selected tab if (tab_index + 1 != selected) { cr.save (); - Theme.color (cr, "Text Foreground"); + Theme.color (cr, "Tab Separator"); cr.rectangle (tab_width - 1 / scale, 0, 1 / scale, h); cr.fill (); cr.restore (); @@ -804,7 +804,7 @@ if (tab_index == first_tab) { cr.save (); - Theme.color (cr, "Text Foreground"); + Theme.color (cr, "Tab Separator"); cr.rectangle (0, 0, 1 / scale, h); cr.fill (); cr.restore ();
--- a/libbirdfont/Table.vala +++ b/libbirdfont/Table.vala @@ -104,7 +104,7 @@ Text t; cr.save (); - Theme.color (cr, "Foreground 1"); + Theme.color (cr, "Text Foreground"); t = row.get_column (0); t.widget_x = 40 * MainWindow.units;; t.widget_y = y + 45 * MainWindow.units; @@ -118,11 +118,15 @@ Text t; double x; - double o; - o = color ? 1 : 0.5; cr.save (); - Theme.color_opacity (cr, "Background 10", o); + + if (color) { + Theme.color (cr, "Table Background 2"); + } else { + Theme.color (cr, "Table Background 1"); + } + cr.rectangle (0, y * MainWindow.units, allocation.width, 25 * MainWindow.units); cr.fill (); cr.restore ();
--- a/libbirdfont/Theme.vala +++ b/libbirdfont/Theme.vala @@ -106,6 +106,9 @@ Theme.set_default_color ("Dialog Background", 238 / 255.0, 239 / 255.0, 243 / 255.0, 1); Theme.set_default_color ("Menu Background", 222 / 255.0, 221 / 255.0, 226 / 255.0, 1); Theme.set_default_color ("Default Background", 238 / 255.0, 239 / 255.0, 243 / 255.0, 1); + Theme.set_default_color ("Headline Background", 110 / 255.0, 113 / 255.0, 130 / 255.0, 1); + Theme.set_default_color ("Empty Tool Box", 110 / 255.0, 113 / 255.0, 130 / 255.0, 1); + Theme.set_default_color ("Background 5", 0.3, 0.3, 0.3, 1); Theme.set_default_color ("Background 6", 224/255.0, 224/255.0, 224/255.0, 1); Theme.set_default_color ("Background 7", 56 / 255.0, 59 / 255.0, 65 / 255.0, 1); @@ -113,21 +116,28 @@ Theme.set_default_color ("Background 9", 72/255.0, 72/255.0, 72/255.0, 1); Theme.set_default_color ("Background 10", 223/255.0, 223/255.0, 223/255.0, 1); - Theme.set_default_color ("Checkbox Background", 101 / 255.0, 108 / 255.0, 116 / 255.0, 1); + Theme.set_default_color ("Checkbox Background", 255 / 255.0, 255 / 255.0, 255 / 255.0, 1); Theme.set_default_color ("Foreground 1", 0, 0, 0, 1); - Theme.set_default_color ("Text Foreground", 125 / 255.0, 130 / 255.0, 136 / 255.0, 1); + Theme.set_default_color ("Text Foreground", 3 / 255.0, 16 / 255.0, 24 / 255.0, 1); Theme.set_default_color ("Foreground 3", 26 / 255.0, 30 / 255.0, 32 / 255.0, 1); Theme.set_default_color ("Foreground 4", 40 / 255.0, 57 / 255.0, 65 / 255.0, 1); Theme.set_default_color ("Foreground 5", 70 / 255.0, 77 / 255.0, 83 / 255.0, 1); Theme.set_default_color ("Foreground 6", 45 / 255.0, 45 / 255.0, 45 / 255.0, 1); Theme.set_default_color ("Foreground 7", 219 / 255.0, 221 / 255.0, 233 / 255.0, 1); - Theme.set_default_color ("Foreground Inverted Table", 1, 1, 1, 1); + Theme.set_default_color ("Table Background 1", 238 / 255.0, 239 / 255.0, 243 / 255.0, 1); + Theme.set_default_color ("Table Background 2", 210 / 255.0, 212 / 255.0, 223 / 255.0, 1); + + Theme.set_default_color ("Selected Tab Foreground", 0, 0, 0, 1); + Theme.set_default_color ("Tab Separator", 207 / 255.0, 210 / 255.0, 215 / 255.0, 1); + Theme.set_default_color ("Foreground Inverted", 1, 1, 1, 1); - Theme.set_default_color ("Menu Foreground", 101 / 255.0, 108 / 255.0, 116 / 255.0, 1); + Theme.set_default_color ("Menu Foreground", 3 / 255.0, 16 / 255.0, 24 / 255.0, 1); - Theme.set_default_color ("Highlighted 1", 234 / 255.0, 77 / 255.0, 26 / 255.0, 1); + // FIXME: DELETE Theme.set_default_color ("Highlighted 1", 234 / 255.0, 77 / 255.0, 26 / 255.0, 1); + Theme.set_default_color ("Highlighted 1", 159 / 255.0, 165 / 255.0, 192 / 255.0, 1); + Theme.set_default_color ("Highlighted Guide", 0, 0, 0.3, 1); Theme.set_default_color ("Guide 1", 0.7, 0.7, 0.8, 1); @@ -150,24 +160,25 @@ Theme.set_default_color ("Button Border 4", 173 / 255.0, 176 / 255.0, 188 / 255.0, 1); Theme.set_default_color ("Button Background 4", 242 / 255.0, 246 / 255.0, 246 / 255.0, 1); - Theme.set_default_color ("Button Foreground", 125 / 255.0, 130 / 255.0, 136 / 255.0, 1); - Theme.set_default_color ("Selected Button Foreground", 125 / 255.0, 130 / 255.0, 136 / 255.0, 1); + Theme.set_default_color ("Button Foreground", 3 / 255.0, 16 / 255.0, 24 / 255.0, 1); + Theme.set_default_color ("Selected Button Foreground", 3 / 255.0, 16 / 255.0, 24 / 255.0, 1); - Theme.set_default_color ("Tool Foreground", 125 / 255.0, 130 / 255.0, 136 / 255.0, 1); - Theme.set_default_color ("Selected Tool Foreground", 101 / 255.0, 108 / 255.0, 116 / 255.0, 1); + Theme.set_default_color ("Tool Foreground", 3 / 255.0, 16 / 255.0, 24 / 255.0, 1); + Theme.set_default_color ("Selected Tool Foreground", 3 / 255.0, 16 / 255.0, 24 / 255.0, 1); - Theme.set_default_color ("Text Area Background", 101 / 255.0, 108 / 255.0, 116 / 255.0, 1); - - Theme.set_default_color ("Selected Overview Item 1", 208 / 255.0, 208 / 255.0, 208 / 255.0, 1); - Theme.set_default_color ("Selected Overview Item 2", 229 / 255.0, 229 / 255.0, 229 / 255.0, 1); + Theme.set_default_color ("Text Area Background", 255 / 255.0, 255 / 255.0, 255 / 255.0, 1); + Theme.set_default_color ("Overview Item Border", 207 / 255.0, 210 / 255.0, 215 / 255.0, 1); + + Theme.set_default_color ("Selected Overview Item", 211 / 255.0, 212 / 255.0, 216 / 255.0, 1); Theme.set_default_color ("Overview Item 1", 236 / 255.0, 236 / 255.0, 236 / 255.0, 1); Theme.set_default_color ("Overview Item 2", 246 / 255.0, 246 / 255.0, 246 / 255.0, 1); Theme.set_default_color ("Overview Selected Foreground", 45 / 255.0, 45 / 255.0, 45 / 255.0, 1); Theme.set_default_color ("Overview Foreground", 45 / 255.0, 45 / 255.0, 45 / 255.0, 1); - Theme.set_default_color ("Glyph Count Background", 211 / 255.0, 212 / 255.0, 216 / 255.0, 1); + Theme.set_default_color ("Glyph Count Background 1", 255 / 255.0, 255 / 255.0, 255 / 255.0, 1); + Theme.set_default_color ("Glyph Count Background 2", 255 / 255.0, 255 / 255.0, 255 / 255.0, 1); Theme.set_default_color ("Dialog Shadow", 0, 0, 0, 0.3); @@ -189,6 +200,8 @@ Theme.set_default_color ("Spin Button", 164 / 255.0, 167 / 255.0, 175 / 255.0, 1); Theme.set_default_color ("Active Spin Button", 104 / 255.0, 108 / 255.0, 119 / 255.0, 1); + Theme.set_default_color ("Zoom Bar Border", 122 / 255.0, 131 / 255.0, 145 / 255.0, 1); + if (BirdFont.has_argument ("--test")) { current_theme = "generated_theme.theme"; @@ -220,6 +233,8 @@ t_("Foreground 7"); t_("Foreground Inverted"); t_("Menu Foreground"); + t_("Selected Tab Foreground"); + t_("Tab Separator"); t_("Highlighted 1"); t_("Highlighted Guide"); @@ -247,16 +262,17 @@ t_("Text Area Background"); - t_("Selected Overview Item 1"); - t_("Selected Overview Item 2"); + t_("Overview Item Border"); + t_("Selected Overview Item"); t_("Overview Item 1"); t_("Overview Item 2"); t_("Overview Selected Foreground"); t_("Overview Foreground"); - t_("Glyph Count Background"); + t_("Glyph Count Background 1"); + t_("Glyph Count Background 2"); t_("Dialog Shadow"); @@ -277,6 +293,7 @@ t_("Merge"); t_("Spin Button"); t_("Active Spin Button"); + t_("Zoom Bar Border"); } }
--- a/libbirdfont/Toolbox.vala +++ b/libbirdfont/Toolbox.vala @@ -439,43 +439,27 @@ } public void draw (int w, int h, Context cr) { - EmptySet empty_set; ImageSurface bg; double scale_x, scale_y, scale; - if (current_set is EmptySet) { - empty_set = (EmptySet) current_set; + cr.save (); - if (empty_set.background != null) { - bg = (!) empty_set.background; - - scale_x = (double) allocation_width / bg.get_width (); - scale_y = (double) allocation_height / bg.get_height (); - - scale = fmax (scale_x, scale_y); - - cr.save (); - cr.scale (scale, scale); - cr.set_source_surface (bg, 0, 0); - cr.paint (); - cr.restore (); - - draw_expanders (w, h, cr); - } + if (current_set is EmptySet) { + Theme.color (cr, "Empty Tool Box"); } else { - cr.save (); - - cr.rectangle (0, 0, w, h); - cr.set_line_width (0); Theme.color (cr, "Default Background"); - cr.fill (); + } - draw_expanders (w, h, cr); - - cr.restore (); - - draw_tool_tip (cr); - } + cr.rectangle (0, 0, w, h); + cr.set_line_width (0); + cr.fill (); + + draw_expanders (w, h, cr); + + cr.restore (); + + draw_tool_tip (cr); + } private void draw_tool_tip (Context cr) { @@ -517,12 +501,9 @@ } public class EmptySet : ToolCollection { - - public ImageSurface? background; Gee.ArrayList<Expander> expanders; public EmptySet () { - background = Icons.get_icon ("corvus_monedula.png"); expanders = new Gee.ArrayList<Expander> (); }
--- a/libbirdfont/ZoomBar.vala +++ b/libbirdfont/ZoomBar.vala @@ -102,7 +102,7 @@ // border cr.save (); - Theme.color (cr, "Button Border 1"); + Theme.color (cr, "Zoom Bar Border"); cr.set_line_width (0.8); draw_bar (cr); cr.stroke ();