-#define ALPHA 150
+#define ALPHA 200
#define EDCDEBUG(PART_TEXT, R, G, B) part { type: RECT; \
- scale: 1; \
+ scale: 0; \
description { state: "default" 0.0; \
rel1.to: PART_TEXT; \
rel2.to: PART_TEXT; \
} \
}\
-
collections {
group { name: "elm/notify/block_events/popup/universalSwitchTransparent";
parts {
color: 0 0 0 0;
}
description { state: "clicked" 0.0;
- color: 0 0 0 192;
+ color: 0 0 0 0;
}
}
program {
group { name: "elm/popup/base/universalSwitchTransparent";
parts {
part { name: "base"; type: RECT;
- scale: 1;
- description { state: "default" 0.0;
- min: 240 0;
- color: 255 255 255 ALPHA;
- }
- }
- part { name: "elm.swallow.back"; type: SWALLOW;
scale: 0;
description { state: "default" 0.0;
- fixed: 0 1;
- visible: 0;
- }
- description { state: "back_visible" 0.0;
- inherit: "default" 0.0;
- align: 0.0 0.0;
- min: 0 50;
- max: -1 50;
- visible: 1;
+ color: 0 0 0 0;
}
}
part { name: "elm.swallow.content"; type: SWALLOW;
scale: 0;
description { state: "default" 0.0;
}
- description { state: "back_visible" 0.0;
- inherit: "default" 0.0;
- rel1.relative: 0.0 1.0;
- rel1.to_y: "elm.swallow.back";
- rel2.relative: 1.0 1.0;
- }
+ }
+ }
+}
+group { name: "universalSwitchTransparentLayout";
+ parts {
+ part { name: "base"; type: RECT;
+ scale: 0;
+ description { state: "default" 0.0;
+ color: 255 255 255 ALPHA;
+ }
+ part { name: "elm.swallow.back"; type: SWALLOW;
+ scale: 0;
+ description { state: "default" 0.0;
+ visible: 0;
+ }
+ description { state: "back_visible" 0.0;
+ inherit: "default" 0.0;
+ align: 0.0 0.0;
+ min: 0 50;
+ max: -1 50;
+ visible: 1;
+ }
+ }
+ part { name: "elm.swallow.content"; type: SWALLOW;
+ scale: 0;
+ description { state: "default" 0.0;
+ }
+ description { state: "back_visible" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: 0.0 1.0;
+ rel1.to_y: "elm.swallow.back";
+ rel2.relative: 1.0 1.0;
+ }
+ }
}
}
programs {
target: "elm.swallow.back";
target: "elm.swallow.content";
}
+ script
+ {
+ public message(Msg_Type:type, id, ...)
+ {
+ static my_val = 0;
+ if(type == MSG_INT && id == 0)
+ {
+ my_val = getarg(2);
+ custom_state(PART:"base", "default", 0.0);
+ set_state_val(PART:"base", STATE_MAX, my_val, -1);
+ set_state(PART:"base", "custom", 0.0);
+ }
+ }
+ }
}
}
-group { name: "universalSwitchTransparentLayout";
- inherit: "elm/popup/base/universalSwitchTransparent";
-}
-
group { name: "elm/notify/center/universalSwitchTransparent";
data.item: "hide_finished_signal" "on";
parts {
rel2.to: "base";
visible: 1;
- aspect: 1.0 1.0;
+ aspect: 1.0 1.0;
}
desc { "visible";
inherit: "default";
}
}
text { "elm.text"; nomouse;
- scale: 1;
+ scale: 0;
desc { "default";
- rel1.relative: 0.1 0.0;
+ rel1.relative: 1.1 0.0;
+ rel1.to_x: "elm.swallow.content";
rel2.relative: 1.0 1.0;
color: 0 0 0 255;
color2: 0 0 0 0;
{
font: "Tizen:style=Regular";
align: 0.0 0.5;
- size: 12;
+ size: 30;
text_class: "tizen";
}
visible: 1;
void createMenuContent();
void addBackButton(Evas_Object *);
void refreshMenu();
- void setAutoTapWaitingPeriodCb(double);
void navigateThroughSubMenuOrCreateActivityChangeRequest(MenuItem *);
void navigateThroughSubMenu(const std::string &);
void navigateBack();
static void gengridItemSelectedCb(void *, Evas_Object *, void *);
static char *gengridItemLabelGetCb(void *, Evas_Object *, const char *);
static Evas_Object *gengridItemContentGetCb(void *, Evas_Object *, const char *);
+ static void sendMessageToEdje(Evas_Object *, int);
std::vector<std::string> nestedMenusLabels;
VConfInterface::CallbackHandle callbackHandle;
if (Singleton<VConfInterface>::instance().get(AUTO_TAP_KEY, false)) {
autoTapWaitingPeriodCallbackHandle = Singleton<VConfInterface>::instance().registerAndGet<double>(AUTO_TAP_WAITING_PERIOD_KEY, AUTO_TAP_WAITING_PERIOD_DEFAULT_TIME,
[this](auto x) {
- this->setAutoTapWaitingPeriodCb(x);
+ autoTapWaitingPeriod = x;
});
timer.reset(autoTapWaitingPeriod, [this]() {
return;
}
- popup.reset(elm_popup_add(Singleton<UniversalSwitch>::instance().getMainWindow()->getHandler()));
- evas_object_size_hint_weight_set(popup.get(), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ auto window = Singleton<UniversalSwitch>::instance().getMainWindow()->getHandler();
+ popup.reset(elm_popup_add(window));
+ elm_win_render(window);
evas_object_smart_callback_add(popup.get(), "dismissed", popupDismissedCb, this);
menu = Singleton<MenuBuilder>::instance().build(getCompleteLabelOfMenu());
elm_popup_orient_set(popup.get(), menu->getAlignment() == Alignment::BOTTOM ? ELM_POPUP_ORIENT_BOTTOM : ELM_POPUP_ORIENT_CENTER);
void SelectActivity::createMenuContent()
{
auto content = elm_layout_add(popup.get());
- auto gengrid = elm_gengrid_add(popup.get());
-
elm_layout_file_set(content, UNIVERSAL_SWITCH_EDJ, "universalSwitchTransparentLayout");
- elm_object_style_set(gengrid, "popup");
evas_object_size_hint_min_set(content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_object_content_set(popup.get(), content);
- elm_object_part_content_set(content, "elm.swallow.content", gengrid);
-
- if (nestedMenusLabels.size() > 1 && menu->getNavigateToSuperMenu() == NavigateToSuperMenu::ALLOW)
- addBackButton(content);
auto screenWidth = 0;
evas_object_geometry_get(content, nullptr, nullptr, &screenWidth, nullptr);
+ auto itemSize = Size {screenWidth / ITEMS_IN_GENGRID_PER_ROW,
+ static_cast<int>(screenWidth *GENGRID_ITEM_HEIGHT_WIDTH_PROPORTION / ITEMS_IN_GENGRID_PER_ROW)};
- int itemWidth = screenWidth / ITEMS_IN_GENGRID_PER_ROW;
- int itemHeight = itemWidth * GENGRID_ITEM_HEIGHT_WIDTH_PROPORTION;
- elm_gengrid_item_size_set(gengrid, itemWidth, itemHeight);
-
+ auto gengrid = elm_gengrid_add(content);
+ elm_object_style_set(gengrid, "popup");
+ elm_scroller_content_min_limit(gengrid, EINA_TRUE, EINA_TRUE);
+ elm_object_part_content_set(content, "elm.swallow.content", gengrid);
+ elm_gengrid_item_size_set(gengrid, itemSize.width, itemSize.height);
addItemsToMenu(gengrid);
- evas_object_size_hint_min_set(gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_weight_set(gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_scroller_content_min_limit(gengrid, EINA_TRUE, EINA_TRUE);
+ if (gengridItemsData.size() < ITEMS_IN_GENGRID_PER_ROW)
+ sendMessageToEdje(content, itemSize.width * gengridItemsData.size());
+
+ if (nestedMenusLabels.size() > 1 && menu->getNavigateToSuperMenu() == NavigateToSuperMenu::ALLOW)
+ addBackButton(content);
}
void SelectActivity::addBackButton(Evas_Object *content)
{
virtualBackButton.reset(elm_button_add(content));
+ evas_object_smart_callback_add(virtualBackButton.get(), "clicked", popupBackCb, this);
+
elm_atspi_accessible_name_set(virtualBackButton.get(), gettext("IDS_NAVIGATE_UP"));
elm_object_style_set(virtualBackButton.get(), "universalSwitchTransparent");
elm_object_part_content_set(content, "elm.swallow.back", virtualBackButton.get());
elm_layout_signal_emit(content, "elm,state,back,visible", "elm");
elm_object_part_text_set(virtualBackButton.get(), "default", gettext(nestedMenusLabels.end()[-2].c_str()));
+
auto backIcon = elm_icon_add(content);
auto iconPath = std::string(ICONS_DIR) + std::string("/back.png");
elm_image_file_set(backIcon, iconPath.c_str(), NULL);
elm_object_part_content_set(virtualBackButton.get(), "icon", backIcon);
- evas_object_smart_callback_add(virtualBackButton.get(), "clicked", popupBackCb, this);
}
void SelectActivity::refreshMenu()
createMenu();
}
-void SelectActivity::setAutoTapWaitingPeriodCb(double value)
-{
- autoTapWaitingPeriod = value;
-}
-
void SelectActivity::navigateThroughSubMenuOrCreateActivityChangeRequest(MenuItem *menuItem)
{
DEBUG("element %s", menuItem->getName().c_str());
auto item = static_cast<Elm_Gengrid_Item *>(event_info);
static_cast<SelectActivity *>(data)->gengridItemSelected(item);
}
+
+void SelectActivity::sendMessageToEdje(Evas_Object *layout, int value)
+{
+ Edje_Message_Int msg = {0, };
+ msg.val = value;
+ edje_object_message_send(elm_layout_edje_get(layout), EDJE_MESSAGE_INT, 0, &msg);
+}
\ No newline at end of file