From dca9d262c84ee234f2be75b8589d666aece3dd06 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Thu, 19 Dec 2019 14:59:48 +0800 Subject: add display style option to setup dialog --- setup/main2.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/setup/main2.py b/setup/main2.py index 911c395..d40f6f3 100644 --- a/setup/main2.py +++ b/setup/main2.py @@ -97,6 +97,7 @@ class PreferencesDialog: self.__init_shortcut() self.__init_about() self.__convert_fuzzy_pinyin_to_bopomofo() + self.__display_style_box.hide() else: print("Error: Unknown Engine") @@ -138,6 +139,8 @@ class PreferencesDialog: self.__init_trad = self.__builder.get_object("InitTraditionalChinese") # UI + self.__display_style = self.__builder.get_object("DisplayStyle") + self.__display_style_box = self.__builder.get_object("boxDisplayStyle") self.__lookup_table_orientation = self.__builder.get_object("LookupTableOrientation") self.__lookup_table_page_size = self.__builder.get_object("LookupTablePageSize") @@ -154,6 +157,7 @@ class PreferencesDialog: self.__lookup_table_orientation.set_active(self.__get_value("lookup-table-orientation")) self.__lookup_table_page_size.set_value(self.__get_value("lookup-table-page-size")) + self.__display_style.set_active(self.__get_value("display-style")) self.__dynamic_adjust.set_active(self.__get_value("dynamic-adjust")) self.__remember_every_input.set_active(self.__get_value("remember-every-input")) @@ -168,15 +172,19 @@ class PreferencesDialog: self.__remember_every_input.connect("toggled", self.__toggled_cb, "remember-every-input") self.__show_suggestion.connect("toggled", self.__toggled_cb, "show-suggestion") - def __lookup_table_page_size_changed_cb(adjustment): - self.__set_value("lookup-table-page-size", int(adjustment.get_value())) + def __display_size_changed_cb(widget): + self.__set_value("display-style", widget.get_active()) def __lookup_table_orientation_changed_cb(widget): self.__set_value("lookup-table-orientation", widget.get_active()) + def __lookup_table_page_size_changed_cb(adjustment): + self.__set_value("lookup-table-page-size", int(adjustment.get_value())) + def __sort_candidate_option_changed_cb(widget): self.__set_value("sort-candidate-option", widget.get_active()) + self.__display_style.connect("changed", __display_size_changed_cb) self.__lookup_table_orientation.connect("changed", __lookup_table_orientation_changed_cb) self.__lookup_table_page_size.connect("value-changed", __lookup_table_page_size_changed_cb) self.__sort_candidate_option.connect("changed", __sort_candidate_option_changed_cb) -- cgit