AccessoriesSwitchesPage in cpp style 36/199136/10
authorOskar Chodowicz <o.chodowicz@samsung.com>
Mon, 4 Feb 2019 15:07:30 +0000 (16:07 +0100)
committerLukasz Wlazly <l.wlazly@partner.samsung.com>
Fri, 15 Feb 2019 09:33:04 +0000 (10:33 +0100)
In this class still are some elements to refactor
Change-Id: Ifa6c60ddad690c1cedd206a4add62914a383ed5d

14 files changed:
src/AccessoriesSwitchesPage.cpp
src/AccessoriesSwitchesPage.hpp
src/ActionPage.cpp
src/Button.cpp
src/Button.hpp
src/Entry.cpp
src/Entry.hpp
src/Layout.cpp
src/Layout.hpp
src/Popup.cpp
src/Popup.hpp
src/RemoveSwitchPage.cpp
src/ScreenReaderSettingsPage.cpp
src/SettingPopup.cpp

index 2ea06e8..47d414e 100644 (file)
 
 #include "AccessoriesSwitchesPage.hpp"
 
-#include "setting-accessibility.h"
-#include "WidgetFactory.hpp"
-#include "Layout.hpp"
-
-#include <app.h>
 
-#define EDJ_ACCESSORY "edje/accessibility-smart-switch-accessory.edj"
-#define PRT_ACCESSORY_LABEL "accessory_label"
-#define EDJ_ACCESSORY_POPUP "edje/accessibility-smart-switch-accessory-popup.edj"
-#define PRT_ACCESSORY_POPUP_ENTRY "accessory_popup_entry"
-#define GRP_ACCESSORY_POPUP "accessory_popup"
-#define GRP_ACCESSORY "accessory"
-#define PRT_ACCESSORY_POPUP_LABEL "accessory_popup_label"
+#include "Layout.hpp"
+#include "Button.hpp"
+#include "Popup.hpp"
+#include "Entry.hpp"
 
 AccessoriesSwitchesPage::AccessoriesSwitchesPage(SettingAccessibility *ad)
        : context_(ad)
 {
-       auto layout = createLayout(context_->md.getNaviframe(), EDJ_ACCESSORY, GRP_ACCESSORY);
+       auto naviframe = context_->md.getNaviframe();
+       auto layout = Widget::make<Layout>(naviframe, EDJ_ACCESSORY, GRP_ACCESSORY);
        layout->setText(PRT_ACCESSORY_LABEL, "IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH_ACCESSORIES_DESC");
-       context_->us_configuration.switch_id = {};
+       layout->show();
 
-       Elm_Object_Item *navi_it = elm_naviframe_item_push(context_->md.getNaviframe()->getObject(), _("IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH_ACCESSORIES_TITLE"), NULL, NULL, layout->getObject(), NULL);
-       elm_naviframe_item_pop_cb_set(navi_it, naviframPopCb, context_);
-       elm_object_item_domain_text_translatable_set(navi_it, PACKAGE, EINA_TRUE);
+       naviframe->pushBack("IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH_ACCESSORIES_TITLE", layout, {}, [this]() {
+               setting_accessibility_universal_switch_dbus_config_cancelCaptureSwitch(&context_->config);
+               context_->us_configuration.switch_id = {};
+       });
 
-       Evas_Object *back_btn = WidgetFactory::createButton(context_->md.getNaviframe()->getObject(), {}, WidgetFactory::BACK_BUTTON_ARROW_STYLE, backCb, context_);
-       elm_layout_content_set(context_->md.getNaviframe()->getObject(), "prev_btn", back_btn);
+       auto prevBtn = Widget::make<Button>(layout, std::string{}, [naviframe]() {
+               naviframe->popBack();
+       });
+       prevBtn->setStyle(Button::BACK_BUTTON_ARROW_STYLE);
+       prevBtn->show();
+       layout->setPartContent("prev_btn", prevBtn);
 
+       context_->us_configuration.switch_id = {};
        setting_accessibility_universal_switch_dbus_config_captureSwitch(&context_->config, ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER, -1, captureSwitchCb, this);
 }
 
@@ -53,33 +52,6 @@ void AccessoriesSwitchesPage::attachActionCallback(UniversalSwitchCb cb, void *c
        accessories_switch_added_cb_data = cbData;
 }
 
-Evas_Object *AccessoriesSwitchesPage::createEntry(Evas_Object *parent, const char *part_name)
-{
-       Evas_Object *entry = elm_entry_add(parent);
-       evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       elm_object_part_content_set(parent, part_name, entry);
-       evas_object_show(entry);
-
-       return entry;
-}
-
-Layout *AccessoriesSwitchesPage::createLayout(Widget *parent, const std::string &edj_file, const std::string &group)
-{
-       char *res_path = app_get_resource_path();
-       std::string edj_path;
-       if (res_path) {
-               edj_path = std::string{res_path} + edj_file;
-               free(res_path);
-       }
-       auto layout = Widget::make<Layout>(parent);
-       layout->setFile(edj_path, group);
-       layout->setWeightHint(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       layout->show();
-
-
-       return layout;
-}
-
 void AccessoriesSwitchesPage::captureSwitchCb(void *user_data, const char *switch_id)
 {
        retm_if(user_data == NULL, "Input argument is NULL");
@@ -92,66 +64,78 @@ void AccessoriesSwitchesPage::captureSwitchCb(void *user_data, const char *switc
                        return;
                }
        }
-
        self->context_->us_configuration.switch_id = switch_id;
-       self->settingPopup_ = std::make_unique<SettingPopup>(self, self->context_->md.getNaviframe(),
-                                                 "IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH", std::string{},
-                                                 popupResponseCb,
-                                                 std::vector<std::string> {"IDS_ACCS_UNIVERSAL_SWITCH_CANCEL", "IDS_ACCS_UNIVERSAL_SWITCH_SAVE"});
-
-       auto layout = self->createLayout(self->settingPopup_->getObject(), EDJ_ACCESSORY_POPUP, GRP_ACCESSORY_POPUP);
-
-       self->entry = createEntry(layout->getObject(), PRT_ACCESSORY_POPUP_ENTRY);
-
-       elm_object_part_text_set(self->entry, "guide", _("IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH_NAME"));
-
-       self->settingPopup_->getObject()->setContent(layout);
+       self->newSwitchPopup();
 }
 
-void AccessoriesSwitchesPage::alreadyMappedSwitchPopup()
+void AccessoriesSwitchesPage::newSwitchPopup()
 {
-       settingPopup_ = std::make_unique<SettingPopup>(this, context_->md.getNaviframe(),
-                                       "IDS_ACCS_UNIVERSAL_SWITCH_UNABLE_TO_ADD", std::string{},
-                                       okResponseCb,
-                                       std::vector<std::string> {"IDS_ACCS_UNIVERSAL_SWITCH_OK"});
+       auto popup = Widget::make<Popup>(context_->md.getNaviframe(), "IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH");
+       popup->setEextEventCallback(EEXT_CALLBACK_BACK, []() {});
 
-       auto layout = createLayout(settingPopup_->getObject(), EDJ_ACCESSORY_POPUP, GRP_ACCESSORY_POPUP);
-       layout->setPartText(PRT_ACCESSORY_POPUP_LABEL, "IDS_ACCS_UNIVERSAL_SWITCH_ALREADY_ADDED");
-       settingPopup_->getObject()->setContent(layout);
-}
+       auto layout = Widget::make<Layout>(popup, EDJ_ACCESSORY_POPUP, GRP_ACCESSORY_POPUP);
+       layout->show();
+       popup->setContent(layout);
+
+       auto entry = Widget::make<Entry>(layout);
+       entry->setWeightHint(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       entry->setPartText("guide", "IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH_NAME");
+       entry->show();
+       layout->setPartContent(PRT_ACCESSORY_POPUP_ENTRY, entry);
+
+       auto cancelBtnCb = [popup, this]() {
+               auto parent = popup->getParent();
+               parent->removeChild(popup);
+               setting_accessibility_universal_switch_dbus_config_captureSwitch(&context_->config, ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER, -1, captureSwitchCb, this);
+       };
+
+       auto cancelBtn = Widget::make<Button>(popup, "IDS_ACCS_UNIVERSAL_SWITCH_CANCEL", cancelBtnCb);
+       cancelBtn->setStyle("popup");
+       cancelBtn->show();
+       popup->setPartContent("button1", cancelBtn);
+
+       auto saveBtnCb = [popup, entry, this]() {
+               if ((switchName_ = entry->getEntryText()).empty()){
+                       SETTING_TRACE_END; //TODO probably to remove
+                       return;
+               }
 
-void AccessoriesSwitchesPage::okResponseCb(void *data, Evas_Object *obj, void *event_info)
-{
-       retm_if(data == NULL, "Data parameter is NULL");
-       auto self = static_cast<AccessoriesSwitchesPage *>(data);
+               actionPage_ = std::make_unique<ActionPage>(this->context_);
+               actionPage_->attachCallback(accessorySwitchActionCb, this);
+               elm_naviframe_item_pop_cb_set(elm_naviframe_top_item_get(context_->md.getNaviframe()->getObject()), renewCaptureSwitchCb, this); //TODO
 
-       renewCaptureSwitchCb(self, NULL);
+               auto parent = popup->getParent();
+               parent->removeChild(popup);
+       };
 
-       self->settingPopup_ = {};
+       auto saveBtn = Widget::make<Button>(popup, "IDS_ACCS_UNIVERSAL_SWITCH_SAVE", saveBtnCb);
+       saveBtn->setStyle("popup");
+       saveBtn->show();
+       popup->setPartContent("button2", saveBtn);
+       popup->show();
 }
 
-void AccessoriesSwitchesPage::popupResponseCb(void *data, Evas_Object *obj, void *event_info)
+void AccessoriesSwitchesPage::alreadyMappedSwitchPopup()
 {
-       retm_if(data == NULL, "Data parameter is NULL");
-       auto self = static_cast<AccessoriesSwitchesPage *>(data);
-       auto response_type = get_popup_btn_response_type(obj);
+       auto popup = Widget::make<Popup>(context_->md.getNaviframe(), "IDS_ACCS_UNIVERSAL_SWITCH_UNABLE_TO_ADD");
+       popup->setEextEventCallback(EEXT_CALLBACK_BACK, []() {});
 
-       if (response_type == PopupBtnResponse::OK) {
-               self->switchName_ = static_cast<const char *>(elm_entry_entry_get(self->entry));
-               if (self->switchName_.empty()) {
-                       SETTING_TRACE_END;
-                       return;
-               }
+       auto okBtnCb = [popup, this](){
+               setting_accessibility_universal_switch_dbus_config_captureSwitch(&context_->config, ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER, -1, captureSwitchCb, this);
+               auto parent = popup->getParent();
+               parent->removeChild(popup);
+       };
 
-               self->actionPage_ = std::make_unique<ActionPage>(self->context_);
-               self->actionPage_->attachCallback(accessorySwitchActionCb, self);
-               elm_naviframe_item_pop_cb_set(elm_naviframe_top_item_get(self->context_->md.getNaviframe()->getObject()), renewCaptureSwitchCb, self);
-       } else {
-               renewCaptureSwitchCb(self, NULL);
-       }
+       auto okBtn = Widget::make<Button>(popup, "IDS_ACCS_UNIVERSAL_SWITCH_OK", okBtnCb);
+       okBtn->setStyle("popup");
+       okBtn->show();
+       popup->setPartContent("button1", okBtn);
 
-       self->settingPopup_ = {};
-       self->entry = NULL;
+       auto layout = Widget::make<Layout>(popup, EDJ_ACCESSORY_POPUP, GRP_ACCESSORY_POPUP);
+       layout->setPartText(PRT_ACCESSORY_POPUP_LABEL, "IDS_ACCS_UNIVERSAL_SWITCH_ALREADY_ADDED");
+       layout->show();
+       popup->setContent(layout);
+       popup->show();
 }
 
 void AccessoriesSwitchesPage::accessorySwitchActionCb(SettingAccessibility *ad, const std::string &action, void *user_data)
@@ -164,28 +148,9 @@ void AccessoriesSwitchesPage::accessorySwitchActionCb(SettingAccessibility *ad,
 
 Eina_Bool AccessoriesSwitchesPage::renewCaptureSwitchCb(void *data, Elm_Object_Item *it)
 {
-       retv_if(data == NULL, EINA_TRUE);
+       retv_if(data == NULL, EINA_FALSE);
        auto self = static_cast<AccessoriesSwitchesPage *>(data);
-
        setting_accessibility_universal_switch_dbus_config_captureSwitch(&self->context_->config, ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER, -1, captureSwitchCb, self);
 
        return EINA_TRUE;
-}
-
-Eina_Bool AccessoriesSwitchesPage::naviframPopCb(void *data, Elm_Object_Item *it)
-{
-       retv_if(data == NULL, EINA_TRUE);
-       auto ad = static_cast<SettingAccessibility *>(data);
-
-       setting_accessibility_universal_switch_dbus_config_cancelCaptureSwitch(&ad->config);
-       ad->us_configuration.switch_id = {};
-
-       return EINA_TRUE;
-}
-
-void AccessoriesSwitchesPage::backCb(void *data, Evas_Object *obj, void *event_info)
-{
-       retm_if(data == NULL, "Data argument is NULL");
-       auto ad = static_cast<SettingAccessibility *>(data);
-       elm_naviframe_item_pop(ad->md.getNaviframe()->getObject());
-}
+}
\ No newline at end of file
index 67e6c55..d6b8775 100644 (file)
 #ifndef ACCESSORIES_SWITCHES_PAGE_HPP
 #define ACCESSORIES_SWITCHES_PAGE_HPP
 
-#include "SettingAccessibility.hpp"
-
 #include <Elementary.h>
-#include "SettingPopup.hpp"
+
+#include "SettingAccessibility.hpp"
+#include "setting-accessibility.h"
 
 /**
  * View allowing to configure switches provided by AccessoriesSwitchProvider.
@@ -37,24 +37,25 @@ public:
        void attachActionCallback(UniversalSwitchCb cb, void *cbData);
 
 private:
-       static Evas_Object *createEntry(Evas_Object *parent, const char *part_name);
-       Layout *createLayout(Widget *parent, const std::string &edj_file, const std::string &group);
        static void captureSwitchCb(void *user_data, const char *switch_id);
-       void alreadyMappedSwitchPopup(); //TODO rename
-       static void okResponseCb(void *data, Evas_Object *obj, void *event_info);
-       static void popupResponseCb(void *data, Evas_Object *obj, void *event_info);
        static void accessorySwitchActionCb(SettingAccessibility *ad, const std::string &action, void *user_data);
        static Eina_Bool renewCaptureSwitchCb(void *data, Elm_Object_Item *it);
-       static Eina_Bool naviframPopCb(void *data, Elm_Object_Item *it);
-       static void backCb(void *data, Evas_Object *obj, void *event_info);
+       void alreadyMappedSwitchPopup(); //TODO rename
+       void newSwitchPopup();
 
        SettingAccessibility *context_ = nullptr;
-       UniversalSwitchCb accessories_switch_added_cb = nullptr;
+       UniversalSwitchCb accessories_switch_added_cb;
        void *accessories_switch_added_cb_data = nullptr;
        std::string switchName_; //TODO remove when lambda expression would be added
-       Evas_Object *entry;
-       std::unique_ptr<SettingPopup> settingPopup_;
        std::unique_ptr<ActionPage> actionPage_;
+
+       const std::string EDJ_ACCESSORY = "edje/accessibility-smart-switch-accessory.edj";
+       const std::string PRT_ACCESSORY_LABEL = "accessory_label";
+       const std::string EDJ_ACCESSORY_POPUP = "edje/accessibility-smart-switch-accessory-popup.edj";
+       const std::string PRT_ACCESSORY_POPUP_ENTRY = "accessory_popup_entry";
+       const std::string GRP_ACCESSORY_POPUP = "accessory_popup";
+       const std::string GRP_ACCESSORY = "accessory";
+       const std::string PRT_ACCESSORY_POPUP_LABEL = "accessory_popup_label";
 };
 
 #endif
index eed5cab..d37b650 100644 (file)
@@ -25,7 +25,6 @@ ActionPage::ActionPage(SettingAccessibility *ad)
 {
        context_->setValuePage_ = std::make_unique<SetValuePage>(context_, ValueEditorType::RADIOS, _("IDS_ACCS_UNIVERSAL_SWITCH_SELECT_ACTION"));
        SetValuePage::addRadioItemChangedCb(context_, actionChangedCb, this);
-
        for (auto i = 0u; i < context_->config.activity_types.size(); ++i)
                SetValuePage::addRadioItem(context_, context_->config.activity_types[i]->name, i, false);
 }
index 8757caf..71f393e 100644 (file)
@@ -4,6 +4,15 @@ Button::Button(Widget *parent)
        : Widget(parent)
 {
        uniqueObj_.reset(elm_button_add(parent->getObject()));
-       evas_object_size_hint_weight_set(uniqueObj_.get(), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       evas_object_size_hint_align_set(uniqueObj_.get(), EVAS_HINT_FILL, 0.5);
+       setWeightHint(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       setAlignHint(EVAS_HINT_FILL, 0.5);
+}
+
+Button::Button(Widget *parent, const TranslatedString &text, std::function<void()> onClick)
+{
+       uniqueObj_.reset(elm_button_add(parent->getObject()));
+       setWeightHint(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       setAlignHint(EVAS_HINT_FILL, 0.5);
+       setText(text);
+       setEvasSmartCallback("clicked", onClick);
 }
index 089e9bd..dbbf5bc 100644 (file)
@@ -6,7 +6,10 @@
 class Button : public Widget
 {
 public:
+       static constexpr const char *BACK_BUTTON_ARROW_STYLE = "naviframe/end_btn/default";
+
        Button(Widget *parent);
+       Button(Widget *parent, const TranslatedString &text, std::function<void()> onClick);
 };
 
 #endif
index b262fd8..be16b54 100644 (file)
@@ -11,6 +11,12 @@ void Entry::setEntryText(const TranslatedString &text)
        elm_entry_entry_set(uniqueObj_.get(), text.c_str());
 }
 
+std::string Entry::getEntryText()
+{
+       auto a = elm_entry_entry_get(uniqueObj_.get());
+       return a ? a : std::string{};
+}
+
 void Entry::moveCursorToEnd()
 {
        elm_entry_cursor_end_set(uniqueObj_.get());
index a1712b8..7ba86bb 100644 (file)
@@ -9,6 +9,7 @@ public:
        Entry(Widget *parent);
 
        void setEntryText(const TranslatedString &text);
+       std::string getEntryText();
        void moveCursorToEnd();
 };
 
index 67a76dd..08099ab 100644 (file)
@@ -1,5 +1,7 @@
 #include "Layout.hpp"
 #include "setting-debug.h"
+#include <app.h>
+
 
 Layout::Layout(Widget *parent)
        : Widget(parent)
@@ -7,6 +9,20 @@ Layout::Layout(Widget *parent)
        uniqueObj_.reset(elm_layout_add(parent->getObject()));
 }
 
+Layout::Layout(Widget *parent, const std::string &edjeFile, const std::string &group)
+       : Widget(parent)
+{
+       uniqueObj_.reset(elm_layout_add(parent->getObject()));
+       setWeightHint(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+       std::string edjePath;
+       if (auto resPath = app_get_resource_path()) {
+               edjePath = std::string{resPath} + edjeFile;
+               free(resPath);
+       }//TODO refactor to cpp style, maybe use struct or std::function
+       setFile(edjePath, group);
+}
+
 void Layout::setFile(const std::string &edjeFile, const std::string &group)
 {
        elm_layout_file_set(uniqueObj_.get(), edjeFile.c_str(), group.c_str());
index eba1f2e..6e0420e 100644 (file)
@@ -7,6 +7,7 @@ class Layout : public Widget
 {
 public:
        Layout(Widget *parent);
+       Layout(Widget *parent, const std::string &edjeFile, const std::string &group);
        void setFile(const std::string &edjeFile, const std::string &group);
        void setTheme(const std::string &klass, const std::string &group, const std::string &style);
        void setText(const std::string &part, const TranslatedString &text);
index e1a9afb..61de614 100644 (file)
@@ -4,13 +4,14 @@ Popup::Popup(Widget *parent)
        : Widget(parent)
 {
        uniqueObj_.reset(elm_popup_add(parent->getObject()));
+       setWeightHint(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 }
 
-Popup::Popup(Widget *parent, const TranslatedString &title, const std::string &text)
+Popup::Popup(Widget *parent, const TranslatedString &title)
 {
        uniqueObj_.reset(elm_popup_add(parent->getObject()));
-       setText(text);
        setPartText("title,text", title);
+       setWeightHint(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 }
 
 void Popup::setOrientation(Elm_Popup_Orient orientation)
index 1027942..1171905 100644 (file)
@@ -7,7 +7,7 @@ class Popup : public Widget
 {
 public:
        Popup(Widget *parent);
-       Popup(Widget *parent, const TranslatedString &title, const std::string &text);
+       Popup(Widget *parent, const TranslatedString &title);
 
        void setOrientation(Elm_Popup_Orient orientation);
        void setAlignment(double h, double v);
index eb74bff..3c3a27d 100644 (file)
@@ -102,19 +102,15 @@ void RemoveSwitchPage::useNaviframeTitleAsCounter(RemoveSwitchPage *self)
 
 void RemoveSwitchPage::createPopupForSwitchesRemoving()
 {
-       auto popup = Widget::make<Popup>(context_->md.getNaviframe());
+       auto popup = Widget::make<Popup>(context_->md.getNaviframe(), "IDS_ACCS_UNIVERSAL_SWITCH_DELETE_SWITCHES");
 
        popup->setOrientation(ELM_POPUP_ORIENT_CENTER);
-       popup->setWeightHint(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
        int vconf_val;
        int vconf_ret = vconf_get_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_INTERACTION_SERVICE, &vconf_val);
        retm_if(vconf_ret != 0,
                        "Failed to get vconf bool value VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_INTERACTION_SERVICE. Error: %d", vconf_ret);
 
-       popup->setPartText("title,text", TranslatedString{"IDS_ACCS_UNIVERSAL_SWITCH_DELETE_SWITCHES"});
-
-
        if (vconf_val && context_->switches_to_remove_counter == context_->set_value_layout.getGenlist()->size()) {
                popup->setText("IDS_ACCS_UNIVERSAL_SWITCH_DELETE_ALL_SWITCHES_DESC");
        } else {
index 05b4db2..937c674 100644 (file)
@@ -234,10 +234,8 @@ void ScreenReaderSettingsPage::mouseUpGendialListCb(void *data, Evas_Object *obj
 
        auto window = self->context_->md.getWindow();
 
-       self->popup_ = Widget::make<Popup>(window);
+       self->popup_ = Widget::make<Popup>(window, "IDS_ACCS_TMBODY_STATUS_BAR_INFORMATION");
        self->popup_->setAlignment(ELM_NOTIFY_ALIGN_FILL, 1.0);
-       self->popup_->setPartText("title,text", "IDS_ACCS_TMBODY_STATUS_BAR_INFORMATION");
-       self->popup_->setWeightHint(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
        auto removeCb = [p = self->popup_, window]() {
                window->removeChild(p);
@@ -432,9 +430,8 @@ void ScreenReaderSettingsPage::createSpeechRatePopup(void *item)
 {
        auto window = context_->md.getWindow();
 
-       popup_ = Widget::make<Popup>(window, "IDS_ST_BODY_SPEECH_RATE", "");
+       popup_ = Widget::make<Popup>(window, "IDS_ST_BODY_SPEECH_RATE");
        popup_->setAlignment(ELM_NOTIFY_ALIGN_FILL, 1.0);
-       popup_->setWeightHint(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
        auto removeCb = [p = popup_, window]() {
                window->removeChild(p);
index 6a9769b..31a96b6 100644 (file)
@@ -31,7 +31,6 @@ SettingPopup::SettingPopup(void *data, Widget *parent,
        popup_ = Widget::make<Popup>(parent);
 
        popup_->setAlignment(ELM_NOTIFY_ALIGN_FILL, 1.0);
-       popup_->setWeightHint(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        popup_->setText(text);
        popup_->setPartText("title,text", title);
        popup_->setEextEventCallback(EEXT_CALLBACK_BACK, []() {});