From 5574ac3201ce3cbdde6c554a423bdfce414df99e Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Mon, 17 Nov 2008 05:58:21 +0000 Subject: [PATCH] make use of the signal propagatin to child objects for cursors etc. and so indicate focus with a cursor. SVN revision: 37689 --- data/themes/default.edc | 29 ++++++++++++++++++++++++++++- src/lib/Elementary.h | 38 ++++++++++++++++++++++++-------------- src/lib/elc_anchorblock.c | 1 - src/lib/elc_anchorview.c | 1 - src/lib/elm_entry.c | 11 ++++++++++- src/lib/elm_widget.c | 1 + 6 files changed, 63 insertions(+), 18 deletions(-) diff --git a/data/themes/default.edc b/data/themes/default.edc index bdad32c..38dd511 100644 --- a/data/themes/default.edc +++ b/data/themes/default.edc @@ -1,4 +1,3 @@ - collections { /////////////////////////////////////////////////////////////////////////////// @@ -2976,9 +2975,23 @@ collections { image: "cur_glow.png" COMP; } parts { + part { name: "clip2"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "clip"; + rel2.to: "clip"; + visible: 0; + } + description { state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } part { name: "clip"; type: RECT; mouse_events: 0; + clip_to: "clip2"; description { state: "default" 0.0; rel1.offset: -10 0; rel2.offset: 9 9; @@ -3027,6 +3040,7 @@ collections { part { name: "shine"; mouse_events: 0; clip_to: "clip"; + clip_to: "clip2"; description { state: "default" 0.0; rel1.to: "base"; rel2.to: "base"; @@ -3038,6 +3052,7 @@ collections { } part { name: "glow"; mouse_events: 0; + clip_to: "clip2"; description { state: "default" 0.0; rel1.to: "base"; rel1.relative: 0.0 -2.0; @@ -3084,6 +3099,18 @@ collections { target: "glow"; after: "show"; } + program { name: "focused"; + signal: "elm,action,focus"; + source: "elm"; + action: STATE_SET "focused" 0.0; + target: "clip2"; + } + program { name: "unfocused"; + signal: "elm,action,unfocus"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "clip2"; + } } } diff --git a/src/lib/Elementary.h b/src/lib/Elementary.h index b00e5c0..65802da 100644 --- a/src/lib/Elementary.h +++ b/src/lib/Elementary.h @@ -281,19 +281,28 @@ extern "C" { */ // FIXME: fixes to do -// * current sizing tree inefficient -// * scroller could do with page up/down/left/right buttons and and idea of -// a page size +// (bugs) +// * entry click below text doesnt put cursor at end +// * single line entry on scale change adds newlines +// * scale change for hover doesnt seem to do new size alloc nicely +// * left/right arrow broken with password mode for entry +// * for some reason on oe builds of elementary initial text set doesnt work. +// +// (incomplete) +// * disabled not supported // * tab widget focusing (not useful for touchscreen tho...) -// * entry has no way to show its focused vs other entries +// * entry needs to support setting selection to all, or clearing +// * bubble should allow style (left/right + top/bottom) +// * need to get toplevel +// * entry needs to set vkbd properties/hint (as does win) // * entry selection conflicts with finger scroll +// * on the fly theme changes - test (should work) +// +// (more widgets/features) // * toolbar widget (edje + box + button + separators) // * listitem widget (simple label + icon) // * radio widget + group handling // * checkbox widget (like toggle) -// * entry needs to support setting selection to all, or clearing -// * entry click below text doesnt put cursor at end -// * bubble should allow style (left/right + top/bottom) // * need separator widget (h/v) // * need slide-open "panel" that can hold stuff and optionally scroll // * need "photoframe" widget (for contact photos?) @@ -301,9 +310,6 @@ extern "C" { // * need multi-sel (with button + hover + ...) // * need slider widget // * need range selector (select range of values from X to Y over an interval) -// * need a way to filter entry data for entry (eg for phone numbers) -// * entry needs to set vkbd properties/hint (as does win) -// * need to get toplevel // * need "dialogbutton" widget (bigger button for bottom of wins) // * need dialog window widget // * need a phone-number widget (hilight country dial prefixes, add flags, @@ -311,8 +317,12 @@ extern "C" { // * need imageview widget (for large not iconic images) // * tiled image + zoom widget (tiled map viewer) // * dialpad widget - need one with a phone dialpad -// * on the fly theme changes - test (should work) -// * single line entry on scale change adds newlines -// * scale change for hover doesnt seem to do new size alloc nicely -// * left/right arrow broken with password mode for entry +// +// (improvements) +// * widgets should show who is focused (not useful for touchscreen) +// * scroller could do with page up/down/left/right buttons and and idea of +// a page size +// * current sizing tree inefficient +// * need a way to filter entry data for entry (eg for phone numbers) +// #endif diff --git a/src/lib/elc_anchorblock.c b/src/lib/elc_anchorblock.c index 0448a3e..b5c6cc8 100644 --- a/src/lib/elc_anchorblock.c +++ b/src/lib/elc_anchorblock.c @@ -15,7 +15,6 @@ static void _del_pre_hook(Evas_Object *obj); static void _del_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 _on_focus_hook(void *data, Evas_Object *obj); static void _parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info); static void diff --git a/src/lib/elc_anchorview.c b/src/lib/elc_anchorview.c index eb41424..dc5f944 100644 --- a/src/lib/elc_anchorview.c +++ b/src/lib/elc_anchorview.c @@ -15,7 +15,6 @@ static void _del_pre_hook(Evas_Object *obj); static void _del_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 _on_focus_hook(void *data, Evas_Object *obj); static void _parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info); static void diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index fda445b..408c185 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -98,7 +98,16 @@ static void _on_focus_hook(void *data, Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); - evas_object_focus_set(wd->ent, 1); + if (elm_widget_focus_get(obj)) + { + evas_object_focus_set(wd->ent, 1); + edje_object_signal_emit(wd->ent, "elm,action,focus", "elm"); + } + else + { + edje_object_signal_emit(wd->ent, "elm,action,unfocus", "elm"); + evas_object_focus_set(wd->ent, 0); + } } static void diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c index d937447..60e9612 100644 --- a/src/lib/elm_widget.c +++ b/src/lib/elm_widget.c @@ -443,6 +443,7 @@ elm_widget_focused_object_clear(Evas_Object *obj) } } if (sd->focus_func) sd->focus_func(obj); + if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj); } EAPI void -- 2.7.4