Get rid of that annoying bug where all of the combo entries would be selected.

This commit is contained in:
Jaime Thomas 2008-12-24 19:16:20 +00:00
parent 5ee6ba6380
commit 1e9d496c96

View File

@ -565,6 +565,12 @@ _combo_clicked(void *data, Evas_Object *obj, void *event_info)
ecdb_combo_collapse(data); ecdb_combo_collapse(data);
} }
static void
_combo_item_hide(void *data, Evas_Object *obj, void *event_info)
{
edje_object_signal_emit(obj, "ecdb,focus,out", "ecdb");
}
static void static void
_combo_moveable_click_cb(void *data, Evas_Object *obj, const char *emission, _combo_moveable_click_cb(void *data, Evas_Object *obj, const char *emission,
const char *source) const char *source)
@ -653,6 +659,7 @@ ecdb_combo_append(Evas_Object *c, Evas_Object *o)
cd->count++; cd->count++;
edje_object_part_box_append(cd->popup, "ecdb.box", o); edje_object_part_box_append(cd->popup, "ecdb.box", o);
evas_object_smart_callback_add(o, "clicked", _combo_clicked, c); evas_object_smart_callback_add(o, "clicked", _combo_clicked, c);
evas_object_smart_callback_add(o, "hidden", _combo_item_hide, c);
} }
void void
@ -724,6 +731,8 @@ ecdb_combo_collapse(Evas_Object *c)
Combo_Data *cd; Combo_Data *cd;
const char *location; const char *location;
char buf[1024]; char buf[1024];
Eina_Iterator *it;
Evas_Object *o;
// If we close the window // If we close the window
if ((!em) || (!em->main_win_ee)) if ((!em) || (!em->main_win_ee))
@ -740,6 +749,12 @@ ecdb_combo_collapse(Evas_Object *c)
evas_object_pass_events_set(cd->popup, 1); evas_object_pass_events_set(cd->popup, 1);
edje_object_signal_emit(cd->popup, buf, "ecdb"); edje_object_signal_emit(cd->popup, buf, "ecdb");
it = evas_object_box_iterator_new(edje_object_part_object_get(cd->popup,
"ecdb.box"));
while ((eina_iterator_next(it, (void **)&o)))
evas_object_smart_callback_call(o, "hidden", c);
eina_iterator_free(it);
cd->expanded = 0; cd->expanded = 0;
} }