From 04ffc816ab4e79b32e401a62bf7abbda991ce1b4 Mon Sep 17 00:00:00 2001 From: Jaime Thomas Date: Sun, 21 Dec 2008 19:42:30 +0000 Subject: [PATCH] Improve popup theme a bit, add ecdb_combo_clear function. --- ecdb/trunk/TODO | 6 +-- .../data/themes/default/groups/combo.edc | 40 ++----------------- ecdb/trunk/src/ecdb_widgets.c | 13 +++++- ecdb/trunk/src/ecdb_widgets.h | 1 + 4 files changed, 19 insertions(+), 41 deletions(-) diff --git a/ecdb/trunk/TODO b/ecdb/trunk/TODO index 1aa731d..caf3e21 100644 --- a/ecdb/trunk/TODO +++ b/ecdb/trunk/TODO @@ -3,7 +3,7 @@ -> ffmpeg as an alternative backend to gstreamer -> finish interface -> more flexible typebuf --> more configuration options (speed and drive choice) +-> more configuration options (speed and drive choice done) -> fix combo theme --> vlagrind errors in evas_box-- --> move callbacks to buttons instead of swallow +-> move callbacks to buttons instead of swallow (done except for welcome page) +-> send combo popup children the focus out signal diff --git a/ecdb/trunk/data/themes/default/groups/combo.edc b/ecdb/trunk/data/themes/default/groups/combo.edc index b656124..11872ad 100644 --- a/ecdb/trunk/data/themes/default/groups/combo.edc +++ b/ecdb/trunk/data/themes/default/groups/combo.edc @@ -381,15 +381,12 @@ group { parts { part { - name: "base"; - type: IMAGE; + name: "ecdb.box"; + type: BOX; description { state: "default" 0.0; - min: 1 1; - max: 1 1; color: 255 255 255 0; - visible: 1; rel1 { relative: 0.0 0.0; @@ -401,38 +398,9 @@ group { offset: -1 -1; } - image { - normal: "background.png"; - } - } - - description { - state: "active" 0.0; - inherit: "default" 0.0; - color: 255 255 255 200; - max: 9999 9999; - } - } - - part { - name: "ecdb.box"; - type: BOX; - - description { - state: "default" 0.0; - color: 255 255 255 0; - - rel1 { - to: "base"; - } - - rel2 { - to: "base"; - } - box { layout: "vertical"; - padding: 1 1; + padding: 0 2; align: 0.0 0.5; } } @@ -451,7 +419,6 @@ group { signal: "ecdb,combo,popup,show,*"; source: "ecdb"; action: STATE_SET "active" 0.0; - target: "base"; target: "ecdb.box"; transition: DECELERATE 0.2; } @@ -461,7 +428,6 @@ group { signal: "ecdb,combo,popup,hide,*"; source: "ecdb"; action: STATE_SET "default" 0.0; - target: "base"; target: "ecdb.box"; transition: DECELERATE 0.2; } diff --git a/ecdb/trunk/src/ecdb_widgets.c b/ecdb/trunk/src/ecdb_widgets.c index 3aaec90..db049ef 100644 --- a/ecdb/trunk/src/ecdb_widgets.c +++ b/ecdb/trunk/src/ecdb_widgets.c @@ -14,7 +14,7 @@ _widget_focus_handle(void *data, Evas_Object *o, const char *emission, if (!name) return; - if ((old_source) && (strcmp(old_source, source))) + if ((old_source) && (strcmp(old_source, name))) { eo = evas_object_name_find(ecore_evas_get(em->main_win_ee), old_source); edje_object_signal_emit(eo, "ecdb,focus,out", "ecdb"); @@ -710,6 +710,17 @@ ecdb_combo_data_set(Evas_Object *c, void *data) cd->data = data; } +void +ecdb_combo_clear(Evas_Object *c) +{ + Combo_Data *cd; + + cd = evas_object_data_get(c, "cd"); + edje_object_part_box_remove_all(cd->popup, "ecdb.box", 1); + cd->selected = 1; + cd->count = 0; +} + /******************************* Label ***************************************/ Evas_Object * diff --git a/ecdb/trunk/src/ecdb_widgets.h b/ecdb/trunk/src/ecdb_widgets.h index 6dbe9f4..8f17b1f 100644 --- a/ecdb/trunk/src/ecdb_widgets.h +++ b/ecdb/trunk/src/ecdb_widgets.h @@ -36,6 +36,7 @@ void ecdb_combo_header_create_set(Evas_Object *c, Evas_Object * int idx)); int ecdb_combo_selected_get(Evas_Object *c); void ecdb_combo_data_set(Evas_Object *c, void *data); +void ecdb_combo_clear(Evas_Object *c); Evas_Object *ecdb_label_add(Evas_Object *parent, const char *name); void ecdb_label_text_set(Evas_Object *l, const char *text);