forked from enlightenment/efl
efl_ui_item: use signals from the theme and not object
the problem here is that when we are using the signals from the object, then the edje object itself will receive press/unpress events before any content that is swallowed into the edje object. This means, that no clickable content, added to a item could be clicked without selecting / unselecting the item. Which was a problem. With this commit the theme is sending signals which are then passed to the efl.input.clickable mixin, this way, the part is stacked below the added content, which means, clickable content will not select / unselect the item anymore. Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D10892
This commit is contained in:
parent
193ae1c14c
commit
c49880076c
|
@ -41,7 +41,7 @@ group { "efl/view_grid";
|
||||||
data.item: "version" "123";
|
data.item: "version" "123";
|
||||||
}
|
}
|
||||||
|
|
||||||
group { "efl/grid_item"; data.item: "version" "123";
|
group { "efl/grid_item"; data.item: "version" "124";
|
||||||
data.item: "selectraise" "on";
|
data.item: "selectraise" "on";
|
||||||
data.item: "focusraise" "on";
|
data.item: "focusraise" "on";
|
||||||
images.image: "bevel_dark_out.png" COMP;
|
images.image: "bevel_dark_out.png" COMP;
|
||||||
|
@ -52,15 +52,6 @@ group { "efl/grid_item"; data.item: "version" "123";
|
||||||
parts {
|
parts {
|
||||||
|
|
||||||
// BASE PARTS //
|
// BASE PARTS //
|
||||||
rect { "event";
|
|
||||||
desc { "default";
|
|
||||||
color: 0 0 0 0;
|
|
||||||
}
|
|
||||||
desc { "disabled";
|
|
||||||
inherit: "default";
|
|
||||||
hid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rect { "base"; mouse;
|
rect { "base"; mouse;
|
||||||
desc { "default";
|
desc { "default";
|
||||||
}
|
}
|
||||||
|
@ -208,6 +199,15 @@ group { "efl/grid_item"; data.item: "version" "123";
|
||||||
color: 255 255 255 64;
|
color: 255 255 255 64;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
rect { "event";
|
||||||
|
desc { "default";
|
||||||
|
color: 0 0 0 0;
|
||||||
|
}
|
||||||
|
desc { "disabled";
|
||||||
|
inherit: "default";
|
||||||
|
hid;
|
||||||
|
}
|
||||||
|
}
|
||||||
swallow { "efl.icon";
|
swallow { "efl.icon";
|
||||||
clip_to: "icon_area";
|
clip_to: "icon_area";
|
||||||
desc { "default";
|
desc { "default";
|
||||||
|
@ -258,6 +258,7 @@ group { "efl/grid_item"; data.item: "version" "123";
|
||||||
// TOP PARTS //
|
// TOP PARTS //
|
||||||
}
|
}
|
||||||
programs {
|
programs {
|
||||||
|
EFL_UI_CLICKABLE_PART_BIND("event")
|
||||||
program {
|
program {
|
||||||
signal: "efl,state,selected"; source: "efl";
|
signal: "efl,state,selected"; source: "efl";
|
||||||
action: STATE_SET "selected";
|
action: STATE_SET "selected";
|
||||||
|
|
|
@ -8,7 +8,7 @@ Group: efl/group_item (@since 1.23)
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
group { "efl/group_item"; data.item: "version" "123"; nomouse; program_source: "efl";
|
group { "efl/group_item"; data.item: "version" "124"; nomouse; program_source: "efl";
|
||||||
images.image: "shadow_square_tiny.png" COMP;
|
images.image: "shadow_square_tiny.png" COMP;
|
||||||
images.image: "bevel_out.png" COMP;
|
images.image: "bevel_out.png" COMP;
|
||||||
images.image: "horizontal_separated_bar_small_glow.png" COMP;
|
images.image: "horizontal_separated_bar_small_glow.png" COMP;
|
||||||
|
|
|
@ -56,7 +56,7 @@ group { "efl/list_view";
|
||||||
data.item: "version" "123";
|
data.item: "version" "123";
|
||||||
}
|
}
|
||||||
|
|
||||||
group { "efl/list_item"; data.item: "version" "123";
|
group { "efl/list_item"; data.item: "version" "124";
|
||||||
data.item: "selectraise" "on";
|
data.item: "selectraise" "on";
|
||||||
data.item: "focusraise" "on";
|
data.item: "focusraise" "on";
|
||||||
images.image: "bevel_curved_horiz_out.png" COMP;
|
images.image: "bevel_curved_horiz_out.png" COMP;
|
||||||
|
@ -65,15 +65,6 @@ group { "efl/list_item"; data.item: "version" "123";
|
||||||
images.image: "bevel_horiz_out.png" COMP;
|
images.image: "bevel_horiz_out.png" COMP;
|
||||||
images.image: "shine.png" COMP;
|
images.image: "shine.png" COMP;
|
||||||
parts {
|
parts {
|
||||||
rect { "event";
|
|
||||||
desc { "default";
|
|
||||||
color: 0 0 0 0;
|
|
||||||
}
|
|
||||||
desc { "disabled";
|
|
||||||
inherit: "default";
|
|
||||||
hid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rect { "base"; nomouse;
|
rect { "base"; nomouse;
|
||||||
desc { "default";
|
desc { "default";
|
||||||
color: 64 64 64 255;
|
color: 64 64 64 255;
|
||||||
|
@ -218,6 +209,15 @@ group { "efl/list_item"; data.item: "version" "123";
|
||||||
hid;
|
hid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
rect { "event";
|
||||||
|
desc { "default";
|
||||||
|
color: 0 0 0 0;
|
||||||
|
}
|
||||||
|
desc { "disabled";
|
||||||
|
inherit: "default";
|
||||||
|
hid;
|
||||||
|
}
|
||||||
|
}
|
||||||
//##//
|
//##//
|
||||||
swallow { "efl.icon";
|
swallow { "efl.icon";
|
||||||
desc { "default";
|
desc { "default";
|
||||||
|
@ -268,6 +268,7 @@ group { "efl/list_item"; data.item: "version" "123";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
programs {
|
programs {
|
||||||
|
EFL_UI_CLICKABLE_PART_BIND("event")
|
||||||
program {
|
program {
|
||||||
signal: "efl,state,odd"; source: "efl";
|
signal: "efl,state,odd"; source: "efl";
|
||||||
action: STATE_SET "odd";
|
action: STATE_SET "odd";
|
||||||
|
@ -343,7 +344,7 @@ group { "efl/list_item"; data.item: "version" "123";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
group { "efl/list_item:placeholder"; data.item: "version" "123";
|
group { "efl/list_item:placeholder"; data.item: "version" "124";
|
||||||
data.item: "selectraise" "on";
|
data.item: "selectraise" "on";
|
||||||
data.item: "focusraise" "on";
|
data.item: "focusraise" "on";
|
||||||
images.image: "bevel_curved_horiz_out.png" COMP;
|
images.image: "bevel_curved_horiz_out.png" COMP;
|
||||||
|
@ -352,15 +353,6 @@ group { "efl/list_item:placeholder"; data.item: "version" "123";
|
||||||
images.image: "bevel_horiz_out.png" COMP;
|
images.image: "bevel_horiz_out.png" COMP;
|
||||||
images.image: "shine.png" COMP;
|
images.image: "shine.png" COMP;
|
||||||
parts {
|
parts {
|
||||||
rect { "event";
|
|
||||||
desc { "default";
|
|
||||||
color: 0 0 0 0;
|
|
||||||
}
|
|
||||||
desc { "disabled";
|
|
||||||
inherit: "default";
|
|
||||||
hid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rect { "base"; nomouse;
|
rect { "base"; nomouse;
|
||||||
desc { "default";
|
desc { "default";
|
||||||
color: 64 64 64 255;
|
color: 64 64 64 255;
|
||||||
|
@ -425,6 +417,15 @@ group { "efl/list_item:placeholder"; data.item: "version" "123";
|
||||||
vis;
|
vis;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
rect { "event";
|
||||||
|
desc { "default";
|
||||||
|
color: 0 0 0 0;
|
||||||
|
}
|
||||||
|
desc { "disabled";
|
||||||
|
inherit: "default";
|
||||||
|
hid;
|
||||||
|
}
|
||||||
|
}
|
||||||
//##//
|
//##//
|
||||||
swallow { "efl.content"; mouse;
|
swallow { "efl.content"; mouse;
|
||||||
scale;
|
scale;
|
||||||
|
@ -463,6 +464,7 @@ group { "efl/list_item:placeholder"; data.item: "version" "123";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
programs {
|
programs {
|
||||||
|
EFL_UI_CLICKABLE_PART_BIND("event")
|
||||||
program {
|
program {
|
||||||
signal: "efl,state,odd"; source: "efl";
|
signal: "efl,state,odd"; source: "efl";
|
||||||
action: STATE_SET "odd";
|
action: STATE_SET "odd";
|
||||||
|
|
|
@ -129,7 +129,10 @@ _efl_ui_item_efl_object_finalize(Eo *obj, Efl_Ui_Item_Data *pd EINA_UNUSED)
|
||||||
/* Support Item Focus Feature */
|
/* Support Item Focus Feature */
|
||||||
elm_widget_can_focus_set(obj, EINA_TRUE);
|
elm_widget_can_focus_set(obj, EINA_TRUE);
|
||||||
|
|
||||||
|
if (efl_ui_layout_theme_version_get(obj) == 123)
|
||||||
efl_ui_action_connector_bind_clickable_to_object(wd->resize_obj, obj);
|
efl_ui_action_connector_bind_clickable_to_object(wd->resize_obj, obj);
|
||||||
|
else
|
||||||
|
efl_ui_action_connector_bind_clickable_to_theme(wd->resize_obj, obj);
|
||||||
return eo;
|
return eo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include "elm_widget.h"
|
#include "elm_widget.h"
|
||||||
/* spec-meta-start
|
/* spec-meta-start
|
||||||
{"test-interface":"Efl.Ui.Clickable",
|
{"test-interface":"Efl.Ui.Clickable",
|
||||||
"test-widgets": ["Efl.Ui.Button", "Efl.Ui.Image", "Efl.Ui.Panes", "Efl.Ui.Frame", "Efl.Ui.Item.Realized", "Efl.Ui.Radio", "Efl.Ui.Check"]
|
"test-widgets": ["Efl.Ui.Button", "Efl.Ui.Image", "Efl.Ui.Panes", "Efl.Ui.Frame", "Efl.Ui.Grid_Default_Item", "Efl.Ui.List_Default_Item", "Efl.Ui.Radio", "Efl.Ui.Check"]
|
||||||
}
|
}
|
||||||
spec-meta-end
|
spec-meta-end
|
||||||
*/
|
*/
|
||||||
|
@ -64,10 +64,6 @@ prepare_window(void)
|
||||||
}
|
}
|
||||||
else if (efl_isa(widget, EFL_UI_ITEM_CLASS))
|
else if (efl_isa(widget, EFL_UI_ITEM_CLASS))
|
||||||
{
|
{
|
||||||
elm_widget_theme_klass_set(widget, "grid_item");
|
|
||||||
elm_widget_theme_element_set(widget, NULL);
|
|
||||||
elm_widget_theme_style_set(widget, NULL);
|
|
||||||
efl_ui_widget_theme_apply(widget);
|
|
||||||
pos->x = 30;
|
pos->x = 30;
|
||||||
pos->y = 30;
|
pos->y = 30;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue