Clone in a terminal:
Commit f9e6121
Johan Mattsson - 2015-04-24T08:51:08+00:00
f9e61212a82c7e2bac7a98888deb83bd560eaf08johan.mattsson.m@gmail.com

Use default theme when color names are changed

Changed files (2)

Diff

diff --git a/libbirdfont/BirdFont.vala b/libbirdfont/BirdFont.valaindex b70e148..ed4c363 100644--- a/libbirdfont/BirdFont.vala+++ b/libbirdfont/BirdFont.vala@@ -396,7 +396,9 @@ public class BirdFont { 		File font_file; 		string exec_path; 		string theme;-+		int default_theme_version;+		string theme_version;+		 		args = new Argument.command_line (arg);  #if ANDROID@@ -440,15 +442,26 @@ public class BirdFont {  		Preferences.load (); 		-		Theme.set_default_colors ();-		+		// always load default theme when names in theme does change+		default_theme_version = 1; 		theme = Preferences.get ("theme");+		theme_version = Preferences.get ("theme_version");++		Theme.set_default_colors (); 		-		if (theme != "") {-			Theme.load_theme (theme);+		if (theme_version == "" || int.parse (theme_version) < default_theme_version) {+			+			Theme.load_theme ("dark.theme");+			Preferences.set ("theme", "dark.theme"); 		} else {-			Theme.load_theme ("default.theme");+			if (theme != "") {+				Theme.load_theme (theme);+			} else {+				Theme.load_theme ("dark.theme");+			} 		}++		Preferences.set ("theme_version", @"$default_theme_version"); 		 		current_font = new Font (); 		current_font.set_name ("");diff --git a/libbirdfont/Theme.vala b/libbirdfont/Theme.valaindex bf2ac25..243efca 100644--- a/libbirdfont/Theme.vala+++ b/libbirdfont/Theme.vala@@ -412,6 +412,8 @@ public class Theme : GLib.Object { 			write_theme (); 		} +		load_theme ("dark.theme");+ 		if (BirdFont.has_argument ("--test")) { 			t_("Canvas Background"); 			t_("Stroke Color");

Contact

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