Provide some known Evas_Object layers and set tooltip's to its designed value.

The Elm_Object_Layer is a convenience enumeration to help standardize
values so we don't ride into problems in future.

Tooltip has now its own layer, so set it there and avoid newly created
objects being created on top of them (usually they show on top of
everything as they are the last created, thus the topmost on the
default layer)



SVN revision: 52158
This commit is contained in:
Gustavo Sverzut Barbieri 2010-09-11 17:01:40 +00:00
parent 5c61931bd1
commit a60be2543b
2 changed files with 19 additions and 0 deletions

View File

@ -136,6 +136,22 @@ extern "C" {
#define ELM_RECTS_INTERSECT(x, y, w, h, xx, yy, ww, hh) (((x) < ((xx) + (ww))) && ((y) < ((yy) + (hh))) && (((x) + (w)) > (xx)) && (((y) + (h)) > (yy)))
#define ELM_PI 3.14159265358979323846
/**
* Defines couple of standard Evas_Object layers to be used
* with evas_object_layer_set().
*
* @note whenever extending with new values, try to keep some padding
* to siblings so there is room for further extensions.
*/
typedef enum _Elm_Object_Layer
{
ELM_OBJECT_LAYER_BACKGROUND = EVAS_LAYER_MIN + 64, /**< where to place backgrounds */
ELM_OBJECT_LAYER_DEFAULT = 0, /**< Evas_Object default layer (and thus for Elementary) */
ELM_OBJECT_LAYER_FOCUS = EVAS_LAYER_MAX - 128, /**< where focus object visualization is */
ELM_OBJECT_LAYER_TOOLTIP = EVAS_LAYER_MAX - 64, /**< where to show tooltips */
ELM_OBJECT_LAYER_LAST /**< last layer known by Elementary */
} Elm_Object_Layer;
/**************************************************************************/
EAPI extern int ELM_ECORE_EVENT_ETHUMB_CONNECT;

View File

@ -103,6 +103,8 @@ _elm_tooltip_show(Elm_Tooltip *tt)
tt->tooltip = edje_object_add(tt->evas);
if (!tt->tooltip) return;
evas_object_layer_set(tt->tooltip, ELM_OBJECT_LAYER_TOOLTIP);
evas_object_event_callback_add
(tt->owner, EVAS_CALLBACK_MOVE, _elm_tooltip_obj_move_cb, tt);
evas_object_event_callback_add
@ -255,6 +257,7 @@ _elm_tooltip_reconfigure(Elm_Tooltip *tt)
tt->tooltip = NULL;
return;
}
evas_object_layer_set(tt->content, ELM_OBJECT_LAYER_TOOLTIP);
evas_object_pass_events_set(tt->content, EINA_TRUE);
edje_object_part_swallow
(tt->tooltip, "elm.swallow.content", tt->content);