From: Enlightenment S. <no-...@en...> - 2010-12-01 06:52:54
|
Log: hoverlist -> ctxpopup - as its not just a list really. it is a popup of arbitrary content. list is one of them. Author: raster Date: 2010-11-30 22:52:46 -0800 (Tue, 30 Nov 2010) New Revision: 55112 Trac: http://trac.enlightenment.org/e/changeset/55112 Added: trunk/TMP/st/elementary/src/bin/test_ctxpopup.c trunk/TMP/st/elementary/src/lib/elm_ctxpopup.c Removed: trunk/TMP/st/elementary/src/bin/test_hoverlist.c trunk/TMP/st/elementary/src/lib/elc_hoverlist.c Modified: trunk/TMP/st/elementary/data/themes/default.edc trunk/TMP/st/elementary/src/bin/Makefile.am trunk/TMP/st/elementary/src/bin/test.c trunk/TMP/st/elementary/src/lib/Elementary.h.in trunk/TMP/st/elementary/src/lib/Makefile.am Modified: trunk/TMP/st/elementary/data/themes/default.edc =================================================================== --- trunk/TMP/st/elementary/data/themes/default.edc 2010-12-01 05:28:13 UTC (rev 55111) +++ trunk/TMP/st/elementary/data/themes/default.edc 2010-12-01 06:52:46 UTC (rev 55112) @@ -6981,7 +6981,7 @@ } /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/hover/base/hoverlist/default"; + group { name: "elm/hover/base/ctxpopup/default"; images { image: "bt_base2.png" COMP; image: "bt_hilight.png" COMP; @@ -7418,10 +7418,10 @@ } /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/list/item/hoverlist"; - alias: "elm/list/item_odd/hoverlist"; - alias: "elm/list/h_item/hoverlist"; - alias: "elm/list/h_item_odd/hoverlist"; + group { name: "elm/list/item/ctxpopup"; + alias: "elm/list/item_odd/ctxpopup"; + alias: "elm/list/h_item/ctxpopup"; + alias: "elm/list/h_item_odd/ctxpopup"; parts { part { name: "button_image"; mouse_events: 1; @@ -7551,7 +7551,7 @@ } /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/list/base/hoverlist"; + group { name: "elm/list/base/ctxpopup"; data { item: "focus_highlight" "on"; } Modified: trunk/TMP/st/elementary/src/bin/Makefile.am =================================================================== --- trunk/TMP/st/elementary/src/bin/Makefile.am 2010-12-01 05:28:13 UTC (rev 55111) +++ trunk/TMP/st/elementary/src/bin/Makefile.am 2010-12-01 06:52:46 UTC (rev 55112) @@ -91,7 +91,7 @@ test_flipselector.c \ test_diskselector.c \ test_colorselector.c \ -test_hoverlist.c \ +test_ctxpopup.c \ test_bubble.c \ test_store.c Modified: trunk/TMP/st/elementary/src/bin/test.c =================================================================== --- trunk/TMP/st/elementary/src/bin/test.c 2010-12-01 05:28:13 UTC (rev 55111) +++ trunk/TMP/st/elementary/src/bin/test.c 2010-12-01 06:52:46 UTC (rev 55112) @@ -115,7 +115,7 @@ void test_flipselector(void *data, Evas_Object *obj, void *event_info); void test_diskselector(void *data, Evas_Object *obj, void *event_info); void test_colorselector(void *data, Evas_Object *obj, void *event_info); -void test_hoverlist(void *data, Evas_Object *obj, void *event_info); +void test_ctxpopup(void *data, Evas_Object *obj, void *event_info); void test_bubble(void *data, Evas_Object *obj, void *event_info); void test_store(void *data, Evas_Object *obj, void *event_info); @@ -350,7 +350,7 @@ ADD_TEST("Flip Selector", test_flipselector); ADD_TEST("Disk Selector", test_diskselector); ADD_TEST("Color Selector", test_colorselector); - ADD_TEST("Hoverlist", test_hoverlist); + ADD_TEST("Ctxpopup", test_ctxpopup); ADD_TEST("Bubble", test_bubble); ADD_TEST("Store", test_store); #undef ADD_TEST Modified: trunk/TMP/st/elementary/src/lib/Elementary.h.in =================================================================== --- trunk/TMP/st/elementary/src/lib/Elementary.h.in 2010-12-01 05:28:13 UTC (rev 55111) +++ trunk/TMP/st/elementary/src/lib/Elementary.h.in 2010-12-01 06:52:46 UTC (rev 55112) @@ -2365,26 +2365,26 @@ * "changed" - when the color value changes */ - /* hoverlist */ - typedef struct _Elm_Hoverlist_Item Elm_Hoverlist_Item; + /* ctxpopup */ + typedef struct _Elm_Ctxpopup_Item Elm_Ctxpopup_Item; - EAPI Evas_Object *elm_hoverlist_add(Evas_Object* parent); - EAPI void elm_hoverlist_hover_end(Evas_Object *obj); - EAPI Evas_Object *elm_hoverlist_item_icon_get(const Elm_Hoverlist_Item *item); - EAPI void elm_hoverlist_item_icon_set(Elm_Hoverlist_Item *item, Evas_Object *icon); - EAPI const char *elm_hoverlist_item_label_get(const Elm_Hoverlist_Item *item); - EAPI void elm_hoverlist_item_label_set(Elm_Hoverlist_Item *item, const char *label); - EAPI void elm_hoverlist_hover_parent_set(Evas_Object *obj, Evas_Object *parent); - EAPI Evas_Object *elm_hoverlist_hover_parent_get(const Evas_Object *obj); - EAPI void elm_hoverlist_clear(Evas_Object* obj); - EAPI void elm_hoverlist_horizontal_set(Evas_Object* obj, Eina_Bool horizontal); - EAPI Eina_Bool elm_hoverlist_horizontal_get(const Evas_Object *obj); - EAPI Elm_Hoverlist_Item *elm_hoverlist_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data); - EAPI void elm_hoverlist_item_del(Elm_Hoverlist_Item *item); - EAPI void elm_hoverlist_item_disabled_set(Elm_Hoverlist_Item *item, Eina_Bool disabled); - EAPI Eina_Bool elm_hoverlist_item_disabled_get(const Elm_Hoverlist_Item *item); + EAPI Evas_Object *elm_ctxpopup_add(Evas_Object* parent); + EAPI void elm_ctxpopup_hover_end(Evas_Object *obj); + EAPI Evas_Object *elm_ctxpopup_item_icon_get(const Elm_Ctxpopup_Item *item); + EAPI void elm_ctxpopup_item_icon_set(Elm_Ctxpopup_Item *item, Evas_Object *icon); + EAPI const char *elm_ctxpopup_item_label_get(const Elm_Ctxpopup_Item *item); + EAPI void elm_ctxpopup_item_label_set(Elm_Ctxpopup_Item *item, const char *label); + EAPI void elm_ctxpopup_hover_parent_set(Evas_Object *obj, Evas_Object *parent); + EAPI Evas_Object *elm_ctxpopup_hover_parent_get(const Evas_Object *obj); + EAPI void elm_ctxpopup_clear(Evas_Object* obj); + EAPI void elm_ctxpopup_horizontal_set(Evas_Object* obj, Eina_Bool horizontal); + EAPI Eina_Bool elm_ctxpopup_horizontal_get(const Evas_Object *obj); + EAPI Elm_Ctxpopup_Item *elm_ctxpopup_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data); + EAPI void elm_ctxpopup_item_del(Elm_Ctxpopup_Item *item); + EAPI void elm_ctxpopup_item_disabled_set(Elm_Ctxpopup_Item *item, Eina_Bool disabled); + EAPI Eina_Bool elm_ctxpopup_item_disabled_get(const Elm_Ctxpopup_Item *item); /* smart callbacks called: - * "dismissed" - the hoverlist was dismissed + * "dismissed" - the ctxpopup was dismissed */ /* transit */ Modified: trunk/TMP/st/elementary/src/lib/Makefile.am =================================================================== --- trunk/TMP/st/elementary/src/lib/Makefile.am 2010-12-01 05:28:13 UTC (rev 55111) +++ trunk/TMP/st/elementary/src/lib/Makefile.am 2010-12-01 06:52:46 UTC (rev 55112) @@ -92,6 +92,7 @@ elm_flipselector.c \ elm_diskselector.c \ elm_colorselector.c \ +elm_ctxpopup.c \ \ elc_anchorblock.c \ elc_anchorview.c \ @@ -99,7 +100,6 @@ elc_fileselector_button.c \ elc_fileselector_entry.c \ elc_hoversel.c \ -elc_hoverlist.c \ elc_scrolled_entry.c \ \ els_tooltip.c \ |
From: Enlightenment S. <no-...@en...> - 2010-12-01 09:54:27
|
Log: magnet->action (slider) Author: raster Date: 2010-12-01 01:54:20 -0800 (Wed, 01 Dec 2010) New Revision: 55116 Trac: http://trac.enlightenment.org/e/changeset/55116 Added: trunk/TMP/st/elementary/src/bin/test_actionslider.c trunk/TMP/st/elementary/src/lib/elm_actionslider.c Removed: trunk/TMP/st/elementary/src/bin/test_magnetslider.c trunk/TMP/st/elementary/src/lib/elm_magnetslider.c Modified: trunk/TMP/st/elementary/data/themes/default.edc trunk/TMP/st/elementary/src/bin/Makefile.am trunk/TMP/st/elementary/src/bin/test.c trunk/TMP/st/elementary/src/lib/Elementary.h.in trunk/TMP/st/elementary/src/lib/Makefile.am Modified: trunk/TMP/st/elementary/data/themes/default.edc =================================================================== --- trunk/TMP/st/elementary/data/themes/default.edc 2010-12-01 09:46:49 UTC (rev 55115) +++ trunk/TMP/st/elementary/data/themes/default.edc 2010-12-01 09:54:20 UTC (rev 55116) @@ -14870,9 +14870,9 @@ } //////////////////////////////////////////////////////////////////////////////// -// magnetslider +// actionslider //////////////////////////////////////////////////////////////////////////////// - group { name: "elm/magnetslider/base/default"; + group { name: "elm/actionslider/base/default"; images { image: "shelf_inset.png" COMP; @@ -14983,8 +14983,8 @@ } } - group { name: "elm/magnetslider/icon/default"; - alias: "elm/magnetslider/icon/bar"; + group { name: "elm/actionslider/icon/default"; + alias: "elm/actionslider/icon/bar"; images { image: "bt_bases.png" COMP; @@ -15044,7 +15044,7 @@ } } - group { name: "elm/magnetslider/base/bar"; + group { name: "elm/actionslider/base/bar"; images { image: "shelf_inset.png" COMP; Modified: trunk/TMP/st/elementary/src/bin/Makefile.am =================================================================== --- trunk/TMP/st/elementary/src/bin/Makefile.am 2010-12-01 09:46:49 UTC (rev 55115) +++ trunk/TMP/st/elementary/src/bin/Makefile.am 2010-12-01 09:54:20 UTC (rev 55116) @@ -53,7 +53,7 @@ test_inwin.c \ test_scaling.c \ test_slider.c \ -test_magnetslider.c \ +test_actionslider.c \ test_genlist.c \ test_check.c \ test_pager.c \ Modified: trunk/TMP/st/elementary/src/bin/test.c =================================================================== --- trunk/TMP/st/elementary/src/bin/test.c 2010-12-01 09:46:49 UTC (rev 55115) +++ trunk/TMP/st/elementary/src/bin/test.c 2010-12-01 09:54:20 UTC (rev 55116) @@ -57,7 +57,7 @@ void test_scaling(void *data, Evas_Object *obj, void *event_info); void test_scaling2(void *data, Evas_Object *obj, void *event_info); void test_slider(void *data, Evas_Object *obj, void *event_info); -void test_magnetslider(void *data, Evas_Object *obj, void *event_info); +void test_actionslider(void *data, Evas_Object *obj, void *event_info); void test_genlist(void *data, Evas_Object *obj, void *event_info); void test_genlist2(void *data, Evas_Object *obj, void *event_info); void test_genlist3(void *data, Evas_Object *obj, void *event_info); @@ -291,7 +291,7 @@ ADD_TEST("Scaling", test_scaling); ADD_TEST("Scaling 2", test_scaling2); ADD_TEST("Slider", test_slider); - ADD_TEST("Magnetslider", test_magnetslider); + ADD_TEST("Actionslider", test_actionslider); ADD_TEST("Genlist", test_genlist); ADD_TEST("Genlist 2", test_genlist2); ADD_TEST("Genlist 3", test_genlist3); Modified: trunk/TMP/st/elementary/src/lib/Elementary.h.in =================================================================== --- trunk/TMP/st/elementary/src/lib/Elementary.h.in 2010-12-01 09:46:49 UTC (rev 55115) +++ trunk/TMP/st/elementary/src/lib/Elementary.h.in 2010-12-01 09:54:20 UTC (rev 55116) @@ -1614,26 +1614,26 @@ EAPI void elm_slider_indicator_show_set(Evas_Object *obj, Eina_Bool show); EAPI Eina_Bool elm_slider_indicator_show_get(const Evas_Object *obj); - /* magnetslider */ - typedef enum _Elm_Magnetslider_Pos + /* actionslider */ + typedef enum _Elm_Actionslider_Pos { - ELM_MAGNETSLIDER_NONE = 0, - ELM_MAGNETSLIDER_LEFT = 1 << 0, - ELM_MAGNETSLIDER_CENTER = 1 << 1, - ELM_MAGNETSLIDER_RIGHT = 1 << 2, - ELM_MAGNETSLIDER_ALL = (1 << 3) -1 - } Elm_Magnetslider_Pos; + ELM_ACTIONSLIDER_NONE = 0, + ELM_ACTIONSLIDER_LEFT = 1 << 0, + ELM_ACTIONSLIDER_CENTER = 1 << 1, + ELM_ACTIONSLIDER_RIGHT = 1 << 2, + ELM_ACTIONSLIDER_ALL = (1 << 3) -1 + } Elm_Actionslider_Pos; - EAPI Evas_Object *elm_magnetslider_add(Evas_Object *parent); - EAPI void elm_magnetslider_labels_set(Evas_Object *obj, const char *left_label, const char *center_label, const char *right_label); - EAPI void elm_magnetslider_labels_get(const Evas_Object *obj, const char **left_label, const char **center_label, const char **right_label); - EAPI const char *elm_magnetslider_selected_label_get(const Evas_Object *obj); - EAPI void elm_magnetslider_indicator_pos_set(Evas_Object *obj, Elm_Magnetslider_Pos pos); - EAPI Elm_Magnetslider_Pos elm_magnetslider_indicator_pos_get(const Evas_Object *obj); - EAPI void elm_magnetslider_magnet_pos_set(Evas_Object *obj, Elm_Magnetslider_Pos pos); - EAPI Elm_Magnetslider_Pos elm_magnetslider_magnet_pos_get(const Evas_Object *obj); - EAPI void elm_magnetslider_enabled_pos_set(Evas_Object *obj, Elm_Magnetslider_Pos pos); - EAPI Elm_Magnetslider_Pos elm_magnetslider_enabled_pos_get(const Evas_Object *obj); + EAPI Evas_Object *elm_actionslider_add(Evas_Object *parent); + EAPI void elm_actionslider_labels_set(Evas_Object *obj, const char *left_label, const char *center_label, const char *right_label); + EAPI void elm_actionslider_labels_get(const Evas_Object *obj, const char **left_label, const char **center_label, const char **right_label); + EAPI const char *elm_actionslider_selected_label_get(const Evas_Object *obj); + EAPI void elm_actionslider_indicator_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos); + EAPI Elm_Actionslider_Pos elm_actionslider_indicator_pos_get(const Evas_Object *obj); + EAPI void elm_actionslider_magnet_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos); + EAPI Elm_Actionslider_Pos elm_actionslider_magnet_pos_get(const Evas_Object *obj); + EAPI void elm_actionslider_enabled_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos); + EAPI Elm_Actionslider_Pos elm_actionslider_enabled_pos_get(const Evas_Object *obj); /* smart callbacks called: * "selected" - when user selects a position (the label is passed as * event info)". Modified: trunk/TMP/st/elementary/src/lib/Makefile.am =================================================================== --- trunk/TMP/st/elementary/src/lib/Makefile.am 2010-12-01 09:46:49 UTC (rev 55115) +++ trunk/TMP/st/elementary/src/lib/Makefile.am 2010-12-01 09:54:20 UTC (rev 55116) @@ -64,7 +64,7 @@ elm_toolbar.c \ elm_list.c \ elm_slider.c \ -elm_magnetslider.c \ +elm_actionslider.c \ elm_genlist.c \ elm_check.c \ elm_radio.c \ |
From: Enlightenment S. <no-...@en...> - 2010-12-07 05:15:17
|
Log: From: Jihoon Kim <jih...@sa...> Subject: [E-devel] [PATCH] elm_slider patch for disable state elm_slider does not support disable state, so I make this patch. Please review it and upload in svn if it is ok. (nb - also fixed vertical slider sizing in defaul theme and changed jihoons changes to slider test to make the vertical sliders in a horizontal box so they dont get silly long windows) Author: raster Date: 2010-12-06 21:15:05 -0800 (Mon, 06 Dec 2010) New Revision: 55340 Trac: http://trac.enlightenment.org/e/changeset/55340 Modified: trunk/TMP/st/elementary/data/themes/default.edc trunk/TMP/st/elementary/src/bin/test_slider.c trunk/TMP/st/elementary/src/lib/elm_slider.c Modified: trunk/TMP/st/elementary/data/themes/default.edc =================================================================== --- trunk/TMP/st/elementary/data/themes/default.edc 2010-12-07 05:04:45 UTC (rev 55339) +++ trunk/TMP/st/elementary/data/themes/default.edc 2010-12-07 05:15:05 UTC (rev 55340) @@ -13741,6 +13741,15 @@ inherit: "default" 0.0; visible: 1; } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 0 0 100; + } + description { state: "disabled_inverted" 0.0; + inherit: "default" 0.0; + color: 255 0 0 100; + visible: 1; + } } part { name: "base_over"; @@ -13839,6 +13848,18 @@ rel1.offset: 0 4; rel2.offset: 0 -5; } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 128 128 128; + visible: 0; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; + visible: 1; + text.min: 1 1; + } } part { name: "elm.swallow.end"; @@ -13918,6 +13939,18 @@ rel1.offset: -5 0; rel2.offset: -5 -1; } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 128 128 128; + visible: 0; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; + visible: 1; + text.min: 1 1; + } } part { name: "elm.dragable.slider"; type: RECT; @@ -13973,6 +14006,10 @@ } fill.smooth: 0; } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 128 128 128 128; + } } part { name: "button1"; mouse_events: 0; @@ -14157,6 +14194,17 @@ visible: 1; } } + part { name: "disabler"; + type: RECT; + description { state: "default" 0.0; + color: 0 0 0 0; + visible: 0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } } programs { program { name: "text_show"; @@ -14252,6 +14300,69 @@ thumb_up(); } } + program { + name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "button0"; + target: "disabler"; + after: "disable_text"; + } + program { name: "disable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.text", "disabled_visible", 0.0); + else + set_state(PART:"elm.text", "disabled", 0.0); + + get_state(PART:"elm.units", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.units", "disabled_visible", 0.0); + else + set_state(PART:"elm.units", "disabled", 0.0); + + get_state(PART:"level2", st, 30, vl); + if (!strcmp(st, "inverted")) + set_state(PART:"level2", "disabled_inverted", 0.0); + else + set_state(PART:"level2", "disabled", 0.0); + } + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "button0"; + target: "disabler"; + after: "enable_text"; + } + program { name: "enable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "disabled_visible")) + set_state(PART:"elm.text", "visible", 0.0); + else + set_state(PART:"elm.text", "default", 0.0); + + get_state(PART:"elm.units", st, 30, vl); + if (!strcmp(st, "disabled_visible")) + set_state(PART:"elm.units", "visible", 0.0); + else + set_state(PART:"elm.units", "default", 0.0); + + get_state(PART:"level2", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"level2", "visible", 0.0); + else + set_state(PART:"level2", "default", 0.0); + } + } } } @@ -14357,6 +14468,15 @@ inherit: "default" 0.0; visible: 1; } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 0 0 100; + } + description { state: "disabled_inverted" 0.0; + inherit: "default" 0.0; + color: 255 0 0 100; + visible: 1; + } } part { name: "base_over"; @@ -14432,13 +14552,13 @@ scale: 1; description { state: "default" 0.0; visible: 0; - fixed: 1 1; + fixed: 0 1; align: 0.5 0.0; rel1.to_y: "elm.swallow.icon"; - rel1.relative: 0.5 1.0; + rel1.relative: 0.0 1.0; rel1.offset: 0 -1; rel2.to_y: "elm.swallow.icon"; - rel2.relative: 0.5 1.0; + rel2.relative: 1.0 1.0; rel2.offset: -1 -1; color: 0 0 0 255; text { @@ -14455,6 +14575,18 @@ rel1.offset: 4 0; rel2.offset: -5 0; } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 128 128 128; + visible: 0; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; + visible: 1; + text.min: 1 1; + } } part { name: "elm.swallow.end"; @@ -14534,6 +14666,22 @@ rel1.offset: 8 -9; rel2.offset: -9 -9; } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 0 0 0 128; + color3: 0 0 0 0; + visible: 0; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + fixed: 1 1; + visible: 1; + text.min: 1 1; + rel1.offset: 8 -9; + rel2.offset: -9 -9; + color: 0 0 0 128; + color3: 0 0 0 0; + } } part { name: "elm.dragable.slider"; type: RECT; @@ -14589,6 +14737,10 @@ } fill.smooth: 0; } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 128 128 128 128; + } } part { name: "button1"; mouse_events: 0; @@ -14772,7 +14924,19 @@ visible: 1; } } - } + part { name: "disabler"; + type: RECT; + description { state: "default" 0.0; + color: 0 0 0 0; + visible: 0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { program { name: "text_show"; signal: "elm,state,text,visible"; @@ -14866,6 +15030,70 @@ thumb_up(); } } + program { + name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "button0"; + target: "disabler"; + after: "disable_text"; + } + program { name: "disable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.text", "disabled_visible", 0.0); + else + set_state(PART:"elm.text", "disabled", 0.0); + + get_state(PART:"elm.units", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.units", "disabled_visible", 0.0); + else + set_state(PART:"elm.units", "disabled", 0.0); + + get_state(PART:"level2", st, 30, vl); + if (!strcmp(st, "inverted")) + set_state(PART:"level2", "disabled_inverted", 0.0); + else + set_state(PART:"level2", "disabled", 0.0); + } + } + + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "button0"; + target: "disabler"; + after: "enable_text"; + } + program { name: "enable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "disabled_visible")) + set_state(PART:"elm.text", "visible", 0.0); + else + set_state(PART:"elm.text", "default", 0.0); + + get_state(PART:"elm.units", st, 30, vl); + if (!strcmp(st, "disabled_visible")) + set_state(PART:"elm.units", "visible", 0.0); + else + set_state(PART:"elm.units", "default", 0.0); + + get_state(PART:"level2", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"level2", "visible", 0.0); + else + set_state(PART:"level2", "default", 0.0); + } + } } } Modified: trunk/TMP/st/elementary/src/bin/test_slider.c =================================================================== --- trunk/TMP/st/elementary/src/bin/test_slider.c 2010-12-07 05:04:45 UTC (rev 55339) +++ trunk/TMP/st/elementary/src/bin/test_slider.c 2010-12-07 05:15:05 UTC (rev 55340) @@ -14,7 +14,7 @@ void test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Evas_Object *win, *bg, *bx, *sl, *ic, *sl1; + Evas_Object *win, *bg, *bx, *sl, *ic, *sl1, *bx2; char buf[PATH_MAX]; win = elm_win_add(NULL, "slider", ELM_WIN_BASIC); @@ -48,12 +48,30 @@ evas_object_show(ic); evas_object_show(sl); + /* horizontal disable state */ ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); sl = elm_slider_add(win); + elm_slider_label_set(sl, "Disabled"); + elm_slider_icon_set(sl, ic); + elm_slider_unit_format_set(sl, "%1.1f units"); + elm_slider_span_size_set(sl, 120); + elm_object_disabled_set(sl, EINA_TRUE); + evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); + evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_box_pack_end(bx, sl); + evas_object_show(ic); + evas_object_show(sl); + + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + + sl = elm_slider_add(win); elm_slider_label_set(sl, "Horizontal inverted"); elm_slider_end_set(sl, ic); elm_slider_span_size_set(sl, 80); @@ -62,14 +80,37 @@ elm_slider_indicator_format_set(sl, "%3.0f"); elm_slider_min_max_set(sl, 50, 150); elm_slider_value_set(sl, 80); - elm_slider_inverted_set(sl, 1); + elm_slider_inverted_set(sl, EINA_TRUE); evas_object_size_hint_align_set(sl, 0.5, 0.5); evas_object_size_hint_weight_set(sl, 0.0, 0.0); elm_box_pack_end(bx, sl); evas_object_show(ic); evas_object_show(sl); + /* label2 disable */ + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + sl = elm_slider_add(win); + elm_slider_label_set(sl, "Disabled inverted"); + elm_slider_end_set(sl, ic); + elm_slider_span_size_set(sl, 80); + evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); + evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_slider_indicator_format_set(sl, "%3.0f"); + elm_slider_min_max_set(sl, 50, 150); + elm_slider_value_set(sl, 80); + elm_slider_inverted_set(sl, EINA_TRUE); + elm_object_disabled_set(sl, EINA_TRUE); + evas_object_size_hint_align_set(sl, 0.5, 0.5); + evas_object_size_hint_weight_set(sl, 0.0, 0.0); + elm_box_pack_end(bx, sl); + evas_object_show(ic); + evas_object_show(sl); + + sl = elm_slider_add(win); elm_slider_indicator_show_set(sl, EINA_FALSE); elm_slider_label_set(sl, "Scale doubled"); elm_slider_unit_format_set(sl, "%3.0f units"); @@ -79,12 +120,18 @@ elm_slider_indicator_format_set(sl, "%3.0f"); elm_slider_min_max_set(sl, 50, 150); elm_slider_value_set(sl, 80); - elm_slider_inverted_set(sl, 1); + elm_slider_inverted_set(sl, EINA_TRUE); elm_object_scale_set(sl, 2.0); elm_box_pack_end(bx, sl); evas_object_show(ic); evas_object_show(sl); + bx2 = elm_box_add(win); + evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_box_horizontal_set(bx2, EINA_TRUE); + elm_box_pack_end(bx, bx2); + evas_object_show(bx2); + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -93,7 +140,7 @@ sl = elm_slider_add(win); elm_slider_icon_set(sl, ic); elm_slider_label_set(sl, "Vertical inverted"); - elm_slider_inverted_set(sl, 1); + elm_slider_inverted_set(sl, EINA_TRUE); elm_slider_unit_format_set(sl, "units"); elm_slider_span_size_set(sl, 60); evas_object_size_hint_align_set(sl, 0.5, EVAS_HINT_FILL); @@ -102,7 +149,7 @@ elm_slider_value_set(sl, 0.2); elm_object_scale_set(sl, 1.0); elm_slider_horizontal_set(sl, 0); - elm_box_pack_end(bx, sl); + elm_box_pack_end(bx2, sl); evas_object_show(ic); evas_object_show(sl); @@ -118,10 +165,33 @@ elm_slider_value_set(sl, 0.2); elm_object_scale_set(sl, 1.0); elm_slider_horizontal_set(sl, EINA_FALSE); - elm_box_pack_end(bx, sl); + elm_box_pack_end(bx2, sl); evas_object_show(ic); evas_object_show(sl); + /* vertical disable state */ + ic = elm_icon_add(win); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_HORIZONTAL, 1, 1); + + sl = elm_slider_add(win); + elm_slider_icon_set(sl, ic); + elm_slider_label_set(sl, "Disabled vertical"); + elm_slider_inverted_set(sl, EINA_TRUE); + elm_slider_unit_format_set(sl, "units"); + elm_slider_span_size_set(sl, 100); + evas_object_size_hint_align_set(sl, 0.5, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(sl, 0.0, EVAS_HINT_EXPAND); + elm_slider_indicator_format_set(sl, "%1.1f"); + elm_slider_value_set(sl, 0.2); + elm_object_scale_set(sl, 1.0); + elm_slider_horizontal_set(sl, 0); + elm_object_disabled_set(sl, EINA_TRUE); + elm_box_pack_end(bx2, sl); + evas_object_show(ic); + evas_object_show(sl); + evas_object_show(win); } #endif Modified: trunk/TMP/st/elementary/src/lib/elm_slider.c =================================================================== --- trunk/TMP/st/elementary/src/lib/elm_slider.c 2010-12-07 05:04:45 UTC (rev 55339) +++ trunk/TMP/st/elementary/src/lib/elm_slider.c 2010-12-07 05:15:05 UTC (rev 55340) @@ -64,6 +64,7 @@ static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); +static void _disable_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _sub_del(void *data, Evas_Object *obj, void *event_info); @@ -226,6 +227,17 @@ } static void +_disable_hook(Evas_Object *obj) +{ + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + if (elm_widget_disabled_get(obj)) + edje_object_signal_emit(wd->slider, "elm,state,disabled", "elm"); + else + edje_object_signal_emit(wd->slider, "elm,state,enabled", "elm"); +} + +static void _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); @@ -449,6 +461,7 @@ elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); + elm_widget_disable_hook_set(obj, _disable_hook); elm_widget_can_focus_set(obj, EINA_TRUE); elm_widget_event_hook_set(obj, _event_hook); |
From: Enlightenment S. <no-...@en...> - 2011-01-05 07:49:20
|
Log: From: Daniel Juyung Seo <juy...@sa...> Subject: [E-devel] [Patch] elm_actionslider feature patch for elementary. This patch is for elementary elm_actionslider. Mr. Sumanth created this patch. I reviewed it and fixed some. This patch includes below features. - Indicator label Set/Get APIs. - _del_hook fix for wd->drag_button_base. - Added magnet disable feature. _drag_button_up_cb fix for no magnet handling. If magnet position is set to ELM_ACTIONSLIDER_NONE, it disables magnetic. Added a test case to elementary_test. Author: raster Date: 2011-01-04 23:49:11 -0800 (Tue, 04 Jan 2011) New Revision: 55872 Trac: http://trac.enlightenment.org/e/changeset/55872 Modified: trunk/TMP/st/elementary/data/themes/default.edc trunk/TMP/st/elementary/src/bin/test_actionslider.c trunk/TMP/st/elementary/src/lib/Elementary.h.in trunk/TMP/st/elementary/src/lib/elm_actionslider.c Modified: trunk/TMP/st/elementary/data/themes/default.edc =================================================================== --- trunk/TMP/st/elementary/data/themes/default.edc 2011-01-05 06:32:30 UTC (rev 55871) +++ trunk/TMP/st/elementary/data/themes/default.edc 2011-01-05 07:49:11 UTC (rev 55872) @@ -15980,6 +15980,28 @@ color: 255 255 255 190; } } + part { name: "elm.text.indicator"; + type: TEXT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "elm.drag_button"; + offset: 5 0; + } + rel2 { + to: "elm.drag_button"; + offset: -5 0; + } + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + size: 10; + align: 0.5 0.5; + min: 0 1; + } + } + } } programs { program { name: "elm.drag_button,mouse,up"; @@ -16181,6 +16203,28 @@ color: 255 255 255 190; } } + part { name: "elm.text.indicator"; + type: TEXT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { + to: "elm.drag_button"; + offset: 5 0; + } + rel2 { + to: "elm.drag_button"; + offset: -5 0; + } + color: 0 0 0 255; + text { + font: "Sans,Edje-Vera"; + size: 10; + align: 0.5 0.5; + min: 0 1; + } + } + } } programs { program { name: "elm.drag_button,mouse,up"; Modified: trunk/TMP/st/elementary/src/bin/test_actionslider.c =================================================================== --- trunk/TMP/st/elementary/src/bin/test_actionslider.c 2011-01-05 06:32:30 UTC (rev 55871) +++ trunk/TMP/st/elementary/src/bin/test_actionslider.c 2011-01-05 07:49:11 UTC (rev 55872) @@ -19,6 +19,15 @@ elm_actionslider_magnet_pos_set(obj, ELM_ACTIONSLIDER_RIGHT); } +static void +_magnet_enable_disable_cb(void *data __UNUSED__, Evas_Object *obj, void *event_info) +{ + if (!strcmp((char *)event_info, "left")) + elm_actionslider_magnet_pos_set(obj, ELM_ACTIONSLIDER_CENTER); + else if (!strcmp((char *)event_info, "right")) + elm_actionslider_magnet_pos_set(obj, ELM_ACTIONSLIDER_NONE); +} + void test_actionslider(void *data __UNUSED__, Evas_Object * obj __UNUSED__, void *event_info __UNUSED__) { @@ -85,6 +94,7 @@ elm_actionslider_indicator_pos_set(ms, ELM_ACTIONSLIDER_LEFT); elm_actionslider_magnet_pos_set(ms, ELM_ACTIONSLIDER_LEFT); elm_actionslider_labels_set(ms, NULL, "Accept", "Reject"); + elm_actionslider_indicator_label_set(ms, "Go"); evas_object_smart_callback_add(ms, "pos_changed", _position_change_magnetic_cb, NULL); evas_object_smart_callback_add(ms, "selected", _pos_selected_cb, NULL); @@ -98,10 +108,23 @@ elm_actionslider_indicator_pos_set(ms, ELM_ACTIONSLIDER_LEFT); elm_actionslider_magnet_pos_set(ms, ELM_ACTIONSLIDER_ALL); elm_actionslider_labels_set(ms, "Left", "Center", "Right"); + elm_actionslider_indicator_label_set(ms, "Go"); evas_object_smart_callback_add(ms, "selected", _pos_selected_cb, NULL); evas_object_show(ms); elm_box_pack_end(bx, ms); + ms = elm_actionslider_add(win); + evas_object_size_hint_weight_set(ms, EVAS_HINT_EXPAND, 0); + evas_object_size_hint_align_set(ms, EVAS_HINT_FILL, 0); + elm_actionslider_indicator_pos_set(ms, ELM_ACTIONSLIDER_CENTER); + elm_actionslider_magnet_pos_set(ms, ELM_ACTIONSLIDER_CENTER); + elm_actionslider_labels_set(ms, "Enable", "Magnet", "Disable"); + evas_object_smart_callback_add(ms, "pos_changed", + _magnet_enable_disable_cb, NULL); + evas_object_smart_callback_add(ms, "selected", _pos_selected_cb, NULL); + evas_object_show(ms); + elm_box_pack_end(bx, ms); + evas_object_resize(win, 320, 400); evas_object_show(win); } Modified: trunk/TMP/st/elementary/src/lib/Elementary.h.in =================================================================== --- trunk/TMP/st/elementary/src/lib/Elementary.h.in 2011-01-05 06:32:30 UTC (rev 55871) +++ trunk/TMP/st/elementary/src/lib/Elementary.h.in 2011-01-05 07:49:11 UTC (rev 55872) @@ -1671,6 +1671,8 @@ EAPI Elm_Actionslider_Pos elm_actionslider_magnet_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); EAPI void elm_actionslider_enabled_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos) EINA_ARG_NONNULL(1); EAPI Elm_Actionslider_Pos elm_actionslider_enabled_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI void elm_actionslider_indicator_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1); + EAPI const char *elm_actionslider_indicator_label_get(Evas_Object *obj) EINA_ARG_NONNULL(1); /* smart callbacks called: * "selected" - when user selects a position (the label is passed as * event info)". Modified: trunk/TMP/st/elementary/src/lib/elm_actionslider.c =================================================================== --- trunk/TMP/st/elementary/src/lib/elm_actionslider.c 2011-01-05 06:32:30 UTC (rev 55871) +++ trunk/TMP/st/elementary/src/lib/elm_actionslider.c 2011-01-05 07:49:11 UTC (rev 55872) @@ -24,6 +24,7 @@ Evas_Object *drag_button_base; Elm_Actionslider_Pos magnet_position, enabled_position; const char *text_left, *text_right, *text_center; + const char *indicator_label; Ecore_Animator *button_animator; double final_position; Eina_Bool mouse_down : 1; @@ -47,9 +48,15 @@ { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; + if (wd->drag_button_base) + { + evas_object_del(wd->drag_button_base); + wd->drag_button_base = NULL; + } if (wd->text_left) eina_stringshare_del(wd->text_left); if (wd->text_right) eina_stringshare_del(wd->text_right); if (wd->text_center) eina_stringshare_del(wd->text_center); + if (wd->indicator_label) eina_stringshare_del(wd->indicator_label); free(wd); } @@ -88,6 +95,7 @@ edje_object_part_text_set(wd->as, "elm.text.left", wd->text_left); edje_object_part_text_set(wd->as, "elm.text.right", wd->text_right); edje_object_part_text_set(wd->as, "elm.text.center", wd->text_center); + edje_object_part_text_set(wd->as, "elm.text.indicator", wd->indicator_label); edje_object_message_signal_process(wd->as); _sizing_eval(obj); } @@ -205,11 +213,7 @@ return; } - if (!wd->magnet_position) - { - wd->final_position = 0; - goto as_anim; - } + if (wd->magnet_position == ELM_ACTIONSLIDER_NONE) return; if (position < 0.3) { @@ -505,3 +509,39 @@ return NULL; } + +/** + * Set the label used on the indicator object. + * + * @param obj The actionslider object + * @param label The label which is going to be set. + * + * @ingroup Actionslider + */ +EAPI void +elm_actionslider_indicator_label_set(Evas_Object *obj, const char *label) +{ + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + + eina_stringshare_replace(&wd->indicator_label, label); + edje_object_part_text_set(wd->as, "elm.text.indicator", wd->indicator_label); +} + +/** + * Get the label used on the indicator object. + * + * @param obj The actionslider object + * @return The indicator label + * + * @ingroup Actionslider + */ +EAPI const char * +elm_actionslider_indicator_label_get(Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + return wd->indicator_label; +} |
From: Enlightenment S. <no-...@en...> - 2011-01-06 05:13:21
|
Log: From: Seunggyun Kim <sgy...@sa...> Subject: [E-devel] [Patch] Group index support I added group index feature. This feature support to show item indicates group index. I attached capture images showing group index. As you can see attached png images, Group index item includes same group items. The group index is shown until every items that have same group index are scrolled. so group index realize/unrealize is not excuteded in _item_block_position function. instead of the function, group index is controlled in _pan_calculate function. "Genlist Group" and "Genlist Group Tree" menu is added in elementary_test. you can test group index operations in elementary_test. This patch is not support elm_genlist_item_insert_before/after operation of group index. We are now considering the operations in group index., This patch assumes that the previous 2 patches are already applied to upstream. '[E-devel] [Patch] Tree support for elm_genlist_item_prepend() API.' '[E-devel] [Patch] Tree support for elm_genlist_item_insert_before/after() APIs', So this patch does not include the changes of the previous patch. I separated this patch. - 004.elm_genlist.c.patch.txt Patch for src/lib/elm_genlist.c - 005.test_genlist.c.patch.txt Patch for src/bin/test_genlist.c - 006.genlist.patch.txt Patch for data/theme/default.edc And you have to add attached group_index.png file into 'data/themes' 'group_index.png' file is group index background image. Daniel Juyung Seo help make test code and refactoring group index code. Author: raster Date: 2011-01-05 21:13:11 -0800 (Wed, 05 Jan 2011) New Revision: 55925 Trac: http://trac.enlightenment.org/e/changeset/55925 Added: trunk/TMP/st/elementary/data/themes/group_index.png Modified: trunk/TMP/st/elementary/data/themes/Makefile.am trunk/TMP/st/elementary/data/themes/default.edc trunk/TMP/st/elementary/src/bin/test.c trunk/TMP/st/elementary/src/bin/test_genlist.c trunk/TMP/st/elementary/src/lib/Elementary.h.in trunk/TMP/st/elementary/src/lib/elm_genlist.c Modified: trunk/TMP/st/elementary/data/themes/Makefile.am =================================================================== --- trunk/TMP/st/elementary/data/themes/Makefile.am 2011-01-06 04:00:39 UTC (rev 55924) +++ trunk/TMP/st/elementary/data/themes/Makefile.am 2011-01-06 05:13:11 UTC (rev 55925) @@ -216,7 +216,8 @@ icon_arrow_down_right.png \ icon_arrow_up_left.png \ icon_arrow_up_right.png \ -thumb_shadow.png +thumb_shadow.png \ +group_index.png default.edj: Makefile $(EXTRA_DIST) $(EDJE_CC) $(EDJE_FLAGS) \ Modified: trunk/TMP/st/elementary/data/themes/default.edc =================================================================== --- trunk/TMP/st/elementary/data/themes/default.edc 2011-01-06 04:00:39 UTC (rev 55924) +++ trunk/TMP/st/elementary/data/themes/default.edc 2011-01-06 05:13:11 UTC (rev 55925) @@ -16521,6 +16521,282 @@ } } } + group { name: "elm/genlist/item/group_index/default"; + alias: "elm/genlist/item_odd/group_index/default"; + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "labels" "elm.text"; + data.item: "icons" "elm.swallow.icon elm.swallow.end"; + data.item: "treesize" "20"; +// data.item: "states" ""; + images { + image: "bt_sm_base1.png" COMP; + image: "bt_sm_shine.png" COMP; + image: "bt_sm_hilight.png" COMP; + image: "ilist_item_shadow.png" COMP; + image: "group_index.png" COMP; + } + parts { + part { + name: "event"; + type: RECT; + repeat_events: 0; + description { + state: "default" 0.0; + color: 0 0 0 0; + } + } + part { + name: "base_sh"; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.0 0.0; + min: 0 10; + fixed: 1 1; + rel1 { + to: "base"; + relative: 0.0 1.0; + offset: 0 0; + } + rel2 { + to: "base"; + relative: 1.0 1.0; + offset: -1 0; + } + image { + normal: "ilist_item_shadow.png"; + } + fill.smooth: 0; + } + } + part { + name: "base"; + mouse_events: 0; + description { + state: "default" 0.0; + image { + normal: "group_index.png"; + border: 2 2 2 2; + } + fill.smooth: 0; + } + } + part { name: "bg"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1 { + relative: 0.0 0.0; + offset: -5 -5; + } + rel2 { + relative: 1.0 1.0; + offset: 4 4; + } + image { + normal: "bt_sm_base1.png"; + border: 6 6 6 6; + } + image.middle: SOLID; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + rel1 { + relative: 0.0 0.0; + offset: -2 -2; + } + rel2 { + relative: 1.0 1.0; + offset: 1 1; + } + } + } + part { name: "elm.swallow.pad"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + relative: 0.0 0.0; + offset: 4 4; + } + rel2 { + relative: 0.0 1.0; + offset: 4 -5; + } + } + } + part { name: "elm.swallow.icon"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + to_x: "elm.swallow.pad"; + relative: 1.0 0.0; + offset: -1 4; + } + rel2 { + to_x: "elm.swallow.pad"; + relative: 1.0 1.0; + offset: -1 -5; + } + } + } + part { name: "elm.swallow.end"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 1 0; + align: 1.0 0.5; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + rel1 { + relative: 1.0 0.0; + offset: -5 4; + } + rel2 { + relative: 1.0 1.0; + offset: -5 -5; + } + } + } + part { name: "elm.text"; + clip_to: "disclip"; + type: TEXT; + effect: SOFT_SHADOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; +// min: 16 16; + rel1 { + to_x: "elm.swallow.icon"; + relative: 1.0 0.0; + offset: 0 4; + } + rel2 { + to_x: "elm.swallow.end"; + relative: 0.0 1.0; + offset: -1 -5; + } + color: 0 0 0 255; + color3: 0 0 0 0; + text { + font: "Sans"; + size: 10; + min: 1 1; +// min: 0 1; + align: 0.0 0.5; + text_class: "list_item"; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 224 224 224 255; + color3: 0 0 0 64; + } + } + part { name: "fg1"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.relative: 1.0 0.5; + rel2.to: "bg"; + image { + normal: "bt_sm_hilight.png"; + border: 6 6 6 0; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "fg2"; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + rel1.to: "bg"; + rel2.to: "bg"; + image { + normal: "bt_sm_shine.png"; + border: 6 6 6 0; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { name: "disclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 64; + } + } + } + programs { + // signal: elm,state,%s,active + // a "check" item named %s went active + // signal: elm,state,%s,passive + // a "check" item named %s went passive + // default is passive + program { + name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + } + program { + name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "fg1"; + target: "fg2"; + target: "elm.text"; + transition: LINEAR 0.1; + } + program { + name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { + name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + } + } group { name: "elm/genlist/item_compress/message/default"; data.item: "stacking" "above"; data.item: "selectraise" "on"; Property changes on: trunk/TMP/st/elementary/data/themes/group_index.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/TMP/st/elementary/src/bin/test.c =================================================================== --- trunk/TMP/st/elementary/src/bin/test.c 2011-01-06 04:00:39 UTC (rev 55924) +++ trunk/TMP/st/elementary/src/bin/test.c 2011-01-06 05:13:11 UTC (rev 55925) @@ -65,6 +65,8 @@ void test_genlist5(void *data, Evas_Object *obj, void *event_info); void test_genlist6(void *data, Evas_Object *obj, void *event_info); void test_genlist7(void *data, Evas_Object *obj, void *event_info); +void test_genlist8(void *data, Evas_Object *obj, void *event_info); +void test_genlist9(void *data, Evas_Object *obj, void *event_info); void test_table(void *data, Evas_Object *obj, void *event_info); void test_gengrid(void *data, Evas_Object *obj, void *event_info); void test_gengrid2(void *data, Evas_Object *obj, void *event_info); @@ -299,6 +301,8 @@ ADD_TEST("Genlist 5", test_genlist5); ADD_TEST("Genlist 7", test_genlist7); ADD_TEST("Genlist Tree", test_genlist6); + ADD_TEST("Genlist Group", test_genlist8); + ADD_TEST("Genlist Group Tree", test_genlist9); ADD_TEST("GenGrid", test_gengrid); ADD_TEST("GenGrid 2", test_gengrid2); ADD_TEST("Checks", test_check); Modified: trunk/TMP/st/elementary/src/bin/test_genlist.c =================================================================== --- trunk/TMP/st/elementary/src/bin/test_genlist.c 2011-01-06 04:00:39 UTC (rev 55924) +++ trunk/TMP/st/elementary/src/bin/test_genlist.c 2011-01-06 05:13:11 UTC (rev 55925) @@ -1313,4 +1313,316 @@ evas_object_resize(win, 320, 320); evas_object_show(win); } + +/*************/ + +static Elm_Genlist_Item_Class itc_group; +char *gl8_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) +{ + char buf[256]; + snprintf(buf, sizeof(buf), "Group Index # %i (Item # %i)", (int)((long)data / 10), (int)(long)data); + return strdup(buf); +} + +static void +_bt_show_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + elm_genlist_item_top_show(data); + //elm_genlist_item_show(data); + //elm_genlist_item_middle_show(data); +} +static void +_bt_bring_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + elm_genlist_item_top_bring_in(data); + //elm_genlist_item_bring_in(data); + //elm_genlist_item_middle_bring_in(data); +} + +void +test_genlist8(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + Evas_Object *win, *bg, *gl, *bt[8], *bx, *bx2, *bx3; + Elm_Genlist_Item *gli = NULL, *git = NULL; + int i, bt_count, bt_num; + + win = elm_win_add(NULL, "genlist-group", ELM_WIN_BASIC); + elm_win_title_set(win, "Genlist Group"); + elm_win_autodel_set(win, 1); + + bg = elm_bg_add(win); + elm_win_resize_object_add(win, bg); + evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(bg); + + bx = elm_box_add(win); + evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(win, bx); + evas_object_show(bx); + + gl = elm_genlist_add(win); + evas_object_smart_callback_add(gl, "selected", _gl_selected, NULL); + evas_object_smart_callback_add(gl, "clicked", _gl_clicked, NULL); + evas_object_smart_callback_add(gl, "longpressed", _gl_longpress, NULL); + evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_box_pack_end(bx, gl); + evas_object_show(gl); + + itc1.item_style = "default"; + itc1.func.label_get = gl_label_get; + itc1.func.icon_get = gl_icon_get; + itc1.func.state_get = gl_state_get; + itc1.func.del = gl_del; + + itc_group.item_style = "group_index"; + itc_group.func.label_get = gl8_label_get; + itc_group.func.icon_get = NULL; + itc_group.func.state_get = NULL; + itc_group.func.del = gl_del; + + bx2 = elm_box_add(win); + elm_box_horizontal_set(bx2, EINA_TRUE); + elm_box_homogenous_set(bx2, EINA_TRUE); + evas_object_size_hint_weight_set(bx2, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL); + + bt_num = 0; + bt[bt_num] = elm_button_add(win); + elm_button_label_set(bt[bt_num], "Show 0"); + evas_object_size_hint_align_set(bt[bt_num], EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(bt[bt_num], EVAS_HINT_EXPAND, 0.0); + evas_object_show(bt[bt_num]); + elm_box_pack_end(bx2, bt[bt_num]); + + bt[++bt_num] = elm_button_add(win); + elm_button_label_set(bt[bt_num], "Show 26"); + evas_object_size_hint_align_set(bt[bt_num], EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(bt[bt_num], EVAS_HINT_EXPAND, 0.0); + evas_object_show(bt[bt_num]); + elm_box_pack_end(bx2, bt[bt_num]); + + bt[++bt_num] = elm_button_add(win); + elm_button_label_set(bt[bt_num], "Show 101"); + evas_object_size_hint_align_set(bt[bt_num], EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(bt[bt_num], EVAS_HINT_EXPAND, 0.0); + evas_object_show(bt[bt_num]); + elm_box_pack_end(bx2, bt[bt_num]); + + bt[++bt_num] = elm_button_add(win); + elm_button_label_set(bt[bt_num], "Show 480"); + evas_object_size_hint_align_set(bt[bt_num], EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(bt[bt_num], EVAS_HINT_EXPAND, 0.0); + evas_object_show(bt[bt_num]); + elm_box_pack_end(bx2, bt[bt_num]); + + elm_box_pack_end(bx, bx2); + evas_object_show(bx2); + + bx3 = elm_box_add(win); + elm_box_horizontal_set(bx3, EINA_TRUE); + elm_box_homogenous_set(bx3, EINA_TRUE); + evas_object_size_hint_weight_set(bx3, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(bx3, EVAS_HINT_FILL, EVAS_HINT_FILL); + + bt[++bt_num] = elm_button_add(win); + elm_button_label_set(bt[bt_num], "Bring top 0"); + evas_object_size_hint_align_set(bt[bt_num], EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(bt[bt_num], EVAS_HINT_EXPAND, 0.0); + evas_object_show(bt[bt_num]); + elm_box_pack_end(bx3, bt[bt_num]); + + bt[++bt_num] = elm_button_add(win); + elm_button_label_set(bt[bt_num], "Bring top 31"); + evas_object_size_hint_align_set(bt[bt_num], EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(bt[bt_num], EVAS_HINT_EXPAND, 0.0); + evas_object_show(bt[bt_num]); + elm_box_pack_end(bx3, bt[bt_num]); + + bt[++bt_num] = elm_button_add(win); + elm_button_label_set(bt[bt_num], "Bring top 239"); + evas_object_size_hint_align_set(bt[bt_num], EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(bt[bt_num], EVAS_HINT_EXPAND, 0.0); + evas_object_show(bt[bt_num]); + elm_box_pack_end(bx3, bt[bt_num]); + + bt[++bt_num] = elm_button_add(win); + elm_button_label_set(bt[bt_num], "Bring top 477"); + evas_object_size_hint_align_set(bt[bt_num], EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(bt[bt_num], EVAS_HINT_EXPAND, 0.0); + evas_object_show(bt[bt_num]); + elm_box_pack_end(bx3, bt[bt_num]); + + elm_box_pack_end(bx, bx3); + evas_object_show(bx3); + + bt_count = 0; + for (i = 0; i < 500; i++) + { + if (!(i % 10)) + { + gli = git = elm_genlist_item_append(gl, &itc_group, + (void *)(long)i/* item data */, + NULL/* parent */, + ELM_GENLIST_ITEM_GROUP, + gl_sel/* func */, + (void *)(long)(i * 10)/* func data */); + } + else if (git) + { + gli = elm_genlist_item_append(gl, &itc1, + (void *)(long)i/* item data */, + git/* parent */, + ELM_GENLIST_ITEM_NONE, + gl_sel/* func */, + (void *)(long)(i * 10)/* func data */); + } + //elm_genlist_item_display_only_set(gli, EINA_TRUE); + switch (i) + { + case 0: + evas_object_smart_callback_add(bt[0], "clicked", _bt_show_cb, gli); + evas_object_smart_callback_add(bt[4], "clicked", _bt_bring_cb, gli); + break; + case 26: + evas_object_smart_callback_add(bt[1], "clicked", _bt_show_cb, gli); + break; + case 31: + evas_object_smart_callback_add(bt[5], "clicked", _bt_bring_cb, gli); + break; + case 101: + evas_object_smart_callback_add(bt[2], "clicked", _bt_show_cb, gli); + break; + case 239: + evas_object_smart_callback_add(bt[6], "clicked", _bt_bring_cb, gli); + break; + case 477: + evas_object_smart_callback_add(bt[7], "clicked", _bt_bring_cb, gli); + break; + case 480: + evas_object_smart_callback_add(bt[3], "clicked", _bt_show_cb, gli); + break; + } + } + + evas_object_resize(win, 480, 800); + evas_object_show(win); +} + +/*************/ + +static void +gl9_exp(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) +{ + Elm_Genlist_Item *it = event_info; + Evas_Object *gl = elm_genlist_item_genlist_get(it); + int val = (int)(long)elm_genlist_item_data_get(it); + val *= 10; + elm_genlist_item_append(gl, &itc1, + (void *)(long)(val + 1)/* item data */, it/* parent */, + ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, + NULL/* func data */); + elm_genlist_item_append(gl, &itc1, + (void *)(long)(val + 2)/* item data */, it/* parent */, + ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, + NULL/* func data */); + elm_genlist_item_append(gl, &itc1, + (void *)(long)(val + 3)/* item data */, it/* parent */, + ELM_GENLIST_ITEM_SUBITEMS, gl4_sel/* func */, + NULL/* func data */); +} +static void +gl9_con(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) +{ + Elm_Genlist_Item *it = event_info; + elm_genlist_item_subitems_clear(it); +} + +static void +gl9_exp_req(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) +{ + Elm_Genlist_Item *it = event_info; + elm_genlist_item_expanded_set(it, EINA_TRUE); +} +static void +gl9_con_req(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) +{ + Elm_Genlist_Item *it = event_info; + elm_genlist_item_expanded_set(it, EINA_FALSE); +} + +void +test_genlist9(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + Evas_Object *win, *bg, *gl, *bx; + Elm_Genlist_Item *git; + + win = elm_win_add(NULL, "genlist-group-tree", ELM_WIN_BASIC); + elm_win_title_set(win, "Genlist Group Tree"); + elm_win_autodel_set(win, 1); + + bg = elm_bg_add(win); + elm_win_resize_object_add(win, bg); + evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(bg); + + bx = elm_box_add(win); + evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(win, bx); + evas_object_show(bx); + + gl = elm_genlist_add(win); + evas_object_smart_callback_add(gl, "selected", _gl_selected, NULL); + evas_object_smart_callback_add(gl, "clicked", _gl_clicked, NULL); + evas_object_smart_callback_add(gl, "longpressed", _gl_longpress, NULL); + evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_box_pack_end(bx, gl); + evas_object_show(gl); + + itc1.item_style = "default"; + itc1.func.label_get = gl_label_get; + itc1.func.icon_get = gl_icon_get; + itc1.func.state_get = gl_state_get; + itc1.func.del = gl_del; + + itc_group.item_style = "group_index"; + itc_group.func.label_get = gl8_label_get; + itc_group.func.icon_get = NULL; + itc_group.func.state_get = NULL; + itc_group.func.del = gl_del; + + git = elm_genlist_item_append(gl, &itc_group, + (void *)0/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_GROUP, gl4_sel/* func */, + NULL/* func data */); + elm_genlist_item_append(gl, &itc1, + (void *)1/* item data */, git/* parent */, ELM_GENLIST_ITEM_SUBITEMS, gl4_sel/* func */, + NULL/* func data */); + elm_genlist_item_append(gl, &itc1, + (void *)2/* item data */, git/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, + NULL/* func data */); + elm_genlist_item_append(gl, &itc1, + (void *)3/* item data */, git/* parent */, ELM_GENLIST_ITEM_SUBITEMS, gl4_sel/* func */, + NULL/* func data */); + git = elm_genlist_item_append(gl, &itc_group, + (void *)4/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_GROUP, gl4_sel/* func */, + NULL/* func data */); + elm_genlist_item_append(gl, &itc1, + (void *)5/* item data */, git/* parent */, ELM_GENLIST_ITEM_SUBITEMS, gl4_sel/* func */, + NULL/* func data */); + elm_genlist_item_append(gl, &itc1, + (void *)6/* item data */, git/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, + NULL/* func data */); + elm_genlist_item_append(gl, &itc1, + (void *)7/* item data */, git/* parent */, ELM_GENLIST_ITEM_SUBITEMS, gl4_sel/* func */, + NULL/* func data */); + + evas_object_smart_callback_add(gl, "expand,request", gl9_exp_req, gl); + evas_object_smart_callback_add(gl, "contract,request", gl9_con_req, gl); + evas_object_smart_callback_add(gl, "expanded", gl9_exp, gl); + evas_object_smart_callback_add(gl, "contracted", gl9_con, gl); + + evas_object_resize(win, 480, 800); + evas_object_show(win); +} #endif Modified: trunk/TMP/st/elementary/src/lib/Elementary.h.in =================================================================== --- trunk/TMP/st/elementary/src/lib/Elementary.h.in 2011-01-06 04:00:39 UTC (rev 55924) +++ trunk/TMP/st/elementary/src/lib/Elementary.h.in 2011-01-06 05:13:11 UTC (rev 55925) @@ -1684,7 +1684,8 @@ typedef enum _Elm_Genlist_Item_Flags { ELM_GENLIST_ITEM_NONE = 0, - ELM_GENLIST_ITEM_SUBITEMS = (1 << 0) + ELM_GENLIST_ITEM_SUBITEMS = (1 << 0), + ELM_GENLIST_ITEM_GROUP = (1 << 1) } Elm_Genlist_Item_Flags; typedef struct _Elm_Genlist_Item_Class Elm_Genlist_Item_Class; typedef struct _Elm_Genlist_Item Elm_Genlist_Item; /**< Item of Elm_Genlist. Sub-type of Elm_Widget_Item */ Modified: trunk/TMP/st/elementary/src/lib/elm_genlist.c =================================================================== --- trunk/TMP/st/elementary/src/lib/elm_genlist.c 2011-01-06 04:00:39 UTC (rev 55924) +++ trunk/TMP/st/elementary/src/lib/elm_genlist.c 2011-01-06 05:13:11 UTC (rev 55925) @@ -289,6 +289,7 @@ { Evas_Object *obj, *scr, *pan_smart; Eina_Inlist *items, *blocks; + Eina_List *group_items; Pan *pan; Evas_Coord pan_x, pan_y, w, h, minw, minh, realminw, prev_viewport_w; Ecore_Job *calc_job, *update_job; @@ -361,6 +362,7 @@ Evas_Coord x, y, w, h, minw, minh; const Elm_Genlist_Item_Class *itc; Elm_Genlist_Item *parent; + Elm_Genlist_Item *group_item; Elm_Genlist_Item_Flags flags; struct { @@ -373,6 +375,7 @@ Ecore_Timer *long_timer; Ecore_Timer *swipe_timer; Evas_Coord dx, dy; + Evas_Coord scrl_x, scrl_y; Elm_Genlist_Item *rel; @@ -394,6 +397,7 @@ Eina_Bool before : 1; Eina_Bool want_unrealize : 1; + Eina_Bool want_realize : 1; Eina_Bool realized : 1; Eina_Bool selected : 1; Eina_Bool hilighted : 1; @@ -817,7 +821,11 @@ edje_object_signal_emit(it->base.view, "elm,state,selected", "elm"); selectraise = edje_object_data_get(it->base.view, "selectraise"); if ((selectraise) && (!strcmp(selectraise, "on"))) - evas_object_raise(it->base.view); + { + evas_object_raise(it->base.view); + if ((it->group_item) && (it->group_item->realized)) + evas_object_raise(it->group_item->base.view); + } it->hilighted = EINA_TRUE; } @@ -1636,7 +1644,10 @@ evas_object_color_set(it->spacer, 0, 0, 0, 0); elm_widget_sub_object_add(it->base.widget, it->spacer); } - for (it2 = it, depth = 0; it2->parent; it2 = it2->parent) depth += 1; + for (it2 = it, depth = 0; it2->parent; it2 = it2->parent) + { + if (it2->parent->flags != ELM_GENLIST_ITEM_GROUP) depth += 1; + } it->expanded_depth = depth; treesize = edje_object_data_get(it->base.view, "treesize"); if (treesize) tsize = atoi(treesize); @@ -1938,13 +1949,16 @@ if (!itb->realized) return; EINA_LIST_FOREACH(itb->items, l, it) { - if (it->dragging) + if (it->flags != ELM_GENLIST_ITEM_GROUP) { - dragging = EINA_TRUE; - it->want_unrealize = EINA_TRUE; + if (it->dragging) + { + dragging = EINA_TRUE; + it->want_unrealize = EINA_TRUE; + } + else + _item_unrealize(it); } - else - _item_unrealize(it); } if (!dragging) { @@ -1961,6 +1975,7 @@ { const Eina_List *l; Elm_Genlist_Item *it; + Elm_Genlist_Item *git; Evas_Coord y = 0, ox, oy, ow, oh, cvx, cvy, cvw, cvh; int vis; @@ -1973,34 +1988,72 @@ it->x = 0; it->y = y; it->w = itb->w; - vis = (ELM_RECTS_INTERSECT(itb->x + it->x - it->wd->pan_x + ox, - itb->y + it->y - it->wd->pan_y + oy, - it->w, it->h, - cvx, cvy, cvw, cvh)); - if ((itb->realized) && (!it->realized)) + it->scrl_x = itb->x + it->x - it->wd->pan_x + ox; + it->scrl_y = itb->y + it->y - it->wd->pan_y + oy; + + if (it->flags != ELM_GENLIST_ITEM_GROUP) { - if (vis) _item_realize(it, in, 0); - } - if (it->realized) - { - if (vis) + vis = (ELM_RECTS_INTERSECT(it->scrl_x, it->scrl_y, it->w, it->h, + cvx, cvy, cvw, cvh)); + if ((itb->realized) && (!it->realized)) { - evas_object_resize(it->base.view, it->w, it->h); - evas_object_move(it->base.view, - ox + itb->x + it->x - itb->wd->pan_x, - oy + itb->y + it->y - itb->wd->pan_y); - evas_object_show(it->base.view); + if (vis) _item_realize(it, in, 0); } - else + if (it->realized) { - if (!it->dragging) _item_unrealize(it); + if (vis) + { + git = it->group_item; + if (git) + { + if (git->scrl_y < oy) + git->scrl_y = oy; + if ((git->scrl_y + git->h) > (it->scrl_y + it->h)) + git->scrl_y = (it->scrl_y + it->h) - git->minh; + git->want_realize = EINA_TRUE; + } + evas_object_resize(it->base.view, it->w, it->h); + evas_object_move(it->base.view, + it->scrl_x, it->scrl_y); + evas_object_show(it->base.view); + } + else + { + if (!it->dragging) _item_unrealize(it); + } } + in++; } y += it->h; - in++; } } +static void +_group_items_recalc(void *data) +{ + Widget_Data *wd = data; + Eina_List *l; + Elm_Genlist_Item *git; + + EINA_LIST_FOREACH(wd->group_items, l, git) + { + if (git->want_realize) + { + if (!git->realized) + _item_realize(git, 0, 0); + evas_object_resize(git->base.view, wd->minw, git->h); + evas_object_move(git->base.view, git->scrl_x, git->scrl_y); + evas_object_show(git->base.view); + evas_object_raise(git->base.view); + } + else if (!git->want_realize && git->realized) + { + if (!git->dragging) + _item_unrealize(git); + } + } +} + static Eina_Bool _must_recalc_idler(void *data) { @@ -2360,9 +2413,15 @@ Item_Block *itb; Evas_Coord ox, oy, ow, oh, cvx, cvy, cvw, cvh; int in = 0; + Elm_Genlist_Item *git; + Eina_List *l; evas_object_geometry_get(obj, &ox, &oy, &ow, &oh); evas_output_viewport_get(evas_object_evas_get(obj), &cvx, &cvy, &cvw, &cvh); + EINA_LIST_FOREACH(sd->wd->group_items, l, git) + { + git->want_realize = EINA_FALSE; + } EINA_INLIST_FOREACH(sd->wd->blocks, itb) { itb->w = sd->wd->minw; @@ -2381,6 +2440,7 @@ } in += itb->count; } + _group_items_recalc(sd->wd); } static void @@ -2843,6 +2903,8 @@ if (!it) return NULL; if (!it->parent) { + if (flags & ELM_GENLIST_ITEM_GROUP) + wd->group_items = eina_list_append(wd->group_items, it); wd->items = eina_inlist_append(wd->items, EINA_INLIST_GET(it)); it->rel = NULL; } @@ -2858,6 +2920,11 @@ EINA_INLIST_GET(it2)); it->rel = it2; it->rel->relcount++; + + if (it->parent->flags & ELM_GENLIST_ITEM_GROUP) + it->group_item = parent; + else if (it->parent->group_item) + it->group_item = it->parent->group_item; } it->before = EINA_FALSE; _item_queue(wd, it); @@ -2898,6 +2965,8 @@ if (!it) return NULL; if (!it->parent) { + if (flags & ELM_GENLIST_ITEM_GROUP) + wd->group_items = eina_list_prepend(wd->group_items, it); wd->items = eina_inlist_prepend(wd->items, EINA_INLIST_GET(it)); it->rel = NULL; } @@ -3682,6 +3751,7 @@ elm_genlist_item_show(Elm_Genlist_Item *it) { ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it); + Evas_Coord gith = 0; if (it->delete_me) return; if ((it->queued) || (!it->mincalcd)) { @@ -3695,6 +3765,8 @@ it->wd->show_item->showme = EINA_FALSE; it->wd->show_item = NULL; } + if ((it->group_item) && (it->wd->pan_y > (it->y + it->block->y))) + gith = it->group_item->h; elm_smart_scroller_child_region_show(it->wd->scr, it->x + it->block->x, it->y + it->block->y, @@ -3716,6 +3788,7 @@ elm_genlist_item_bring_in(Elm_Genlist_Item *it) { ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it); + Evas_Coord gith = 0; if (it->delete_me) return; if ((it->queued) || (!it->mincalcd)) { @@ -3729,9 +3802,11 @@ it->wd->show_item->showme = EINA_FALSE; it->wd->show_item = NULL; } + if ((it->group_item) && (it->wd->pan_y > (it->y + it->block->y))) + gith = it->group_item->h; elm_smart_scroller_region_bring_in(it->wd->scr, it->x + it->block->x, - it->y + it->block->y, + it->y + it->block->y - gith, it->block->w, it->h); } @@ -3750,6 +3825,7 @@ { ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it); Evas_Coord ow, oh; + Evas_Coord gith = 0; if (it->delete_me) return; if ((it->queued) || (!it->mincalcd)) @@ -3765,9 +3841,10 @@ it->wd->show_item = NULL; } evas_object_geometry_get(it->wd->pan_smart, NULL, NULL, &ow, &oh); + if (it->group_item) gith = it->group_item->h; elm_smart_scroller_child_region_show(it->wd->scr, it->x + it->block->x, - it->y + it->block->y, + it->y + it->block->y - gith, it->block->w, oh); } @@ -3787,6 +3864,7 @@ { ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it); Evas_Coord ow, oh; + Evas_Coord gith = 0; if (it->delete_me) return; if ((it->queued) || (!it->mincalcd)) @@ -3802,9 +3880,10 @@ it->wd->show_item = NULL; } evas_object_geometry_get(it->wd->pan_smart, NULL, NULL, &ow, &oh); + if (it->group_item) gith = it->group_item->h; elm_smart_scroller_region_bring_in(it->wd->scr, it->x + it->block->x, - it->y + it->block->y, + it->y + it->block->y - gith, it->block->w, oh); } |
From: Enlightenment S. <no-...@en...> - 2011-01-10 08:59:50
|
Log: From: ChunEon Park <chu...@sa...> Subject: [PATCH] elc_ctxpopup Here code is for the ctxpopup. Since the functionalities of ctxpopup are somewhat different, I'm trying to overwrite the ctxpopup code entirely first. The main reason is, Original ctxpopup could determine it's size and position by itself. Of course, upstreamed version supports this. But it can not be reduced it's size And it supposes the arrow position to center of box edje. Basically, This version calculates it's box size first then find available space from the it's position. The origin position of the box is not expected, it finds the available positions. But if there is not enough space to be shown, then it finds a best direction to be shown again. In this case, it reduces it's size also as to be shown entirely. Since the ctxpopup supports scroller, the reduced box could show the all items also. (The point is ctxpopup should know the size of total items...) I'm not sure the upstreamed version could cover the above scenario, If then, I need to modify it first. (fixed some minor formatting issue too) Author: raster Date: 2011-01-10 00:59:40 -0800 (Mon, 10 Jan 2011) New Revision: 56021 Trac: http://trac.enlightenment.org/e/changeset/56021 Modified: trunk/TMP/st/elementary/data/themes/default.edc trunk/TMP/st/elementary/src/bin/test_ctxpopup.c trunk/TMP/st/elementary/src/lib/Elementary.h.in trunk/TMP/st/elementary/src/lib/elc_ctxpopup.c Modified: trunk/TMP/st/elementary/data/themes/default.edc =================================================================== --- trunk/TMP/st/elementary/data/themes/default.edc 2011-01-10 07:23:31 UTC (rev 56020) +++ trunk/TMP/st/elementary/data/themes/default.edc 2011-01-10 08:59:40 UTC (rev 56021) @@ -7406,575 +7406,8 @@ } } } - /////////////////////////////////////////////////////////////////////////////// - group { name: "elm/hover/base/ctxpopup/default"; - images { - image: "bt_base2.png" COMP; - image: "bt_hilight.png" COMP; - image: "bt_shine.png" COMP; - image: "icon_arrow_left.png" COMP; - image: "icon_arrow_up_left.png" COMP; - image: "icon_arrow_up.png" COMP; - image: "icon_arrow_up_right.png" COMP; - image: "icon_arrow_right.png" COMP; - image: "icon_arrow_down_right.png" COMP; - image: "icon_arrow_down.png" COMP; - image: "icon_arrow_down_left.png" COMP; - } - parts { - part { name: "elm.swallow.offset"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 0.0 0.0; - } - } - part { name: "elm.swallow.size"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1.to: "elm.swallow.offset"; - rel1.relative: 1.0 1.0; - rel2.to: "elm.swallow.offset"; - rel2.relative: 1.0 1.0; - } - } - part { name: "button_image"; - mouse_events: 1; - description { state: "default" 0.0; - image { - normal: "bt_base2.png"; - border: 7 7 7 7; - } - image.middle: SOLID; - } - description { state: "top-left" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.to: "elm.swallow.slot.top-left"; - rel1.offset: -2 -6; - rel2.to: "elm.swallow.slot.top-left"; - rel2.offset: 1 7; - } - description { state: "top" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.to: "elm.swallow.slot.top"; - rel1.offset: -2 -6; - rel2.to: "elm.swallow.slot.top"; - rel2.offset: 1 7; - } - description { state: "top-right" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.to: "elm.swallow.slot.top-right"; - rel1.offset: -2 -6; - rel2.to: "elm.swallow.slot.top-right"; - rel2.offset: 1 7; - } - description { state: "right" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.to: "elm.swallow.slot.right"; - rel1.offset: -2 -6; - rel2.to: "elm.swallow.slot.right"; - rel2.offset: 1 7; - } - description { state: "bottom-right" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.to: "elm.swallow.slot.bottom-right"; - rel1.offset: -2 -6; - rel2.to: "elm.swallow.slot.bottom-right"; - rel2.offset: 1 7; - } - description { state: "bottom" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.to: "elm.swallow.slot.bottom"; - rel1.offset: -2 -6; - rel2.to: "elm.swallow.slot.bottom"; - rel2.offset: 1 7; - } - description { state: "bottom-left" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.to: "elm.swallow.slot.bottom-left"; - rel1.offset: -2 -6; - rel2.to: "elm.swallow.slot.bottom-left"; - rel2.offset: 1 7; - } - description { state: "left" 0.0; - inherit: "default" 0.0; - visible: 1; - rel1.to: "elm.swallow.slot.left"; - rel1.offset: -2 -6; - rel2.to: "elm.swallow.slot.left"; - rel2.offset: 1 7; - } - } - part { name: "base"; - type: RECT; - mouse_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - description { state: "visible" 0.0; - inherit: "default" 1.0; - color: 0 0 0 64; - } - } - part { name: "elm.swallow.slot.left"; - type: SWALLOW; - description { state: "default" 0.0; - align: 1.0 0.5; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 0.0 0.0; - rel1.offset: -1 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 0.0 1.0; - rel2.offset: -1 -1; - } - } - part { name: "elm.swallow.slot.top-left"; - type: SWALLOW; - description { state: "default" 0.0; - align: 1.0 1.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 0.0 0.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 0.0 0.0; - rel2.offset: -1 -1; - } - } - part { name: "elm.swallow.slot.top"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.5 1.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 0.0 0.0; - rel1.offset: 0 -1; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 1.0 0.0; - rel2.offset: -1 -1; - } - } - part { name: "elm.swallow.slot.top-right"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.0 1.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 1.0 0.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 1.0 0.0; - rel2.offset: -1 -1; - } - } - part { name: "elm.swallow.slot.right"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.0 0.5; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 1.0 0.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 1.0 1.0; - rel2.offset: 0 -1; - } - } - part { name: "elm.swallow.slot.bottom-right"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 1.0 1.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 1.0 1.0; - rel2.offset: -1 -1; - } - } - part { name: "elm.swallow.slot.bottom"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.5 0.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 0.0 1.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 1.0 1.0; - rel2.offset: -1 0; - } - } - part { name: "elm.swallow.slot.bottom-left"; - type: SWALLOW; - description { state: "default" 0.0; - align: 1.0 0.0; - rel1.to: "elm.swallow.slot.middle"; - rel1.relative: 0.0 1.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.middle"; - rel2.relative: 0.0 1.0; - rel2.offset: -1 0; - } - } - part { name: "over1"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "button_image"; - rel2.to: "button_image"; - rel2.relative: 1.0 0.5; - image { - normal: "bt_hilight.png"; - border: 7 7 7 0; - } - } - } - part { name: "over2"; - mouse_events: 1; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - rel1.to: "button_image"; - rel2.to: "button_image"; - image { - normal: "bt_shine.png"; - border: 7 7 7 7; - } - } - } - part { name: "elm.swallow.slot.middle"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.to: "elm.swallow.size"; - rel2.to: "elm.swallow.size"; - } - } - part { name: "arrow"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - min: 40 40; - max: 40 40; - } - description { state: "left" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 0.0 0.5; - rel1.to: "elm.swallow.slot.left"; - rel1.relative: 1.0 0.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.left"; - rel2.relative: 1.0 1.0; - rel2.offset: 0 -1; - image.normal: "icon_arrow_right.png"; - } - description { state: "top-left" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 0.0 0.0; - rel1.to: "elm.swallow.slot.top-left"; - rel1.relative: 1.0 1.0; - rel1.offset: -5 5; - rel2.to: "elm.swallow.slot.top-left"; - rel2.relative: 1.0 1.0; - rel2.offset: -4 4; - image.normal: "icon_arrow_down_right.png"; - } - description { state: "top" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 0.5 0.0; - rel1.to: "elm.swallow.slot.top"; - rel1.relative: 0.0 1.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.top"; - rel2.relative: 1.0 1.0; - rel2.offset: -1 0; - image.normal: "icon_arrow_down.png"; - } - description { state: "top-right" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 1.0 0.0; - rel1.to: "elm.swallow.slot.top-right"; - rel1.relative: 0.0 1.0; - rel1.offset: 5 5; - rel2.to: "elm.swallow.slot.top-right"; - rel2.relative: 0.0 1.0; - rel2.offset: 4 4; - image.normal: "icon_arrow_down_left.png"; - } - description { state: "right" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 1.0 0.5; - rel1.to: "elm.swallow.slot.right"; - rel1.relative: 0.0 0.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.slot.right"; - rel2.relative: 0.0 1.0; - rel2.offset: 0 -1; - image.normal: "icon_arrow_left.png"; - } - description { state: "bottom-right" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 1.0 1.0; - rel1.to: "elm.swallow.slot.bottom-right"; - rel1.relative: 0.0 0.0; - rel1.offset: 5 5; - rel2.to: "elm.swallow.slot.bottom-right"; - rel2.relative: 0.0 0.0; - rel2.offset: 4 4; - image.normal: "icon_arrow_up_left.png"; - } - description { state: "bottom" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 0.5 1.0; - rel1.to: "elm.swallow.slot.bottom"; - rel1.relative: 0.0 0.0; - rel1.offset: 0 -1; - rel2.to: "elm.swallow.slot.bottom"; - rel2.relative: 1.0 0.0; - rel2.offset: -1 -1; - image.normal: "icon_arrow_up.png"; - } - description { state: "bottom-left" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 0.0 1.0; - rel1.to: "elm.swallow.slot.bottom-left"; - rel1.relative: 1.0 0.0; - rel1.offset: -5 5; - rel2.to: "elm.swallow.slot.bottom-left"; - rel2.relative: 1.0 0.0; - rel2.offset: -4 4; - image.normal: "icon_arrow_up_right.png"; - } - } - } - programs { - program { name: "end"; - signal: "mouse,up,1"; - source: "base"; - action: SIGNAL_EMIT "elm,action,dismiss" ""; - } - program { name: "show"; - signal: "elm,action,show"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "base"; - } - program { name: "hide"; - signal: "elm,action,hide"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - } - program { name: "all-hide"; - action: STATE_SET "default" 0.0; - target: "button_image"; - } - program { name: "top-left-show"; - signal: "elm,action,slot,top-left,show"; - source: "elm"; - action: STATE_SET "top-left" 0.0; - target: "arrow"; - target: "button_image"; - } - program { name: "top-show"; - signal: "elm,action,slot,top,show"; - source: "elm"; - action: STATE_SET "top" 0.0; - target: "arrow"; - target: "button_image"; - } - program { name: "top-right-show"; - signal: "elm,action,slot,top-right,show"; - source: "elm"; - action: STATE_SET "top-right" 0.0; - target: "arrow"; - target: "button_image"; - } - program { name: "right-show"; - signal: "elm,action,slot,right,show"; - source: "elm"; - action: STATE_SET "right" 0.0; - target: "arrow"; - target: "button_image"; - } - program { name: "bottom-right-show"; - signal: "elm,action,slot,bottom-right,show"; - source: "elm"; - action: STATE_SET "bottom-right" 0.0; - target: "arrow"; - target: "button_image"; - } - program { name: "bottom-show"; - signal: "elm,action,slot,bottom,show"; - source: "elm"; - action: STATE_SET "bottom" 0.0; - target: "arrow"; - target: "button_image"; - } - program { name: "bottom-left-show"; - signal: "elm,action,slot,bottom-left,show"; - source: "elm"; - action: STATE_SET "bottom-left" 0.0; - target: "arrow"; - target: "button_image"; - } - program { name: "left-show"; - signal: "elm,action,slot,left,show"; - source: "elm"; - action: STATE_SET "left" 0.0; - target: "arrow"; - target: "button_image"; - } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/list/item/ctxpopup"; - alias: "elm/list/item_odd/ctxpopup"; - alias: "elm/list/h_item/ctxpopup"; - alias: "elm/list/h_item_odd/ctxpopup"; - parts { - part { name: "button_image"; - mouse_events: 1; - clip_to: "disclip"; - description { state: "default" 0.0; - color: 255 255 255 0; - image.normal: "hoversel_entry_bg.png"; - image.border: 0 0 2 2; - fill.smooth: 0; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - clip_to: "disclip"; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - offset: 4 4; - } - rel2 { - relative: 0.0 1.0; - offset: 4 -5; - } - } - } - part { name: "elm.text"; - type: TEXT; - effect: SOFT_SHADOW; - mouse_events: 0; - scale: 1; - clip_to: "disclip"; - description { - state: "default" 0.0; - rel1 { - to_x: "elm.swallow.icon"; - relative: 1.0 0.0; - offset: 4 4; - } - rel2 { - offset: -5 -5; - } - color: 224 224 224 255; - color3: 0 0 0 64; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 1 1; - align: 0.0 0.5; - text_class: "list_item"; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - text.min: 1 1; - color: 0 0 0 255; - color3: 0 0 0 0; - } - } - part { name: "event"; - type: RECT; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "disclip"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - rel1.to: "event"; - rel2.to: "event"; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } - } - programs { - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "elm.text"; - target: "button_image"; - } - program { - name: "item_unclick"; - signal: "mouse,up,1"; - source: "event"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "elm.text"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - target: "button_image"; - transition: LINEAR 0.1; - } - program { - name: "go_disabled"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disclip"; - } - program { - name: "go_enabled"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disclip"; - } - } - } - -/////////////////////////////////////////////////////////////////////////////// - group { name: "elm/list/base/ctxpopup"; + group { name: "elm/scroller/base/ctxpopup"; data { item: "focus_highlight" "on"; } @@ -7985,7 +7418,7 @@ v = get_int(sbvis_v); if (v) { v = get_int(sbalways_v); - if (!v) { + if(!v) { emit("do-hide-vbar", ""); set_int(sbvis_v, 0); } @@ -7993,7 +7426,7 @@ v = get_int(sbvis_h); if (v) { v = get_int(sbalways_h); - if (!v) { + if(!v) { emit("do-hide-hbar", ""); set_int(sbvis_h, 0); } @@ -8009,32 +7442,19 @@ image: "sl_bt2_2.png" COMP; } parts { - part { name: "bg"; - type: RECT; - description { state: "default" 0.0; - rel1.offset: 2 2; - rel2.offset: -3 -3; - color: 255 255 255 0; - } - } part { name: "clipper"; type: RECT; mouse_events: 0; + scale: 1; description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - rel1.offset: 2 2; - rel2.offset: -3 -3; } } part { name: "elm.swallow.content"; clip_to: "clipper"; type: SWALLOW; + scale: 1; description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - rel1.offset: 2 2; - rel2.offset: -3 -3; + align: 0.5 0.5; } } part { name: "focus_highlight"; @@ -8042,8 +7462,7 @@ description { state: "default" 0.0; rel1.offset: -1 -1; rel2.offset: 0 0; - image { - normal: "sl_bt2_2.png"; + image { normal: "sl_bt2_2.png"; border: 7 7 7 7; middle: 0; } @@ -8064,12 +7483,15 @@ visible: 0; color: 255 255 255 0; } - } + } part { name: "sb_vbar_clip"; - clip_to: "sb_vbar_clip_master"; + clip_to:"sb_vbar_clip_master"; type: RECT; mouse_events: 0; + scale: 1; description { state: "default" 0.0; + align: 0.0 0.0; + rel2{ to:"clipper"; relative: 1.0 1.0;} } description { state: "hidden" 0.0; visible: 0; @@ -8079,28 +7501,19 @@ part { name: "sb_vbar"; type: RECT; mouse_events: 0; + scale: 1; description { state: "default" 0.0; fixed: 1 1; visible: 0; - min: 10 17; align: 1.0 0.0; - rel1 { - relative: 1.0 0.0; - offset: 0 2; - to_y: "elm.swallow.content"; - to_x: "elm.swallow.content"; - } - rel2 { - relative: 1.0 0.0; - offset: -1 -1; - to_y: "sb_hbar"; - to_x: "elm.swallow.content"; - } + rel1{ to:"clipper"; relative: 1.0 0.0; } + rel2{ to:"clipper"; relative: 1.0 1.0; } } } part { name: "elm.dragable.vbar"; clip_to: "sb_vbar_clip"; - mouse_events: 0; + mouse_events: 0; + scale: 1; dragable { x: 0 0 0; y: 1 1 0; @@ -8110,18 +7523,9 @@ fixed: 1 1; min: 10 17; max: 10 99999; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar"; - } - image { - normal: "bt_sm_base2.png"; + rel1 { relative: 0.5 0.5; to: "sb_vbar"; } + rel2 { relative: 0.5 0.5; to: "sb_vbar"; } + image { normal: "bt_sm_base2.png"; border: 6 6 6 6; middle: SOLID; } @@ -8134,8 +7538,7 @@ rel1.to: "elm.dragable.vbar"; rel2.relative: 1.0 0.5; rel2.to: "elm.dragable.vbar"; - image { - normal: "bt_sm_hilight.png"; + image { normal: "bt_sm_hilight.png"; border: 6 6 6 0; } } @@ -8146,8 +7549,7 @@ description { state: "default" 0.0; rel1.to: "elm.dragable.vbar"; rel2.to: "elm.dragable.vbar"; - image { - normal: "bt_sm_shine.png"; + image { normal: "bt_sm_shine.png"; border: 6 6 6 0; } } @@ -8161,12 +7563,15 @@ visible: 0; color: 255 255 255 0; } - } + } part { name: "sb_hbar_clip"; clip_to: "sb_hbar_clip_master"; type: RECT; mouse_events: 0; + scale: 1; description { state: "default" 0.0; + align: 0.0 0.0; + rel2{ to:"clipper"; relative: 1.0 1.0;} } description { state: "hidden" 0.0; visible: 0; @@ -8176,49 +7581,31 @@ part { name: "sb_hbar"; type: RECT; mouse_events: 0; - description { state: "default" 0.0; + scale: 1; + description { state: "default" 0.0; fixed: 1 1; visible: 0; - min: 17 10; align: 0.0 1.0; - rel1 { - relative: 0.0 1.0; - offset: 2 0; - to_x: "elm.swallow.content"; - to_y: "elm.swallow.content"; - } - rel2 { - relative: 0.0 1.0; - offset: -1 -1; - to_x: "sb_vbar"; - to_y: "elm.swallow.content"; - } + rel1 { to:"clipper"; relative: 0.0 1.0; } + rel2 { to:"clipper"; relative: 1.0 1.0; } } } part { name: "elm.dragable.hbar"; clip_to: "sb_hbar_clip"; - mouse_events: 0; + mouse_events: 0; + scale: 1; dragable { x: 1 1 0; y: 0 0 0; confine: "sb_hbar"; } description { state: "default" 0.0; - fixed: 1 1; min: 17 10; max: 99999 10; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_hbar"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_hbar"; - } - image { - normal: "bt_sm_base2.png"; + fixed: 1 1; + rel1 { relative: 0.5 0.5; to: "sb_hbar"; } + rel2 { relative: 0.5 0.5; to: "sb_hbar"; } + image { normal: "bt_sm_base2.png"; border: 4 4 4 4; middle: SOLID; } @@ -8231,8 +7618,7 @@ rel1.to: "elm.dragable.hbar"; rel2.relative: 1.0 0.5; rel2.to: "elm.dragable.hbar"; - image { - normal: "bt_sm_hilight.png"; + image { normal: "bt_sm_hilight.png"; border: 6 6 6 0; } } @@ -8243,31 +7629,30 @@ description { state: "default" 0.0; rel1.to: "elm.dragable.hbar"; rel2.to: "elm.dragable.hbar"; - image { - normal: "bt_sm_shine.png"; + image { normal: "bt_sm_shine.png"; border: 6 6 6 0; } } } - } + } programs { program { name: "load"; signal: "load"; source: ""; script { - set_state(PART:"sb_hbar_clip", "hidden", 0.0); set_state(PART:"sb_vbar_clip", "hidden", 0.0); - set_int(sbvis_h, 0); + set_state(PART:"sb_hbar_clip", "hidden", 0.0); set_int(sbvis_v, 0); + set_int(sbvis_h, 0); set_int(sbalways_v, 0); - set_int(sbalways_h, 0); + set_int(sbalways_h, 0); set_int(sbvis_timer, 0); } - } + } program { name: "vbar_show"; signal: "elm,action,show,vbar"; source: "elm"; - action: STATE_SET "default" 0.0; + action: STATE_SET "default" 0.0; target: "sb_vbar_clip_master"; } program { name: "vbar_hide"; @@ -8275,7 +7660,7 @@ source: "elm"; action: STATE_SET "hidden" 0.0; target: "sb_vbar_clip_master"; - } + } program { name: "vbar_show_always"; signal: "elm,action,show_always,vbar"; source: "elm"; @@ -8305,19 +7690,19 @@ } } } - } + } program { name: "sb_vbar_show"; signal: "do-show-vbar"; source: ""; action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; + transition: LINEAR 1.0; target: "sb_vbar_clip"; } program { name: "sb_vbar_hide"; signal: "do-hide-vbar"; source: ""; action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; + transition: LINEAR 1.0; target: "sb_vbar_clip"; } program { name: "hbar_show"; @@ -8366,16 +7751,16 @@ signal: "do-show-hbar"; source: ""; action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; + transition: LINEAR 1.0; target: "sb_hbar_clip"; } program { name: "sb_hbar_hide"; signal: "do-hide-hbar"; source: ""; action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; + transition: LINEAR 1.0; target: "sb_hbar_clip"; - } + } program { name: "scroll"; signal: "elm,action,scroll"; source: "elm"; @@ -8384,7 +7769,7 @@ v = get_int(sbvis_v); v |= get_int(sbalways_v); if (!v) { - emit("do-show-vbar", ""); + emit("do-show-vbar", "") set_int(sbvis_v, 1); } v = get_int(sbvis_h); @@ -8405,7 +7790,7 @@ action: STATE_SET "enabled" 0.0; transition: ACCELERATE 0.3; target: "focus_highlight"; - } + } program { name: "highlight_hide"; signal: "elm,action,focus_highlight,hide"; source: "elm"; @@ -8413,10 +7798,307 @@ transition: DECELERATE 0.3; target: "focus_highlight"; } + } + } +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/ctxpopup/bg/default"; + parts { + part { name: "ctxpopup_bg"; + type: RECT; + mouse_events: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 64; + } + } } + programs { + program { name: "clicked_event"; + signal: "mouse,clicked,1"; + source: "ctxpopup_bg"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + program { name: "show"; + signal: "elm,state,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "ctxpopup_bg"; + } + program { name: "hide"; + signal: "elm,state,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "ctxpopup_bg"; + } + } } - /////////////////////////////////////////////////////////////////////////////// + group { name: "elm/ctxpopup/base/default"; + images { + image: "bt_base2.png" COMP; + image: "bt_hilight.png" COMP; + image: "bt_shine.png" COMP; + } + parts { + part { name: "base"; + scale: 1; + description { state: "default" 0.0; + rel1.offset: -3 -3; + rel2.offset: 3 3; + image { normal: "bt_base2.png"; + border: 7 7 7 7; + } + } + } + part { name: "over1"; + scale: 1; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + rel2.relative: 1.0 0.5; + image { normal: "bt_hilight.png"; + border: 7 7 7 0; + } + } + } + part { name: "over2"; + scale: 1; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + image { normal: "bt_shine.png"; + border: 7 7 7 7; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { state: "default" 0.0; + rel1 { to:"base"; offset: 4 4; }; + rel2 { to:"base"; offset: -5 -5; }; + } + } + } + } +/////////////////////////////////////////////////////////////////////////////// + group { name: "elm/ctxpopup/arrow/default"; + images { + image: "icon_arrow_left.png" COMP; + image: "icon_arrow_right.png" COMP; + image: "icon_arrow_up.png" COMP; + image: "icon_arrow_down.png" COMP; + } + parts { + part { name: "ctxpopup_arrow"; + type: IMAGE; + scale: 1; + description { + state: "default" 0.0; + min: 40 40; + fixed: 1 1; + visible: 0; + align: 0.5 0.5; + } + description { + state: "left" 0.0; + min: 40 40; + fixed: 1 1; + align: 0.0 0.5; + image { normal: "icon_arrow_left.png"; + } + } + description { state: "right" 0.0; + min: 40 40; + fixed: 1 1; + align: 1.0 0.5; + image { normal: "icon_arrow_right.png"; + } + } + description { state: "top" 0.0; + min: 40 40; + fixed: 1 1; + align: 0.5 0.0; + image { normal: "icon_arrow_up.png"; + } + } + description { state: "bottom" 0.0; + min: 40 40; + fixed: 1 1; + align: 0.5 1.0; + image { normal: "icon_arrow_down.png"; + } + } + } + } + programs { + program { name: "enable_left_arrow"; + signal: "elm,state,left"; + source: "elm"; + action: STATE_SET "left" 0.0; + target: "ctxpopup_arrow"; + } + program { name: "enable_right_arrow"; + signal: "elm,state,right"; + source: "elm"; + action: STATE_SET "right" 0.0; + target: "ctxpopup_arrow"; + } + program { name: "enable_top_arrow"; + signal: "elm,state,top"; + source: "elm"; + action: STATE_SET "top" 0.0; + target: "ctxpopup_arrow"; + } + program { name: "enable_bottom_arrow"; + signal: "elm,state,bottom"; + source: "elm"; + action: STATE_SET "bottom" 0.0; + target: "ctxpopup_arrow"; + } + } + } +/////////////////////////////////////////////////////////////////////////////// + group { + name: "elm/ctxpopup/icon_text_style_item/default"; + alias: "elm/ctxpopup/text_style_item/default"; + alias: "elm/ctxpopup/icon_style_item/default"; + images { + image: "hoversel_entry_bg.png" COMP; + } + parts { + part { name: "event"; + mouse_events: 1; + description { state: "default" 0.0; + } + } + part { name: "bg"; + mouse_events: 0; + description { state: "default" 0.0; + rel1.offset: 2 2; + rel2.offset: -3 -3; + image { normal:"hoversel_entry_bg.png"; + border: 0 0 2 2; + } + fill.smooth: 0; + color: 255 255 255 0; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + } + part { name: "elm.swallow.icon"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + min: 25 25; + max: 25 25; + align: 0 0.5; + aspect: 1.0 1.0; + rel1 { offset: 10 10; } + rel2 { offset: 0 -10; } + } + } + part { name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + min: 1 40; + fixed: 0 1; + align: 0.5 0.5; + rel1 { relative: 1.0 0.0; to: "elm.swallow.icon"; offset: 10 0; } + rel2 { relative: 1.0 1.0; offset: -11 -1; } + color: 255 255 255 255; + text { + font: "Sans"; + size: 10; + align: 0.0 0.5; + min: 1 1; + } + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + color: 0 0 0 255; + } + } + part { name: "over1"; + mouse_events: 1; + repeat_events: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + color: 255 255 255 0; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + } + part { name: "over2"; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + color: 255 255 255 0; + } + description { state: "clicked" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + } + part { name: "disclip"; + type: RECT; + description { state: "default" 0.0; + visible: 0; + } + description { state: "enabled" 0.0; + visible: 1; + color: 50 50 50 127; + rel1.offset: 4 4; + rel2.offset: -5 -5; + } + } + } + programs { + program { + name: "item_unclick"; + signal: "mouse,up,1"; + source: "over1"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "enabled" 0.0; + target: "disclip"; + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + program { name: "item_click2"; + signal: "mouse,down,1"; + source: "over2"; + script { + set_state(PART:"elm.text", "clicked", 0.0); + set_state(PART:"bg", "clicked", 0.0); + } + } + program { name: "item_unclick2"; + signal: "mouse,up,1"; + source: "over2"; + script { + set_state(PART:"elm.text", "default", 0.0); + set_state(PART:"bg", "default", 0.0); + } + } + } + } +/////////////////////////////////////////////////////////////////////////////// // emoticon images from: // Tanya - Latvia // http://lazycrazy.deviantart.com/ @@ -36422,3 +36104,7 @@ } } } + + + + Modified: trunk/TMP/st/elementary/src/bin/test_ctxpopup.c =================================================================== --- trunk/TMP/st/elementary/src/bin/test_ctxpopup.c 2011-01-10 07:23:31 UTC (rev 56020) +++ trunk/TMP/st/elementary/src/bin/test_ctxpopup.c 2011-01-10 08:59:40 UTC (rev 56021) @@ -5,18 +5,136 @@ #ifndef ELM_LIB_QUICKLAUNCH static void +_ctxpopup_item_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) +{ + printf("ctxpopup item selected: %s\n", + elm_ctxpopup_item_label_get(event_info)); +} + +#define ITEM_NEW(_hov, _label, _icon) \ + if(_icon) \ + { \ + ic = elm_icon_add(obj); \ + elm_icon_standard_set(ic, _icon); \ + elm_icon_scale_set(ic, EINA_FALSE, EINA_FALSE); \ + } \ + else \ + ic = NULL; \ + it = elm_ctxpopup_item_append(_hov, _label, ic, _ctxpopup_item_cb, NULL); \ + +static void _list_item_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_show(data); + Evas_Object *ctxpopup, *ic; + Elm_Ctxpopup_Item *it; + Evas_Coord x,y; + + ctxpopup = elm_ctxpopup_add(obj); + + ITEM_NEW(ctxpopup, "Go to home folder", "home"); + ITEM_NEW(ctxpopup, "Save file", "file"); + ITEM_NEW(ctxpopup, "Delete file", "delete"); + ITEM_NEW(ctxpopup, "Navigate to folder", "folder"); + elm_ctxpopup_item_disabled_set(it, EINA_TRUE); + ITEM_NEW(ctxpopup, "Edit entry", "edit"); + ITEM_NEW(ctxpopup, "Set date and time", "clock"); + elm_ctxpopup_item_disabled_set(it, EINA_TRUE); + + evas_pointer_output_xy_get(evas_object_evas_get(obj), &x, &y); + evas_object_size_hint_max_set(ctxpopup, 240, 240); + evas_object_move(ctxpopup, x, y); + evas_object_show(ctxpopup); } static void -_ctxpopup_item_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) +_list_item_cb2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - printf("ctxpopup item selected: %s\n", - elm_ctxpopup_item_label_get(event_info)); + Evas_Object *ctxpopup, *ic; + Elm_Ctxpopup_Item *it; + Evas_Coord x,y; + + ctxpopup = elm_ctxpopup_add(obj); + + ITEM_NEW(ctxpopup, NULL, "home"); + ITEM_NEW(ctxpopup, NULL, "file"); + ITEM_NEW(ctxpopup, NULL, "delete"); + ITEM_NEW(ctxpopup, NULL, "folder"); + ITEM_NEW(ctxpopup, NULL, "edit"); + elm_ctxpopup_item_disabled_set(it, EINA_TRUE); + ITEM_NEW(ctxpopup, NULL, "clock"); + + evas_pointer_output_xy_get(evas_object_evas_get(obj), &x, &y); + evas_object_size_hint_max_set(ctxpopup, 240, 240); + evas_object_move(ctxpopup, x, y); + evas_object_show(ctxpopup); } +static void +_list_item_cb3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + Evas_Object *ctxpopup, *ic; + Elm_Ctxpopup_Item *it; + Evas_Coord x,y; + + ctxpopup = elm_ctxpopup_add(obj); + + ITEM_NEW(ctxpopup, "Eina", NULL); + ITEM_NEW(ctxpopup, "Eet", NULL); + ITEM_NEW(ctxpopup, "Evas", NULL); + ITEM_NEW(ctxpopup, "Ecore", NULL); + elm_ctxpopup_item_disabled_set(it, EINA_TRUE); + ITEM_NEW(ctxpopup, "Embryo", NULL); + ITEM_NEW(ctxpopup, "Edje", NULL); + + evas_pointer_output_xy_get(evas_object_evas_get(obj), &x, &y); + evas_object_move(ctxpopup, x, y); + evas_object_show(ctxpopup); +} + +static void +_list_item_cb4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + Evas_Object *ctxpopup, *ic; + Elm_Ctxpopup_Item *it; + Evas_Coord x,y; + + ctxpopup = elm_ctxpopup_add(obj); + elm_ctxpopup_horizontal_set(ctxpopup, EINA_TRUE); + + ITEM_NEW(ctxpopup, NULL, "home"); + ITEM_NEW(ctxpopup, NULL, "file"); + ITEM_NEW(ctxpopup, NULL, "delete"); + ITEM_NEW(ctxpopup, NULL, "folder"); + ITEM_NEW(ctxpopup, NULL, "edit"); + ITEM_NEW(ctxpopup, NULL, "clock"); + + evas_pointer_output_xy_get(evas_object_evas_get(obj), &x, &y); + evas_object_size_hint_max_set(ctxpopup, 240, 240); + evas_object_move(ctxpopup, x, y); + evas_object_show(ctxpopup); +} + + +static void +_list_item_cb5(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + Evas_Object *ctxpopup, *btn; + Evas_Coord x,y; + char buf[PATH_MAX]; + + btn = elm_button_add(obj); + elm_button_label_set(btn, "Enlightenment"); + evas_object_size_hint_min_set(btn, 150, 150); + + ctxpopup = elm_ctxpopup_add(obj); + elm_ctxpopup_content_set(ctxpopup, btn); + + evas_pointer_output_xy_get(evas_object_evas_get(obj), &x, &y); + evas_object_move(ctxpopup, x, y); + evas_object_show(ctxpopup); +} + + static void _list_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { elm_list_item_selected_set(event_info, EINA_FALSE); @@ -25,11 +143,10 @@ void test_ctxpopup(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - Evas_Object *win, *bg, *list, *hov1, *hov2, *hov3, *hov4, *ic; - Elm_Ctxpopup_Item *it; + Evas_Object *win, *bg, *list, *ic; - win = elm_win_add(NULL, "Contexual Popup 2", ELM_WIN_BASIC); - elm_win_title_set(win, "Contextual Popup 2"); + win = elm_win_add(NULL, "Contexual Popup", ELM_WIN_BASIC); + elm_win_title_set(win, "Contextual Popup"); elm_win_autodel_set(win, EINA_TRUE); bg = elm_bg_add(win); @@ -42,75 +159,21 @@ elm_list_mode_set(list, ELM_LIST_COMPRESS); evas_object_smart_callback_add(list, "selected", _list_clicked, NULL); -#define ITEM_NEW(_hov, _icon, _label) \ - ic = elm_icon_add(win); \ - elm_icon_standard_set(ic, _icon); \ - elm_icon_scale_set(ic, EINA_FALSE, EINA_FALSE); \ - it = elm_ctxpopup_item_append(_hov, _label, ic, _ctxpopup_item_cb, NULL); - - hov1 = elm_ctxpopup_add(win); - - ITEM_NEW(hov1, "home", "Go to home folder"); - ITEM_NEW(hov1, "file", "Save file"); - ITEM_NEW(hov1, "delete", "Delete file"); - ITEM_NEW(hov1, "folder", "Navigate to folder"); - elm_ctxpopup_item_disabled_set(it, EINA_TRUE); - ITEM_NEW(hov1, "edit", "Edit entry"); - ITEM_NEW(hov1, "clock", "Set date and time"); - ITEM_NEW(hov1, "arrow_up", "Go up"); - ITEM_NEW(hov1, "arrow_down", "Go down"); - ITEM_NEW(hov1, "arrow_left", "Go left"); - elm_ctxpopup_item_disabled_set(it, EINA_TRUE); - ITEM_NEW(hov1, "arrow_right", "Go right"); - - hov2 = elm_ctxpopup_add(win); - - ITEM_NEW(hov2, "home", NULL); - ITEM_NEW(hov2, "file", NULL); - ITEM_NEW(hov2, "delete", NULL); - ITEM_NEW(hov2, "folder", NULL); - ITEM_NEW(hov2, "edit", NULL); - elm_ctxpopup_item_disabled_set(it, EINA_TRUE); - ITEM_NEW(hov2, "clock", NULL); - ITEM_NEW(hov2, "arrow_up", NULL); - ITEM_NEW(hov2, "arrow_down", NULL); - ITEM_NEW(hov2, "arrow_left", NULL); - ITEM_NEW(hov2, "arrow_right", NULL); - - hov3 = elm_ctxpopup_add(win); - elm_ctxpopup_horizontal_set(hov3, EINA_TRUE); - - ITEM_NEW(hov3, "home", "Zero"); - ITEM_NEW(hov3, "file", "Um"); - ITEM_NEW(hov3, "delete", "Dos"); - ITEM_NEW(hov3, "folder", "Tri"); - ITEM_NEW(hov3, "edit", "Vier"); - ITEM_NEW(hov3, "clock", "五"); - - hov4 = elm_ctxpopup_add(win); - - ITEM_NEW(hov4, NULL, "Eina"); - ITEM_NEW(hov4, NULL, "Eet"); - ITEM_NEW(hov4, NULL, "Evas"); - ITEM_NEW(hov4, NULL, "Ecore"); - elm_ctxpopup_item_disabled_set(it, EINA_TRUE); - ITEM_NEW(hov4, NULL, "Embryo"); - ITEM_NEW(hov4, NULL, "Edje"); - #undef ITEM_NEW - elm_list_item_append(list, "Ctxpopup with icons and labels", NULL, NULL, - _list_item_cb, hov1); + _list_item_cb, NULL); elm_list_item_append(list, "Ctxpopup with icons only", NULL, NULL, - _list_item_cb, hov2); + _list_item_cb2, NULL); + elm_list_item_append(list, "Ctxpopup with labels only", NULL, NULL, + _list_item_cb3, NULL); elm_list_item_append(list, "Ctxpopup at horizontal mode", NULL, NULL, - _list_item_cb, hov3); - elm_list_item_append(list, "Ctxpopup with no icons", NULL, NULL, - _list_item_cb, hov4); + _list_item_cb4, NULL); + elm_list_item_append(list, "Ctxpopup with user content", NULL, NULL, + _list_item_cb5, NULL); evas_object_show(list); elm_list_go(list); - evas_object_resize(win, 300, 300); + evas_object_resize(win, 400, 400); evas_object_show(win); } #endif Modified: trunk/TMP/st/elementary/src/lib/Elementary.h.in =================================================================== --- trunk/TMP/st/elementary/src/lib/Elementary.h.in 2011-01-10 07:23:31 UTC (rev 56020) +++ trunk/TMP/st/elementary/src/lib/Elementary.h.in 2011-01-10 08:59:40 UTC (rev 56021) @@ -2420,24 +2420,35 @@ * "changed" - when the color value changes */ - /* ctxpopup */ + /* Contextual Popup */ typedef struct _Elm_Ctxpopup_Item Elm_Ctxpopup_Item; - EAPI Evas_Object *elm_ctxpopup_add(Evas_Object* parent) EINA_ARG_NONNULL(1); - EAPI void elm_ctxpopup_hover_end(Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Evas_Object *elm_ctxpopup_item_icon_get(const Elm_Ctxpopup_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_ctxpopup_item_icon_set(Elm_Ctxpopup_Item *item, Evas_Object *icon) EINA_ARG_NONNULL(1); - EAPI const char *elm_ctxpopup_item_label_get(const Elm_Ctxpopup_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_ctxpopup_item_label_set(Elm_Ctxpopup_Item *item, const char *label) EINA_ARG_NONNULL(1); - EAPI void elm_ctxpopup_hover_parent_set(Evas_Object *obj, Evas_Object *parent) EINA_ARG_NONNULL(1, 2); - EAPI Evas_Object *elm_ctxpopup_hover_parent_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI void elm_ctxpopup_clear(Evas_Object* obj) EINA_ARG_NONNULL(1); - EAPI void elm_ctxpopup_horizontal_set(Evas_Object* obj, Eina_Bool horizontal) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_ctxpopup_horizontal_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - EAPI Elm_Ctxpopup_Item *elm_ctxpopup_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1); - EAPI void elm_ctxpopup_item_del(Elm_Ctxpopup_Item *item) EINA_ARG_NONNULL(1); - EAPI void elm_ctxpopup_item_disabled_set(Elm_Ctxpopup_Item *item, Eina_Bool disabled) EINA_ARG_NONNULL(1); - EAPI Eina_Bool elm_ctxpopup_item_disabled_get(const Elm_Ctxpopup_Item *item) EINA_ARG_NONNULL(1); + typedef enum _Elm_Ctxpopup_Direction + { + ELM_CTXPOPUP_DIRECTION_DOWN, + ELM_CTXPOPUP_DIRECTION_RIGHT, + ELM_CTXPOPUP_DIRECTION_LEFT, + ELM_CTXPOPUP_DIRECTION_UP, + } Elm_Ctxpopup_Direction; + + EAPI Evas_Object *elm_ctxpopup_add(Evas_Object *parent) EINA_ARG_NONNULL(1); + EAPI Evas_Object *elm_ctxpopup_item_icon_get(const Elm_Ctxpopup_Item *item) EINA_ARG_NONNULL(1); + EAPI void elm_ctxpopup_item_icon_set(Elm_Ctxpopup_Item *item, Evas_Object *icon) EINA_ARG_NONNULL(1); + EAPI const char *elm_ctxpopup_item_label_get(const Elm_Ctxpopup_Item *item) EINA_ARG_NONNULL(1); + EAPI void elm_ctxpopup_item_label_set(Elm_Ctxpopup_Item *item, const char *label) EINA_ARG_NONNULL(1); + EAPI void elm_ctxpopup_hover_parent_set(Evas_Object *obj, Evas_Object *parent) EINA_ARG_NONNULL(1, 2); + EAPI Evas_Object *elm_ctxpopup_hover_parent_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI void elm_ctxpopup_clear(Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI void elm_ctxpopup_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EINA_ARG_NONNULL(1); + EAPI Eina_Bool elm_ctxpopup_horizontal_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + Elm_Ctxpopup_Item *elm_ctxpopup_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1); + EAPI void elm_ctxpopup_item_del(Elm_Ctxpopup_Item *item) EINA_ARG_NONNULL(1); + EAPI void elm_ctxpopup_item_disabled_set(Elm_Ctxpopup_Item *item, Eina_Bool disabled) EINA_ARG_NONNULL(1); + EAPI Eina_Bool elm_ctxpopup_item_disabled_get(const Elm_Ctxpopup_Item *item) EINA_ARG_NONNULL(1); + EAPI void elm_ctxpopup_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1, 2); + EAPI Evas_Object *elm_ctxpopup_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI void elm_ctxpopup_direction_priority_set(Evas_Object *obj, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth) EINA_ARG_NONNULL(1); + EAPI void elm_ctxpopup_direction_priority_get(Evas_Object *obj, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth) EINA_ARG_NONNULL(1); /* smart callbacks called: * "dismissed" - the ctxpopup was dismissed */ Modified: trunk/TMP/st/elementary/src/lib/elc_ctxpopup.c =================================================================== --- trunk/TMP/st/elementary/src/lib/elc_ctxpopup.c 2011-01-10 07:23:31 UTC (rev 56020) +++ trunk/TMP/st/elementary/src/lib/elc_ctxpopup.c 2011-01-10 08:59:40 UTC (rev 56021) @@ -14,7 +14,7 @@ * * Signals that you can add callbacks for are: * - * dismissed - the hover was dismissed + * dismissed - the ctxpopup was dismissed */ typedef struct _Widget_Data Widget_Data; @@ -22,53 +22,97 @@ struct _Elm_Ctxpopup_Item { Elm_Widget_Item base; - - Elm_List_Item *lptr; - - const char *label; - Evas_Object *icon; - - Evas_Smart_Cb func; - const void *data; - - Eina_Bool disabled : 1; + const char *label; + Evas_Object *icon; + Evas_Smart_Cb func; + Eina_Bool disabled:1; }; struct _Widget_Data { + Evas_Object *parent; + Evas_Object *base; + Evas_Object *content; + Evas_Object *box; + Evas_Object *arrow; + Evas_Object *scr; + Evas_Object *bg; Evas_Object *hover_parent; - Evas_Object *list; - Evas_Object *target; - Evas_Object *hover; - Evas *evas; - - Eina_List *items; - - Eina_Bool scroller_disabled : 1; - Eina_Bool horizontal : 1; + Eina_List *items; + Elm_Ctxpopup_Direction dir; + Elm_Ctxpopup_Direction dir_priority[4]; + Evas_Coord max_sc_w, max_sc_h; + Eina_Bool horizontal:1; + Eina_Bool visible:1; + Eina_Bool finished:1; }; static const char *widtype = NULL; + static void _del_hook(Evas_Object *obj); static void _del_pre_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); -static void _hover_clicked_cb(void *data, - Evas_Object *obj, - void *event_info); -static void _parent_resize_cb(void *data, - Evas *evas, - Evas_Object *obj, - void *event_info); -static void _ctxpopup_show(void *data, - Evas *evas, - Evas_Object *obj, - void *event_info); -static void _ctxpopup_hide(void *data, - Evas *evas, - Evas_Object *obj, - void *event_info); +static void _sizing_eval(Evas_Object *obj); +static void _hover_parent_resize(void *data, Evas *e __UNUSED__, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__); +static void _hover_parent_move(void *data, Evas *e __UNUSED__, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__); +static void _hover_parent_del(void *data, Evas *e __UNUSED__, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__); +static void _hover_parent_callbacks_del(Evas_Object *obj); +static void _bg_clicked_cb(void *data, Evas_Object *obj __UNUSED__, + const char *emission __UNUSED__, + const char *source __UNUSED__); +static void _parent_resize(void *data, Evas *e, Evas_Object *obj, + void *event_info __UNUSED__); +static void _ctxpopup_show(void *data __UNUSED__, Evas *e __UNUSED__, + Evas_Object *obj, void *event_info __UNUSED__); +static void _ctxpopup_hide(void *data __UNUSED__, Evas *e __UNUSED__, + Evas_Object *obj, void *event_info __UNUSED__); +static void _ctxpopup_move(void *data __UNUSED__, Evas *e __UNUSED__, + Evas_Object *obj, void *event_info __U... [truncated message content] |