Commit c00f4f8
Merge ../birdfont-2.x
Changed files (4)
modifiedlibbirdfont/BirdFont.valamodifiedlibbirdfont/SettingsTab.valamodifiedlibbirdfont/ThemeTab.valamodifiedscripts/version.py
Diff
@@ -498,7 +498,13 @@ public string t_ (string t) { #if ANDROID return t; #else- return _(t);+ string translate = Preferences.get ("translate");+ + if (translate == "" || translate == "true") {+ return _(t);+ } else {+ return t;+ } #endif } @@ -18,6 +18,8 @@ using Math; namespace BirdFont { public class SettingsTab : SettingsDisplay {++ string restart_message = "You need to restart the program in order to apply this setting."; public SettingsTab () { base ();@@ -141,6 +143,25 @@ public class SettingsTab : SettingsDisplay { DrawingTools.pen_tool.set_simplification_threshold (simplification_threshold.get_value ()); }); + Tool translate_ui = new Tool ("translate");+ translate_ui.select_action.connect((self) => {+ Preferences.set ("translate", @"true"); + ThemeTab.redraw_ui ();+ translate_ui.selected = true;+ MainWindow.show_dialog (new MessageDialog (restart_message));+ });+ + translate_ui.deselect_action.connect((self) => {+ Preferences.set ("translate", @"false");+ translate_ui.selected = false;+ MainWindow.show_dialog (new MessageDialog (restart_message));+ ThemeTab.redraw_ui ();+ });++ string translate_setting = Preferences.get ("translate");+ translate_ui.selected = translate_setting == "" || translate_setting == "true"; + tools.add (new SettingsItem (translate_ui, t_("Translate")));+ Tool themes = new Tool ("open_theme_tab"); themes.set_icon ("theme"); themes.select_action.connect((self) => {@@ -53,7 +53,6 @@ public class ThemeTab : SettingsDisplay { select_theme.select_action.connect((self) => { string theme_file = self.get_name ();- TabBar tb; Toolbox toolbox; Preferences.set ("theme", theme_file);@@ -76,17 +75,7 @@ public class ThemeTab : SettingsDisplay { e.redraw (); } - Toolbox.redraw_tool_box ();- - GlyphCanvas.redraw ();- - tb = MainWindow.get_tab_bar ();- tb.redraw (0, 0, tb.width, tb.height);- - OverViewItem.label_background = null;- OverViewItem.selected_label_background = null;- OverViewItem.label_background_no_menu = null;- OverViewItem.selected_label_background_no_menu = null;+ redraw_ui (); }); select_theme.set_icon ("theme");@@ -140,6 +129,22 @@ public class ThemeTab : SettingsDisplay { } } + public static void redraw_ui (){+ TabBar tb;+ + Toolbox.redraw_tool_box (); + + GlyphCanvas.redraw ();+ + tb = MainWindow.get_tab_bar ();+ tb.redraw (0, 0, tb.width, tb.height);+ + OverViewItem.label_background = null;+ OverViewItem.selected_label_background = null;+ OverViewItem.label_background_no_menu = null;+ OverViewItem.selected_label_background_no_menu = null; + }+ public static string get_label_from_file_name (string theme) { string label; @@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. """ -VERSION = '2.16.12'+VERSION = '2.17.0' SO_VERSION_MAJOR = '36' SO_VERSION_MINOR = '0' SO_VERSION = SO_VERSION_MAJOR + '.' + SO_VERSION_MINOR