Clone in a terminal:
Commit 8123a89
Johan Mattsson - 2015-04-17T15:05:29+00:00
8123a8904e93a4a920ffd8f22f193d60df00bd31johan.mattsson.m@gmail.com

More colors

Changed files (12)

Diff

diff --git a/libbirdfont/CheckBox.vala b/libbirdfont/CheckBox.valaindex e7a6546..284272e 100644--- a/libbirdfont/CheckBox.vala+++ b/libbirdfont/CheckBox.vala@@ -36,6 +36,7 @@ public class CheckBox : Widget { 		} 		 		label = new Text (text, font_size);+		Theme.text_color (label, "Text Foreground"); 	} 	 	public void set_checked (bool c) {@@ -67,7 +68,7 @@ public class CheckBox : Widget { 		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 @@ public class CheckBox : Widget { 		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);diff --git a/libbirdfont/DescriptionDisplay.vala b/libbirdfont/DescriptionDisplay.valaindex 29279c4..b89925b 100644--- a/libbirdfont/DescriptionDisplay.vala+++ b/libbirdfont/DescriptionDisplay.vala@@ -166,6 +166,12 @@ public class DescriptionDisplay : TableLayout { 		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) {diff --git a/libbirdfont/Headline.vala b/libbirdfont/Headline.valaindex b67ca09..c0d5822 100644--- a/libbirdfont/Headline.vala+++ b/libbirdfont/Headline.vala@@ -28,7 +28,7 @@ class Headline : Widget { 	 	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 ();diff --git a/libbirdfont/LigatureList.vala b/libbirdfont/LigatureList.valaindex cd08be3..94552d0 100644--- a/libbirdfont/LigatureList.vala+++ b/libbirdfont/LigatureList.vala@@ -103,6 +103,9 @@ public class LigatureList : Table { 		 		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); 		diff --git a/libbirdfont/OverViewItem.vala b/libbirdfont/OverViewItem.valaindex cde2042..629e29b 100644--- a/libbirdfont/OverViewItem.vala+++ b/libbirdfont/OverViewItem.vala@@ -117,7 +117,7 @@ public class OverViewItem : GLib.Object { 		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 @@ public class OverViewItem : GLib.Object { 		 		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 ()) {diff --git a/libbirdfont/SettingsItem.vala b/libbirdfont/SettingsItem.valaindex 49da216..30aa0e5 100644--- a/libbirdfont/SettingsItem.vala+++ b/libbirdfont/SettingsItem.vala@@ -90,7 +90,7 @@ class SettingsItem : GLib.Object { 		 		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 ();diff --git a/libbirdfont/SpinButton.vala b/libbirdfont/SpinButton.valaindex 917b086..b1766f6 100644--- a/libbirdfont/SpinButton.vala+++ b/libbirdfont/SpinButton.vala@@ -444,15 +444,25 @@ public class SpinButton : Tool {  		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 ()) {diff --git a/libbirdfont/TabBar.vala b/libbirdfont/TabBar.valaindex 1166eae..52532f1 100644--- a/libbirdfont/TabBar.vala+++ b/libbirdfont/TabBar.vala@@ -784,7 +784,7 @@ public class TabBar : GLib.Object { 			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 @@ public class TabBar : GLib.Object { 			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 @@ public class TabBar : GLib.Object { 				 				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 ();diff --git a/libbirdfont/Table.vala b/libbirdfont/Table.valaindex 701ae3e..021c269 100644--- a/libbirdfont/Table.vala+++ b/libbirdfont/Table.vala@@ -104,7 +104,7 @@ public abstract class Table : FontDisplay { 		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 @@ public abstract class Table : FontDisplay { 		 		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 ();diff --git a/libbirdfont/Theme.vala b/libbirdfont/Theme.valaindex 348ac9a..a1db5cf 100644--- a/libbirdfont/Theme.vala+++ b/libbirdfont/Theme.vala@@ -106,6 +106,9 @@ public class Theme : GLib.Object { 		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 @@ public class Theme : GLib.Object { 		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 @@ public class Theme : GLib.Object { 		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 @@ public class Theme : GLib.Object { 		 		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 @@ public class Theme : GLib.Object { 			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 @@ public class Theme : GLib.Object { 			 			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 @@ public class Theme : GLib.Object { 			t_("Merge"); 			t_("Spin Button"); 			t_("Active Spin Button");+			t_("Zoom Bar Border"); 		} 	} 	diff --git a/libbirdfont/Toolbox.vala b/libbirdfont/Toolbox.valaindex 83af7fa..f1f963a 100644--- a/libbirdfont/Toolbox.vala+++ b/libbirdfont/Toolbox.vala@@ -439,43 +439,27 @@ public class Toolbox : GLib.Object  { 	} 	 	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 Toolbox : GLib.Object  { 	} 	 	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> (); 		} 		diff --git a/libbirdfont/ZoomBar.vala b/libbirdfont/ZoomBar.valaindex 14e0d85..a30d411 100644--- a/libbirdfont/ZoomBar.vala+++ b/libbirdfont/ZoomBar.vala@@ -102,7 +102,7 @@ public class ZoomBar : Tool { 		 		// 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 ();

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112