The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Select theme label in file tools

These changes was commited to the Birdfont repository Mon, 21 Sep 2015 09:38:06 +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>
Mon, 21 Sep 2015 09:38:06 +0000 (11:38 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Mon, 21 Sep 2015 09:38:06 +0000 (11:38 +0200)
commit 0249db85d349fca31657148b7893ffe4c647d198
tree 8094176168c08d34c36ba63d440ab9fe8694b2ef
parent aa87fe2623025950d1e86d78c7f5c6a6e2001055
Select theme label in file tools

libbirdfont/FileTools.vala
--- a/libbirdfont/FileTools.vala +++ b/libbirdfont/FileTools.vala @@ -68,6 +68,7 @@ Toolbox toolbox = MainWindow.get_toolbox (); string theme_file = s.data; TabBar tb = MainWindow.get_tab_bar (); + Preferences.set ("theme", theme_file); Theme.load_theme (theme_file); @@ -86,13 +87,27 @@ OverViewItem.selected_label_background = null; OverViewItem.label_background_no_menu = null; OverViewItem.selected_label_background_no_menu = null; + + foreach (Tool t in themes.tool) { + t.set_selected (false); + } + + self.set_selected (true); }); if (!theme.has_prefix ("generated_")) { themes.add_tool (theme_label); } } - + + string theme_in_use = Preferences.get ("theme"); + foreach (Tool t in themes.tool) { + if (t is LabelTool) { + LabelTool lt = (LabelTool) t; + t.set_selected (theme_in_use == lt.data); + } + } + expanders.add (font_name); expanders.add (file_tools); expanders.add (themes);