The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Use default theme when color names are changed

These changes was commited to the Birdfont repository Fri, 24 Apr 2015 08:51:08 +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, 24 Apr 2015 08:51:08 +0000]

Updated Files

libbirdfont/BirdFont.vala
libbirdfont/Theme.vala
--- a/libbirdfont/BirdFont.vala +++ b/libbirdfont/BirdFont.vala @@ -396,7 +396,9 @@ 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 @@ Preferences.load (); + // 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 (); - theme = Preferences.get ("theme"); - - 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 ("");
--- a/libbirdfont/Theme.vala +++ b/libbirdfont/Theme.vala @@ -411,6 +411,8 @@ current_theme = "generated_high_contrast.theme"; write_theme (); } + + load_theme ("dark.theme"); if (BirdFont.has_argument ("--test")) { t_("Canvas Background");