signal, "elm,state,unfocused";
source, SRC_ELM;
script {
- new state;
-
- state = get_int(check_state);
- if (state == STATE_CHECKED)
+ new is_checked;
+ is_checked = get_int(check_state);
+ if (is_checked == STATE_CHECKED)
set_state(PART:"part.check.icon", "unfocused.checked", 0.0);
else
set_state(PART:"part.check.icon", "unfocused.unchecked", 0.0);
source, SRC_ELM;
script {
set_int(check_state, STATE_CHECKED);
- set_state(PART:"part.check.icon", "unfocused.checked", 0.0);
+ new focus_state;
+ focus_state = get_int(is_focused);
+ if (focus_state == STATE_NORMAL)
+ set_state(PART:"part.check.icon", "unfocused.checked", 0.0);
+ else
+ set_state(PART:"part.check.icon", "focused.checked", 0.0);
}
}
{
SETTING_TRACE_BEGIN;
- struct country_info_s *country_info = NULL;
+ struct country_info_s *new_country_info = NULL;
+ struct country_info_s *previous_country_info = NULL;
struct _priv *priv = data;
if (!it || !priv) {
return;
}
- country_info = (struct country_info_s*)elm_object_item_data_get(it);
- if (!country_info) {
+ new_country_info = (struct country_info_s*)elm_object_item_data_get(it);
+ if (!new_country_info) {
_ERR("Get data failed.");
return;
}
- if (country_info->enabled) {
- _DBG("Already selected country: %s", country_info->long_name);
- return;
- } else {
- _DBG("Selecting country: %s", country_info->long_name);
- country_info->enabled = EINA_TRUE;
+ if (!new_country_info->enabled) {
+ _DBG("Selecting country: %s", new_country_info->long_name);
+ new_country_info->enabled = EINA_TRUE;
+ elm_gengrid_item_bring_in(it, ELM_GENGRID_ITEM_SCROLLTO_IN);
if (priv->selected_country_item) {
- country_info = (struct country_info_s*)elm_object_item_data_get(priv->selected_country_item);
- country_info->enabled = EINA_FALSE;
- _DBG("- deselecting: %s", country_info->long_name);
+ /* even though grid multi_select is disabled there is
+ * some bug, which makes text disappear, so we must
+ * unselect previous item manually
+ */
+ elm_gengrid_item_selected_set(priv->selected_country_item, EINA_FALSE);
+ previous_country_info = (struct country_info_s*)elm_object_item_data_get(
+ priv->selected_country_item);
+ _DBG("- deselecting: %s", previous_country_info->long_name);
+ previous_country_info->enabled = EINA_FALSE;
}
+ } else {
+ _DBG("Country already selected: %s", new_country_info->long_name);
+ return;
}
priv->selected_country_item = it;
if (!listmgr_update_grid(priv->list_mgr, LOCATION_LIST_ID))
_ERR("Listmgr update list failed.");
+
+ SETTING_TRACE_END;
}
static void _show_country_list(struct _priv *priv)
{
+ SETTING_TRACE_BEGIN;
char *lang = NULL;
if (!priv->list_mgr) {
return;
}
_country_selected_cb(priv->configured_country, priv);
+ SETTING_TRACE_END;
}
static void _btn_clicked_cb(int id, void *data, Evas_Object *obj)
return NULL;
}
- if (!listmgr_add_list(priv->list_mgr, LOCATION_LIST_ID, get_location_grid_class(),
- _country_selected_cb, priv)) {
+ if (!listmgr_add_list(priv->list_mgr, LOCATION_LIST_ID,
+ get_location_grid_class(),
+ _country_selected_cb, priv)) {
_ERR("Add location list failed.");
listmgr_destroy(priv->list_mgr);
evas_object_del(priv->base);
free(priv);
return NULL;
}
- listmgr_add_inner_grid_cb(priv->list_mgr, LOCATION_LIST_ID, &_grid_input_handler, NULL);
+ listmgr_add_inner_grid_cb(priv->list_mgr, LOCATION_LIST_ID,
+ &_grid_input_handler, NULL);
if (!viewmgr_set_view_data(VIEW_LOCATION, priv)) {
_ERR("Set view data failed.");
return NULL;
}
-// data_location_fill_list_data(priv->list_mgr, &priv->configured_country, NULL);
-
_draw_menu_area(priv);
return priv->base;
return;
}
- if (!listmgr_hide_grid(priv->list_mgr, LOCATION_LIST_ID, PART_LOCATION_MENU)) {
+ if (!listmgr_hide_grid(priv->list_mgr, LOCATION_LIST_ID,
+ PART_LOCATION_MENU))
_ERR("Listmgr hide list failed.");
- }
+
evas_object_hide(priv->base);
}
static void _destroy(void *data)
{
SETTING_TRACE_BEGIN;
-
struct _priv *priv = data;
if (!priv) {