diff --git a/honoka/src/honoka_def.h b/honoka/src/honoka_def.h index 1bf8430..5307226 100644 --- a/honoka/src/honoka_def.h +++ b/honoka/src/honoka_def.h @@ -130,11 +130,12 @@ #define HONOKA_PROP_MODESTATUS "/IMEngine/Honoka/Property/ModeStatus" -#define HONOKA_PROP_INPUTMODE "/IMEngine/Honoka/InputMode" -#define HONOKA_PROP_CONVERSIONMODE "/IMEngine/Honoka/ConversionMode" -#define HONOKA_PROP_CONVERTOR "/IMEngine/Honoka/Convertor" -#define HONOKA_PROP_PREDICTOR "/IMEngine/Honoka/Predictor" -#define HONOKA_PROP_SPLITTER "/IMEngine/Honoka/Splitter" +#define HONOKA_PROP_INPUTMODE "/IMEngine/Honoka/Property/InputMode" +#define HONOKA_PROP_CONVERSIONMODE "/IMEngine/Honoka/Property/ConversionMode" +#define HONOKA_PROP_CONVERTOR "/IMEngine/Honoka/Property/Convertor" +#define HONOKA_PROP_PREDICTOR "/IMEngine/Honoka/Property/Predictor" +#define HONOKA_PROP_SPLITTER "/IMEngine/Honoka/Property/Splitter" +#define HONOKA_PROP_SHRINK "/IMEngine/Honoka/Property/ShrinkToolbar" #define HONOKA_PREVIOUS_PREEDITOR "/IMEngine/Honoka/PreviousSetting/PreEditor" #define HONOKA_PREVIOUS_PREDICTOR "/IMEngine/Honoka/PreviousSetting/Predictor" diff --git a/honoka/src/honoka_imengine.cpp b/honoka/src/honoka_imengine.cpp index 003b52d..d9936e2 100644 --- a/honoka/src/honoka_imengine.cpp +++ b/honoka/src/honoka_imengine.cpp @@ -331,6 +331,7 @@ m_conversion = false; m_prediction = false; m_lookup = false; + shrunkToolbar = false; while(preeditStack.size()) { preeditStack.pop(); @@ -656,84 +657,98 @@ // プロパティを更新するメソッド。 if (m_proplist.empty()) { Property p; - p = Property(HONOKA_PROP_INPUTMODE,"",String(""),_("input mode")); + if (shrunkToolbar) p = Property(HONOKA_PROP_SHRINK,"",String(""),_("expand")); + else p = Property(HONOKA_PROP_SHRINK,"",String(""),_("shrink")); m_proplist.push_back(p); - for(unsigned int i = 0;i < preeditors.size();i ++) { - p = Property(String(HONOKA_PROP_INPUTMODE) + String("/") + preeditors[i]->getName(), - preeditors[i]->getPropertyName(),String(""),_("mode status")); + if (!shrunkToolbar) { + p = Property(HONOKA_PROP_INPUTMODE,"",String(""),_("input mode")); m_proplist.push_back(p); - } - if (prediction) { - p = Property(HONOKA_PROP_PREDICTOR,"",String(""),_("predictor")); - m_proplist.push_back(p); - for(unsigned int i = 0;i < predictors.size();i ++) { - p = Property(String(HONOKA_PROP_PREDICTOR) + String("/") + predictors[i]->getName(), - predictors[i]->getPropertyName(),String(""),_("mode status")); + for(unsigned int i = 0;i < preeditors.size();i ++) { + p = Property(String(HONOKA_PROP_INPUTMODE) + String("/") + preeditors[i]->getName(), + preeditors[i]->getPropertyName(),String(""),_("mode status")); m_proplist.push_back(p); } - } - if (changeable_splitter) { - p = Property(HONOKA_PROP_SPLITTER,"",String(""),_("splitter")); - m_proplist.push_back(p); - p = Property(String(HONOKA_PROP_SPLITTER) + String("/AUTO"), - _("Auto"),String(""),_("mode status")); + if (prediction) { + p = Property(HONOKA_PROP_PREDICTOR,"",String(""),_("predictor")); + m_proplist.push_back(p); + for(unsigned int i = 0;i < predictors.size();i ++) { + p = Property(String(HONOKA_PROP_PREDICTOR) + String("/") + predictors[i]->getName(), + predictors[i]->getPropertyName(),String(""),_("mode status")); + m_proplist.push_back(p); + } + } + if (changeable_splitter) { + p = Property(HONOKA_PROP_SPLITTER,"",String(""),_("splitter")); + m_proplist.push_back(p); + p = Property(String(HONOKA_PROP_SPLITTER) + String("/AUTO"), + _("Auto"),String(""),_("mode status")); + m_proplist.push_back(p); + for(unsigned int i = 0;i < convertors.size();i ++) { + p = Property(String(HONOKA_PROP_SPLITTER) + String("/") + convertors[i]->getName(), + convertors[i]->getPropertyName(),String(""),_("mode status")); + m_proplist.push_back(p); + } + } + p = Property(HONOKA_PROP_CONVERTOR,"",String(""),_("convertor")); m_proplist.push_back(p); for(unsigned int i = 0;i < convertors.size();i ++) { - p = Property(String(HONOKA_PROP_SPLITTER) + String("/") + convertors[i]->getName(), + p = Property(String(HONOKA_PROP_CONVERTOR) + String("/") + convertors[i]->getName(), convertors[i]->getPropertyName(),String(""),_("mode status")); m_proplist.push_back(p); } } - p = Property(HONOKA_PROP_CONVERTOR,"",String(""),_("convertor")); - m_proplist.push_back(p); - for(unsigned int i = 0;i < convertors.size();i ++) { - p = Property(String(HONOKA_PROP_CONVERTOR) + String("/") + convertors[i]->getName(), - convertors[i]->getPropertyName(),String(""),_("mode status")); - m_proplist.push_back(p); - } p = Property(HONOKA_PROP_MODESTATUS,"",String(""),_("mode status")); m_proplist.push_back(p); p = Property(HONOKA_PROP_CONVERSIONMODE,"",String(""),_("conversion mode")); m_proplist.push_back(p); } PropertyList::iterator it; - it = find(m_proplist.begin(),m_proplist.end(),HONOKA_PROP_INPUTMODE); - if (it != m_proplist.end()) { - it->set_label(m_preeditor->getPropertyName() + String(" ")); - } - update_property(*it); - if (prediction) { - it = find(m_proplist.begin(),m_proplist.end(),HONOKA_PROP_PREDICTOR); + if (!shrunkToolbar) { + it = find(m_proplist.begin(),m_proplist.end(),HONOKA_PROP_INPUTMODE); if (it != m_proplist.end()) { - it->set_label(m_predictor->getPropertyName() + String(" ")); + it->set_label(m_preeditor->getPropertyName() + String(" ")); + update_property(*it); } - update_property(*it); - } - if (changeable_splitter) { - it = find(m_proplist.begin(),m_proplist.end(),HONOKA_PROP_SPLITTER); + if (prediction) { + it = find(m_proplist.begin(),m_proplist.end(),HONOKA_PROP_PREDICTOR); + if (it != m_proplist.end()) { + it->set_label(m_predictor->getPropertyName() + String(" ")); + update_property(*it); + } + } + if (changeable_splitter) { + it = find(m_proplist.begin(),m_proplist.end(),HONOKA_PROP_SPLITTER); + if (it != m_proplist.end()) { + if (m_splitter == 0) it->set_label(_("Auto") + String(" ")); + else it->set_label(m_splitter->getPropertyName() + String(" ")); + update_property(*it); + } + } + it = find(m_proplist.begin(),m_proplist.end(),HONOKA_PROP_CONVERTOR); if (it != m_proplist.end()) { - if (m_splitter == 0) it->set_label(_("Auto") + String(" ")); - else it->set_label(m_splitter->getPropertyName() + String(" ")); + it->set_label(m_convertor->getPropertyName() + String(" ")); + update_property(*it); } } - it = find(m_proplist.begin(),m_proplist.end(),HONOKA_PROP_CONVERTOR); - if (it != m_proplist.end()) { - it->set_label(m_convertor->getPropertyName() + String(" ")); - } - update_property(*it); it = find(m_proplist.begin(),m_proplist.end(),HONOKA_PROP_MODESTATUS); if (it != m_proplist.end()) { if (m_conversion) it->set_label(_("Kanji") + String(" ")); else if (m_prediction) it->set_label(_("Yosoku") + String(" ")); else it->set_label(m_preeditor->getModeName() + String(" ")); + update_property(*it); } - update_property(*it); it = find(m_proplist.begin(),m_proplist.end(),HONOKA_PROP_CONVERSIONMODE); if (it != m_proplist.end()) { if (auto_conversion) it->set_label(_("AUTO") + String(" ")); else it->set_label(_("REN") + String(" ")); + update_property(*it); } - update_property(*it); + it = find(m_proplist.begin(),m_proplist.end(),HONOKA_PROP_SHRINK); + if (it != m_proplist.end()) { + if (shrunkToolbar) it->set_label(_(">>") + String(" ")); + else it->set_label(_("<<") + String(" ")); + update_property(*it); + } register_properties(m_proplist); } @@ -1682,6 +1697,13 @@ auto_conversion ? auto_conversion = false : auto_conversion = true; updatePreEditor(); } + + if (property == String(HONOKA_PROP_SHRINK)) { + if (!shrunkToolbar) shrunkToolbar = true; + else shrunkToolbar = false; + m_proplist.clear(); + updateProperty(); + } } diff --git a/honoka/src/honoka_imengine.h b/honoka/src/honoka_imengine.h index 5848187..1d47bdb 100644 --- a/honoka/src/honoka_imengine.h +++ b/honoka/src/honoka_imengine.h @@ -139,6 +139,7 @@ bool auto_conversion; bool save_setting; bool select_prediction_direct; + bool shrunkToolbar; String defaultPreEditor; String defaultConvertor; String defaultPredictor;