static void Del(void *data, Evas_Object *obj);
static void AddButtonClicked(void *data, Evas_Object *obj, void *event_info);
+ static void MoreButtonClicked(void *data, Evas_Object *obj, void *info);
+ static void DismissedMorePopupCallback(void *data, Evas_Object *obj, void *event_info);
+ static void DismissMorePopupCallback(void *data, Evas_Object *obj, void *event_info);
+ static void MorePopupDeleteItemCallback(void *data, Evas_Object *obj, void *event_info);
+ static void MorePopupReorderItemCallback(void *data, Evas_Object *obj, void *event_info);
+
+ void ShowMorePopup();
+
static void AddLocationReplayCb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data);
void SetItemLastClicked(const model::Location *location);
Evas_Object *timezone_details_;
Evas_Object *timezone_cities_;
Evas_Object *custom_locations_list_;
+ Evas_Object *more_popup_;
const model::Location *item_last_clicked_;
const model::Location *item_to_add_;
elm_object_part_content_set(world_clock_main_, "elm.swallow.floatingbutton", fb);
elm_object_part_content_set(world_clock_main_, "elm.swallow.content", world_clock_);
+ eext_object_event_callback_add(world_clock_main_, EEXT_CALLBACK_MORE,
+ MoreButtonClicked, this);
elm_layout_signal_callback_add(world_clock_, "timezone,go,left",
- "main.world.map:arrow.left", WorldClockView::ChangeTimezoneCb,
+ "main.world.map:arrow.left", ChangeTimezoneCb,
static_cast<void *>(this));
elm_layout_signal_callback_add(world_clock_, "timezone,go,right",
- "main.world.map:arrow.right", WorldClockView::ChangeTimezoneCb,
+ "main.world.map:arrow.right", ChangeTimezoneCb,
static_cast<void *>(this));
}
+void WorldClockView::MoreButtonClicked(void *data, Evas_Object *obj, void *info)
+{
+ WorldClockView *view = static_cast<WorldClockView *>(data);
+ view->ShowMorePopup();
+}
+
+void WorldClockView::ShowMorePopup()
+{
+ more_popup_ = elm_popup_add(elm_object_top_widget_get(world_clock_main_));
+ elm_popup_align_set(more_popup_, ELM_NOTIFY_ALIGN_FILL, 1.0);
+ evas_object_size_hint_weight_set(more_popup_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_smart_callback_add(more_popup_, "dismissed", DismissedMorePopupCallback, more_popup_);
+ evas_object_smart_callback_add(more_popup_, "block,clicked", DismissMorePopupCallback, more_popup_);
+ eext_object_event_callback_add(more_popup_, EEXT_CALLBACK_BACK, DismissMorePopupCallback, more_popup_);
+ eext_object_event_callback_add(more_popup_, EEXT_CALLBACK_MORE, DismissMorePopupCallback, more_popup_);
+
+ Evas_Object *list = elm_list_add(more_popup_);
+ elm_list_mode_set(list, ELM_LIST_EXPAND);
+ evas_object_show(list);
+
+ elm_list_item_append(list, "Delete", NULL, NULL, MorePopupDeleteItemCallback, this);
+ elm_list_item_append(list, "Reorder", NULL, NULL, MorePopupReorderItemCallback, this);
+ elm_object_content_set(more_popup_, list);
+ evas_object_show(more_popup_);
+}
+
+void WorldClockView::MorePopupDeleteItemCallback(void *data, Evas_Object *obj, void *event_info)
+{
+ WorldClockView *view = static_cast<WorldClockView *>(data);
+
+ evas_object_del(view->more_popup_);
+ view->more_popup_ = nullptr;
+}
+
+void WorldClockView::MorePopupReorderItemCallback(void *data, Evas_Object *obj, void *event_info)
+{
+ WorldClockView *view = static_cast<WorldClockView *>(data);
+
+ evas_object_del(view->more_popup_);
+ view->more_popup_ = nullptr;
+}
+
+void WorldClockView::DismissedMorePopupCallback(void *data, Evas_Object *obj, void *event_info)
+{
+ Evas_Object *popup = static_cast<Evas_Object *>(data);
+ evas_object_del(popup);
+}
+
+void WorldClockView::DismissMorePopupCallback(void *data, Evas_Object *obj, void *event_info)
+{
+ Evas_Object *popup = static_cast<Evas_Object *>(data);
+ elm_popup_dismiss(popup);
+}
+
void WorldClockView::SetItemToAdd(model::Location *l)
{