2010-10-19 13:21:53 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include "elm_priv.h"
|
2012-08-30 09:45:51 -07:00
|
|
|
#include "elm_widget_ctxpopup.h"
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
EAPI const char ELM_CTXPOPUP_SMART_NAME[] = "elm_ctxpopup";
|
2010-10-19 13:21:53 -07:00
|
|
|
|
|
|
|
static const char SIG_DISMISSED[] = "dismissed";
|
2012-08-30 09:45:51 -07:00
|
|
|
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
2010-12-08 08:18:30 -08:00
|
|
|
{SIG_DISMISSED, ""},
|
|
|
|
{NULL, NULL}
|
2010-10-19 13:21:53 -07:00
|
|
|
};
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
EVAS_SMART_SUBCLASS_NEW
|
|
|
|
(ELM_CTXPOPUP_SMART_NAME, _elm_ctxpopup, Elm_Ctxpopup_Smart_Class,
|
|
|
|
Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] ctxpopup, focus-chain
i'd like to raise an issue about focus chain on the ctxpopup. the focus
would go around only in the ctxpopup. (IMHO, raster keep the previous
popup
patch. so definitely!!)
but.. first of all, current ctxpopup does not have focus_next(). even
though there is focus_next(), it is not work properly,
because the parent of ctxpopup would be a widget which does not take
care
of sub objects in the focus_next(); such as elm_list.
(every widget can be a parent of ctxpopup, if the widget is enough
size to
display ctxpopup. thus the elm_list can be a parent of ctxpopup also).
anyhow, to resolve this issue, the patch uses event() of
elm_widget_event_hook_set().
the ctxpopup item is equal to the elm_list item. but the focus chain of
elm_list does not work properly.
generally, we use 'Tab' key to move focus, but elm_list uses the
(up,down)
arrow key moreover it is not a focus.
if you want to check this patch, it would be better to use
ELM_ACCESS_MODE=1.
SVN revision: 74650
2012-07-31 05:30:48 -07:00
|
|
|
static Eina_Bool
|
2012-08-30 09:45:51 -07:00
|
|
|
_elm_ctxpopup_smart_focus_next(const Evas_Object *obj,
|
|
|
|
Elm_Focus_Direction dir,
|
|
|
|
Evas_Object **next)
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] ctxpopup, focus-chain
i'd like to raise an issue about focus chain on the ctxpopup. the focus
would go around only in the ctxpopup. (IMHO, raster keep the previous
popup
patch. so definitely!!)
but.. first of all, current ctxpopup does not have focus_next(). even
though there is focus_next(), it is not work properly,
because the parent of ctxpopup would be a widget which does not take
care
of sub objects in the focus_next(); such as elm_list.
(every widget can be a parent of ctxpopup, if the widget is enough
size to
display ctxpopup. thus the elm_list can be a parent of ctxpopup also).
anyhow, to resolve this issue, the patch uses event() of
elm_widget_event_hook_set().
the ctxpopup item is equal to the elm_list item. but the focus chain of
elm_list does not work properly.
generally, we use 'Tab' key to move focus, but elm_list uses the
(up,down)
arrow key moreover it is not a focus.
if you want to check this patch, it would be better to use
ELM_ACCESS_MODE=1.
SVN revision: 74650
2012-07-31 05:30:48 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] ctxpopup, focus-chain
i'd like to raise an issue about focus chain on the ctxpopup. the focus
would go around only in the ctxpopup. (IMHO, raster keep the previous
popup
patch. so definitely!!)
but.. first of all, current ctxpopup does not have focus_next(). even
though there is focus_next(), it is not work properly,
because the parent of ctxpopup would be a widget which does not take
care
of sub objects in the focus_next(); such as elm_list.
(every widget can be a parent of ctxpopup, if the widget is enough
size to
display ctxpopup. thus the elm_list can be a parent of ctxpopup also).
anyhow, to resolve this issue, the patch uses event() of
elm_widget_event_hook_set().
the ctxpopup item is equal to the elm_list item. but the focus chain of
elm_list does not work properly.
generally, we use 'Tab' key to move focus, but elm_list uses the
(up,down)
arrow key moreover it is not a focus.
if you want to check this patch, it would be better to use
ELM_ACCESS_MODE=1.
SVN revision: 74650
2012-07-31 05:30:48 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd)
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] ctxpopup, focus-chain
i'd like to raise an issue about focus chain on the ctxpopup. the focus
would go around only in the ctxpopup. (IMHO, raster keep the previous
popup
patch. so definitely!!)
but.. first of all, current ctxpopup does not have focus_next(). even
though there is focus_next(), it is not work properly,
because the parent of ctxpopup would be a widget which does not take
care
of sub objects in the focus_next(); such as elm_list.
(every widget can be a parent of ctxpopup, if the widget is enough
size to
display ctxpopup. thus the elm_list can be a parent of ctxpopup also).
anyhow, to resolve this issue, the patch uses event() of
elm_widget_event_hook_set().
the ctxpopup item is equal to the elm_list item. but the focus chain of
elm_list does not work properly.
generally, we use 'Tab' key to move focus, but elm_list uses the
(up,down)
arrow key moreover it is not a focus.
if you want to check this patch, it would be better to use
ELM_ACCESS_MODE=1.
SVN revision: 74650
2012-07-31 05:30:48 -07:00
|
|
|
return EINA_FALSE;
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!elm_widget_focus_next_get(sd->box, dir, next))
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] ctxpopup, focus-chain
i'd like to raise an issue about focus chain on the ctxpopup. the focus
would go around only in the ctxpopup. (IMHO, raster keep the previous
popup
patch. so definitely!!)
but.. first of all, current ctxpopup does not have focus_next(). even
though there is focus_next(), it is not work properly,
because the parent of ctxpopup would be a widget which does not take
care
of sub objects in the focus_next(); such as elm_list.
(every widget can be a parent of ctxpopup, if the widget is enough
size to
display ctxpopup. thus the elm_list can be a parent of ctxpopup also).
anyhow, to resolve this issue, the patch uses event() of
elm_widget_event_hook_set().
the ctxpopup item is equal to the elm_list item. but the focus chain of
elm_list does not work properly.
generally, we use 'Tab' key to move focus, but elm_list uses the
(up,down)
arrow key moreover it is not a focus.
if you want to check this patch, it would be better to use
ELM_ACCESS_MODE=1.
SVN revision: 74650
2012-07-31 05:30:48 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_widget_focused_object_clear(sd->box);
|
|
|
|
elm_widget_focus_next_get(sd->box, dir, next);
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] ctxpopup, focus-chain
i'd like to raise an issue about focus chain on the ctxpopup. the focus
would go around only in the ctxpopup. (IMHO, raster keep the previous
popup
patch. so definitely!!)
but.. first of all, current ctxpopup does not have focus_next(). even
though there is focus_next(), it is not work properly,
because the parent of ctxpopup would be a widget which does not take
care
of sub objects in the focus_next(); such as elm_list.
(every widget can be a parent of ctxpopup, if the widget is enough
size to
display ctxpopup. thus the elm_list can be a parent of ctxpopup also).
anyhow, to resolve this issue, the patch uses event() of
elm_widget_event_hook_set().
the ctxpopup item is equal to the elm_list item. but the focus chain of
elm_list does not work properly.
generally, we use 'Tab' key to move focus, but elm_list uses the
(up,down)
arrow key moreover it is not a focus.
if you want to check this patch, it would be better to use
ELM_ACCESS_MODE=1.
SVN revision: 74650
2012-07-31 05:30:48 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2011-08-27 19:38:48 -07:00
|
|
|
static Eina_Bool
|
2012-08-30 09:45:51 -07:00
|
|
|
_elm_ctxpopup_smart_event(Evas_Object *obj,
|
|
|
|
Evas_Object *src __UNUSED__,
|
|
|
|
Evas_Callback_Type type,
|
|
|
|
void *event_info)
|
2011-08-27 19:38:48 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
Evas_Event_Key_Down *ev = event_info;
|
2011-08-27 19:38:48 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] ctxpopup, focus-chain
i'd like to raise an issue about focus chain on the ctxpopup. the focus
would go around only in the ctxpopup. (IMHO, raster keep the previous
popup
patch. so definitely!!)
but.. first of all, current ctxpopup does not have focus_next(). even
though there is focus_next(), it is not work properly,
because the parent of ctxpopup would be a widget which does not take
care
of sub objects in the focus_next(); such as elm_list.
(every widget can be a parent of ctxpopup, if the widget is enough
size to
display ctxpopup. thus the elm_list can be a parent of ctxpopup also).
anyhow, to resolve this issue, the patch uses event() of
elm_widget_event_hook_set().
the ctxpopup item is equal to the elm_list item. but the focus chain of
elm_list does not work properly.
generally, we use 'Tab' key to move focus, but elm_list uses the
(up,down)
arrow key moreover it is not a focus.
if you want to check this patch, it would be better to use
ELM_ACCESS_MODE=1.
SVN revision: 74650
2012-07-31 05:30:48 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (elm_widget_disabled_get(obj)) return EINA_FALSE;
|
|
|
|
if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
|
2011-08-27 19:38:48 -07:00
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] ctxpopup, focus-chain
i'd like to raise an issue about focus chain on the ctxpopup. the focus
would go around only in the ctxpopup. (IMHO, raster keep the previous
popup
patch. so definitely!!)
but.. first of all, current ctxpopup does not have focus_next(). even
though there is focus_next(), it is not work properly,
because the parent of ctxpopup would be a widget which does not take
care
of sub objects in the focus_next(); such as elm_list.
(every widget can be a parent of ctxpopup, if the widget is enough
size to
display ctxpopup. thus the elm_list can be a parent of ctxpopup also).
anyhow, to resolve this issue, the patch uses event() of
elm_widget_event_hook_set().
the ctxpopup item is equal to the elm_list item. but the focus chain of
elm_list does not work properly.
generally, we use 'Tab' key to move focus, but elm_list uses the
(up,down)
arrow key moreover it is not a focus.
if you want to check this patch, it would be better to use
ELM_ACCESS_MODE=1.
SVN revision: 74650
2012-07-31 05:30:48 -07:00
|
|
|
|
|
|
|
if (!strcmp(ev->keyname, "Tab"))
|
|
|
|
{
|
|
|
|
if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_widget_focus_cycle(sd->box, ELM_FOCUS_PREVIOUS);
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] ctxpopup, focus-chain
i'd like to raise an issue about focus chain on the ctxpopup. the focus
would go around only in the ctxpopup. (IMHO, raster keep the previous
popup
patch. so definitely!!)
but.. first of all, current ctxpopup does not have focus_next(). even
though there is focus_next(), it is not work properly,
because the parent of ctxpopup would be a widget which does not take
care
of sub objects in the focus_next(); such as elm_list.
(every widget can be a parent of ctxpopup, if the widget is enough
size to
display ctxpopup. thus the elm_list can be a parent of ctxpopup also).
anyhow, to resolve this issue, the patch uses event() of
elm_widget_event_hook_set().
the ctxpopup item is equal to the elm_list item. but the focus chain of
elm_list does not work properly.
generally, we use 'Tab' key to move focus, but elm_list uses the
(up,down)
arrow key moreover it is not a focus.
if you want to check this patch, it would be better to use
ELM_ACCESS_MODE=1.
SVN revision: 74650
2012-07-31 05:30:48 -07:00
|
|
|
else
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_widget_focus_cycle(sd->box, ELM_FOCUS_NEXT);
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] ctxpopup, focus-chain
i'd like to raise an issue about focus chain on the ctxpopup. the focus
would go around only in the ctxpopup. (IMHO, raster keep the previous
popup
patch. so definitely!!)
but.. first of all, current ctxpopup does not have focus_next(). even
though there is focus_next(), it is not work properly,
because the parent of ctxpopup would be a widget which does not take
care
of sub objects in the focus_next(); such as elm_list.
(every widget can be a parent of ctxpopup, if the widget is enough
size to
display ctxpopup. thus the elm_list can be a parent of ctxpopup also).
anyhow, to resolve this issue, the patch uses event() of
elm_widget_event_hook_set().
the ctxpopup item is equal to the elm_list item. but the focus chain of
elm_list does not work properly.
generally, we use 'Tab' key to move focus, but elm_list uses the
(up,down)
arrow key moreover it is not a focus.
if you want to check this patch, it would be better to use
ELM_ACCESS_MODE=1.
SVN revision: 74650
2012-07-31 05:30:48 -07:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2011-08-27 19:38:48 -07:00
|
|
|
if (strcmp(ev->keyname, "Escape")) return EINA_FALSE;
|
|
|
|
|
|
|
|
evas_object_hide(obj);
|
|
|
|
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_x_pos_adjust(Evas_Coord_Point *pos,
|
|
|
|
Evas_Coord_Point *base_size,
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
Evas_Coord_Rectangle *hover_area)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
pos->x -= (base_size->x / 2);
|
|
|
|
|
|
|
|
if (pos->x < hover_area->x)
|
2011-08-13 20:47:51 -07:00
|
|
|
pos->x = hover_area->x;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
else if ((pos->x + base_size->x) > (hover_area->x + hover_area->w))
|
2011-08-13 20:47:51 -07:00
|
|
|
pos->x = (hover_area->x + hover_area->w) - base_size->x;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
if (base_size->x > hover_area->w)
|
2011-08-13 20:47:51 -07:00
|
|
|
base_size->x -= (base_size->x - hover_area->w);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
if (pos->x < hover_area->x)
|
2011-08-13 20:47:51 -07:00
|
|
|
pos->x = hover_area->x;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_y_pos_adjust(Evas_Coord_Point *pos,
|
|
|
|
Evas_Coord_Point *base_size,
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
Evas_Coord_Rectangle *hover_area)
|
|
|
|
{
|
|
|
|
pos->y -= (base_size->y / 2);
|
|
|
|
|
|
|
|
if (pos->y < hover_area->y)
|
2011-08-13 20:47:51 -07:00
|
|
|
pos->y = hover_area->y;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
else if ((pos->y + base_size->y) > (hover_area->y + hover_area->h))
|
2011-08-13 20:47:51 -07:00
|
|
|
pos->y = hover_area->y + hover_area->h - base_size->y;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
if (base_size->y > hover_area->h)
|
2011-08-13 20:47:51 -07:00
|
|
|
base_size->y -= (base_size->y - hover_area->h);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
if (pos->y < hover_area->y)
|
2011-08-13 20:47:51 -07:00
|
|
|
pos->y = hover_area->y;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static Elm_Ctxpopup_Direction
|
2012-08-30 09:45:51 -07:00
|
|
|
_base_geometry_calc(Evas_Object *obj,
|
|
|
|
Evas_Coord_Rectangle *rect)
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
Elm_Ctxpopup_Direction dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
|
|
|
Evas_Coord_Rectangle hover_area;
|
2011-01-11 01:54:41 -08:00
|
|
|
Evas_Coord_Point pos = {0, 0};
|
2012-08-30 09:45:51 -07:00
|
|
|
Evas_Coord_Point arrow_size;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
Evas_Coord_Point base_size;
|
|
|
|
Evas_Coord_Point max_size;
|
|
|
|
Evas_Coord_Point min_size;
|
|
|
|
Evas_Coord_Point temp;
|
|
|
|
int idx;
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!rect) return ELM_CTXPOPUP_DIRECTION_DOWN;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
edje_object_part_geometry_get
|
|
|
|
(sd->arrow, "ctxpopup_arrow", NULL, NULL, &arrow_size.x, &arrow_size.y);
|
|
|
|
evas_object_resize(sd->arrow, arrow_size.x, arrow_size.y);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2011-03-23 19:17:34 -07:00
|
|
|
//Initialize Area Rectangle.
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_geometry_get
|
|
|
|
(sd->parent, &hover_area.x, &hover_area.y, &hover_area.w,
|
|
|
|
&hover_area.h);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
evas_object_geometry_get(obj, &pos.x, &pos.y, NULL, NULL);
|
|
|
|
|
2011-03-23 19:17:34 -07:00
|
|
|
//recalc the edje
|
2012-08-30 09:45:51 -07:00
|
|
|
edje_object_size_min_calc
|
|
|
|
(ELM_WIDGET_DATA(sd)->resize_obj, &base_size.x, &base_size.y);
|
|
|
|
evas_object_smart_calculate(ELM_WIDGET_DATA(sd)->resize_obj);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
//Limit to Max Size
|
|
|
|
evas_object_size_hint_max_get(obj, &max_size.x, &max_size.y);
|
|
|
|
|
|
|
|
if ((max_size.y > 0) && (base_size.y > max_size.y))
|
2011-08-13 20:47:51 -07:00
|
|
|
base_size.y = max_size.y;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
if ((max_size.x > 0) && (base_size.x > max_size.x))
|
2011-08-13 20:47:51 -07:00
|
|
|
base_size.x = max_size.x;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2011-03-23 19:17:34 -07:00
|
|
|
//Limit to Min Size
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
evas_object_size_hint_min_get(obj, &min_size.x, &min_size.y);
|
|
|
|
|
|
|
|
if ((min_size.y > 0) && (base_size.y < min_size.y))
|
2011-08-13 20:47:51 -07:00
|
|
|
base_size.y = min_size.y;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
if ((min_size.x > 0) && (base_size.x < min_size.x))
|
2011-08-13 20:47:51 -07:00
|
|
|
base_size.x = min_size.x;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
//Check the Which direction is available.
|
2011-03-23 19:17:34 -07:00
|
|
|
//If find a avaialble direction, it adjusts position and size.
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
for (idx = 0; idx < 4; idx++)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
switch (sd->dir_priority[idx])
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
2011-09-14 00:48:54 -07:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_UNKNOWN:
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_UP:
|
2012-08-30 09:45:51 -07:00
|
|
|
temp.y = (pos.y - base_size.y);
|
|
|
|
if ((temp.y - arrow_size.y) < hover_area.y)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
_x_pos_adjust(&pos, &base_size, &hover_area);
|
|
|
|
pos.y -= base_size.y;
|
|
|
|
dir = ELM_CTXPOPUP_DIRECTION_UP;
|
|
|
|
break;
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_LEFT:
|
2012-08-30 09:45:51 -07:00
|
|
|
temp.x = (pos.x - base_size.x);
|
|
|
|
if ((temp.x - arrow_size.x) < hover_area.x)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
_y_pos_adjust(&pos, &base_size, &hover_area);
|
|
|
|
pos.x -= base_size.x;
|
|
|
|
dir = ELM_CTXPOPUP_DIRECTION_LEFT;
|
|
|
|
break;
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_RIGHT:
|
2012-08-30 09:45:51 -07:00
|
|
|
temp.x = (pos.x + base_size.x);
|
|
|
|
if ((temp.x + arrow_size.x) >
|
|
|
|
(hover_area.x + hover_area.w))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
_y_pos_adjust(&pos, &base_size, &hover_area);
|
|
|
|
dir = ELM_CTXPOPUP_DIRECTION_RIGHT;
|
|
|
|
break;
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_DOWN:
|
2012-08-30 09:45:51 -07:00
|
|
|
temp.y = (pos.y + base_size.y);
|
|
|
|
if ((temp.y + arrow_size.y) >
|
|
|
|
(hover_area.y + hover_area.h))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
_x_pos_adjust(&pos, &base_size, &hover_area);
|
|
|
|
dir = ELM_CTXPOPUP_DIRECTION_DOWN;
|
|
|
|
break;
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
default:
|
2012-09-11 21:34:08 -07:00
|
|
|
break;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
break;
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
//In this case, all directions are invalid because of lack of space.
|
|
|
|
if (idx == 4)
|
|
|
|
{
|
|
|
|
Evas_Coord length[2];
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->horizontal)
|
2011-08-12 22:40:16 -07:00
|
|
|
{
|
|
|
|
length[0] = pos.y - hover_area.y;
|
|
|
|
length[1] = (hover_area.y + hover_area.h) - pos.y;
|
|
|
|
|
2011-08-12 23:05:19 -07:00
|
|
|
// ELM_CTXPOPUP_DIRECTION_UP
|
2011-08-12 22:40:16 -07:00
|
|
|
if (length[0] > length[1])
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
_x_pos_adjust(&pos, &base_size, &hover_area);
|
2011-08-12 22:40:16 -07:00
|
|
|
pos.y -= base_size.y;
|
2011-08-12 23:05:19 -07:00
|
|
|
dir = ELM_CTXPOPUP_DIRECTION_UP;
|
|
|
|
if (pos.y < (hover_area.y + arrow_size.y))
|
2011-08-12 22:40:16 -07:00
|
|
|
{
|
2011-08-13 20:47:51 -07:00
|
|
|
base_size.y -= ((hover_area.y + arrow_size.y) - pos.y);
|
|
|
|
pos.y = hover_area.y + arrow_size.y;
|
2011-08-12 22:40:16 -07:00
|
|
|
}
|
|
|
|
}
|
2011-08-12 23:05:19 -07:00
|
|
|
//ELM_CTXPOPUP_DIRECTION_DOWN
|
2011-08-12 22:40:16 -07:00
|
|
|
else
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
_x_pos_adjust(&pos, &base_size, &hover_area);
|
2011-08-12 23:05:19 -07:00
|
|
|
dir = ELM_CTXPOPUP_DIRECTION_DOWN;
|
|
|
|
if ((pos.y + arrow_size.y + base_size.y) >
|
|
|
|
(hover_area.y + hover_area.h))
|
2012-08-30 09:45:51 -07:00
|
|
|
base_size.y -=
|
|
|
|
((pos.y + arrow_size.y + base_size.y) -
|
|
|
|
(hover_area.y + hover_area.h));
|
2011-08-12 22:40:16 -07:00
|
|
|
}
|
|
|
|
}
|
2011-04-25 21:31:23 -07:00
|
|
|
else
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
2011-08-12 22:40:16 -07:00
|
|
|
length[0] = pos.x - hover_area.x;
|
|
|
|
length[1] = (hover_area.x + hover_area.w) - pos.x;
|
2011-08-12 23:05:19 -07:00
|
|
|
|
|
|
|
//ELM_CTXPOPUP_DIRECTION_LEFT
|
2011-08-12 22:40:16 -07:00
|
|
|
if (length[0] > length[1])
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
_y_pos_adjust(&pos, &base_size, &hover_area);
|
2011-08-12 22:40:16 -07:00
|
|
|
pos.x -= base_size.x;
|
2011-08-12 23:05:19 -07:00
|
|
|
dir = ELM_CTXPOPUP_DIRECTION_LEFT;
|
|
|
|
if (pos.x < (hover_area.x + arrow_size.x))
|
2011-08-12 22:40:16 -07:00
|
|
|
{
|
|
|
|
base_size.x -= ((hover_area.x + arrow_size.x) - pos.x);
|
|
|
|
pos.x = hover_area.x + arrow_size.x;
|
|
|
|
}
|
|
|
|
}
|
2011-08-12 23:05:19 -07:00
|
|
|
//ELM_CTXPOPUP_DIRECTION_RIGHT
|
2011-08-12 22:40:16 -07:00
|
|
|
else
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
_y_pos_adjust(&pos, &base_size, &hover_area);
|
2011-08-12 23:05:19 -07:00
|
|
|
dir = ELM_CTXPOPUP_DIRECTION_RIGHT;
|
|
|
|
if (pos.x + (arrow_size.x + base_size.x) >
|
2011-08-12 22:40:16 -07:00
|
|
|
hover_area.x + hover_area.w)
|
2012-08-30 09:45:51 -07:00
|
|
|
base_size.x -=
|
|
|
|
((pos.x + arrow_size.x + base_size.x) -
|
|
|
|
(hover_area.x + hover_area.w));
|
2011-08-12 22:40:16 -07:00
|
|
|
}
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-03-23 19:17:34 -07:00
|
|
|
//Final position and size.
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
rect->x = pos.x;
|
|
|
|
rect->y = pos.y;
|
|
|
|
rect->w = base_size.x;
|
|
|
|
rect->h = base_size.y;
|
|
|
|
|
2011-08-12 23:05:19 -07:00
|
|
|
return dir;
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_arrow_update(Evas_Object *obj,
|
|
|
|
Elm_Ctxpopup_Direction dir,
|
2011-12-15 21:31:47 -08:00
|
|
|
Evas_Coord_Rectangle base_size)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
Evas_Coord_Rectangle arrow_size;
|
2012-08-30 09:45:51 -07:00
|
|
|
Evas_Coord x, y;
|
2011-10-24 17:27:18 -07:00
|
|
|
double drag;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_geometry_get
|
|
|
|
(sd->arrow, NULL, NULL, &arrow_size.w, &arrow_size.h);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
/* arrow is not being kept as sub-object on purpose, here. the
|
|
|
|
* design of the widget does not help with the contrary */
|
2011-10-13 19:22:59 -07:00
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
switch (dir)
|
|
|
|
{
|
2011-08-12 23:05:19 -07:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_RIGHT:
|
2012-08-30 09:45:51 -07:00
|
|
|
edje_object_signal_emit(sd->arrow, "elm,state,left", "elm");
|
|
|
|
edje_object_part_swallow
|
|
|
|
(ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_left",
|
|
|
|
sd->arrow);
|
|
|
|
if (base_size.h > 0)
|
|
|
|
{
|
|
|
|
if (y < ((arrow_size.h * 0.5) + base_size.y))
|
|
|
|
y = 0;
|
|
|
|
else if (y > base_size.y + base_size.h - (arrow_size.h * 0.5))
|
|
|
|
y = base_size.h - arrow_size.h;
|
|
|
|
else
|
|
|
|
y = y - base_size.y - (arrow_size.h * 0.5);
|
|
|
|
drag = (double)(y) / (double)(base_size.h - arrow_size.h);
|
|
|
|
edje_object_part_drag_value_set
|
|
|
|
(ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_left", 1,
|
|
|
|
drag);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2011-08-12 23:05:19 -07:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_LEFT:
|
2012-08-30 09:45:51 -07:00
|
|
|
edje_object_signal_emit(sd->arrow, "elm,state,right", "elm");
|
|
|
|
edje_object_part_swallow
|
|
|
|
(ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_right",
|
|
|
|
sd->arrow);
|
|
|
|
|
|
|
|
if (base_size.h > 0)
|
|
|
|
{
|
|
|
|
if (y < ((arrow_size.h * 0.5) + base_size.y))
|
|
|
|
y = 0;
|
|
|
|
else if (y > (base_size.y + base_size.h - (arrow_size.h * 0.5)))
|
|
|
|
y = base_size.h - arrow_size.h;
|
|
|
|
else
|
|
|
|
y = y - base_size.y - (arrow_size.h * 0.5);
|
|
|
|
drag = (double)(y) / (double)(base_size.h - arrow_size.h);
|
|
|
|
edje_object_part_drag_value_set
|
|
|
|
(ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_right", 0,
|
|
|
|
drag);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2011-08-12 23:05:19 -07:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_DOWN:
|
2012-08-30 09:45:51 -07:00
|
|
|
edje_object_signal_emit(sd->arrow, "elm,state,top", "elm");
|
|
|
|
edje_object_part_swallow
|
|
|
|
(ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_up",
|
|
|
|
sd->arrow);
|
|
|
|
|
|
|
|
if (base_size.w > 0)
|
|
|
|
{
|
|
|
|
if (x < ((arrow_size.w * 0.5) + base_size.x))
|
|
|
|
x = 0;
|
|
|
|
else if (x > (base_size.x + base_size.w - (arrow_size.w * 0.5)))
|
|
|
|
x = base_size.w - arrow_size.w;
|
|
|
|
else
|
|
|
|
x = x - base_size.x - (arrow_size.w * 0.5);
|
|
|
|
drag = (double)(x) / (double)(base_size.w - arrow_size.w);
|
|
|
|
edje_object_part_drag_value_set
|
|
|
|
(ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_up", drag,
|
|
|
|
1);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2011-08-12 23:05:19 -07:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_UP:
|
2012-08-30 09:45:51 -07:00
|
|
|
edje_object_signal_emit(sd->arrow, "elm,state,bottom", "elm");
|
|
|
|
edje_object_part_swallow
|
|
|
|
(ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_down",
|
|
|
|
sd->arrow);
|
|
|
|
|
|
|
|
if (base_size.w > 0)
|
|
|
|
{
|
|
|
|
if (x < ((arrow_size.w * 0.5) + base_size.x))
|
|
|
|
x = 0;
|
|
|
|
else if (x > (base_size.x + base_size.w - (arrow_size.w * 0.5)))
|
|
|
|
x = base_size.w - arrow_size.w;
|
|
|
|
else x = x - base_size.x - (arrow_size.w * 0.5);
|
|
|
|
drag = (double)(x) / (double)(base_size.w - arrow_size.w);
|
|
|
|
edje_object_part_drag_value_set
|
|
|
|
(ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_down",
|
|
|
|
drag, 0);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
default:
|
2012-08-30 09:45:51 -07:00
|
|
|
break;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
2012-03-22 03:14:58 -07:00
|
|
|
|
|
|
|
//should be here for getting accurate geometry value
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_smart_calculate(ELM_WIDGET_DATA(sd)->resize_obj);
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
2012-02-01 03:26:25 -08:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_show_signals_emit(Evas_Object *obj,
|
|
|
|
Elm_Ctxpopup_Direction dir)
|
2012-02-01 03:26:25 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2012-02-01 03:26:25 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->visible) return;
|
|
|
|
if ((sd->list) && (!sd->list_visible)) return;
|
2012-02-01 03:26:25 -08:00
|
|
|
|
|
|
|
switch (dir)
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_UP:
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,show,up", "elm");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_LEFT:
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,show,left", "elm");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_RIGHT:
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,show,right", "elm");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_DOWN:
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,show,down", "elm");
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2012-02-01 03:26:25 -08:00
|
|
|
}
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
edje_object_signal_emit(sd->bg, "elm,state,show", "elm");
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,show", "elm");
|
2012-02-01 03:26:25 -08:00
|
|
|
}
|
|
|
|
|
2011-08-24 00:02:26 -07:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_hide_signals_emit(Evas_Object *obj,
|
|
|
|
Elm_Ctxpopup_Direction dir)
|
2011-08-24 00:02:26 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2011-08-24 00:02:26 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->visible) return;
|
2011-08-24 00:02:26 -07:00
|
|
|
|
|
|
|
switch (dir)
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
case ELM_CTXPOPUP_DIRECTION_UP:
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,hide,up", "elm");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_LEFT:
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,hide,left", "elm");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_RIGHT:
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,hide,right", "elm");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_DOWN:
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,hide,down", "elm");
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2011-08-24 00:02:26 -07:00
|
|
|
}
|
2012-08-30 09:45:51 -07:00
|
|
|
|
|
|
|
edje_object_signal_emit(sd->bg, "elm,state,hide", "elm");
|
2011-08-24 00:02:26 -07:00
|
|
|
}
|
|
|
|
|
2010-11-18 04:55:28 -08:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_base_shift_by_arrow(Evas_Object *arrow,
|
|
|
|
Elm_Ctxpopup_Direction dir,
|
|
|
|
Evas_Coord_Rectangle *rect)
|
|
|
|
{
|
|
|
|
Evas_Coord arrow_w, arrow_h;
|
|
|
|
|
|
|
|
evas_object_geometry_get(arrow, NULL, NULL, &arrow_w, &arrow_h);
|
|
|
|
switch (dir)
|
|
|
|
{
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_RIGHT:
|
|
|
|
rect->x += arrow_w;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_LEFT:
|
|
|
|
rect->x -= arrow_w;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_DOWN:
|
|
|
|
rect->y += arrow_h;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_CTXPOPUP_DIRECTION_UP:
|
|
|
|
rect->y -= arrow_h;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_elm_ctxpopup_smart_sub_object_add(Evas_Object *obj,
|
|
|
|
Evas_Object *sobj)
|
|
|
|
{
|
|
|
|
Elm_Widget_Smart_Class *parent_parent;
|
|
|
|
|
|
|
|
parent_parent = (Elm_Widget_Smart_Class *)((Evas_Smart_Class *)
|
|
|
|
_elm_ctxpopup_parent_sc)->parent;
|
|
|
|
|
|
|
|
/* skipping layout's code, which registers size hint changing
|
|
|
|
* callback on sub objects. a hack to make ctxpopup live, as it is,
|
|
|
|
* on the new classing schema. this widget needs a total
|
|
|
|
* rewrite. */
|
|
|
|
if (!parent_parent->sub_object_add(obj, sobj))
|
|
|
|
return EINA_FALSE;
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_ctxpopup_smart_sizing_eval(Evas_Object *obj)
|
2010-11-18 04:55:28 -08:00
|
|
|
{
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
Evas_Coord_Rectangle rect = { 0, 0, 1, 1 };
|
2012-03-22 03:14:58 -07:00
|
|
|
Evas_Coord_Point list_size = { 0, 0 };
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (!sd->arrow) return; /* simple way to flag "under deletion" */
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
|
|
|
//Base
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->dir = _base_geometry_calc(obj, &rect);
|
|
|
|
|
|
|
|
_arrow_update(obj, sd->dir, rect);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
_base_shift_by_arrow(sd->arrow, sd->dir, &rect);
|
|
|
|
|
|
|
|
if ((sd->list) && (sd->list_visible))
|
2012-03-22 03:14:58 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_geometry_get(sd->list, 0, 0, &list_size.x, &list_size.y);
|
2012-03-22 03:14:58 -07:00
|
|
|
if ((list_size.x >= rect.w) || (list_size.y >= rect.h))
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_list_mode_set(sd->list, ELM_LIST_COMPRESS);
|
|
|
|
evas_object_size_hint_min_set(sd->box, rect.w, rect.h);
|
2012-03-22 03:14:58 -07:00
|
|
|
evas_object_size_hint_min_set(obj, rect.w, rect.h);
|
|
|
|
}
|
2012-08-30 09:45:51 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
evas_object_move(ELM_WIDGET_DATA(sd)->resize_obj, rect.x, rect.y);
|
|
|
|
evas_object_resize(ELM_WIDGET_DATA(sd)->resize_obj, rect.w, rect.h);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
_show_signals_emit(obj, sd->dir);
|
2010-11-18 04:55:28 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_on_parent_del(void *data,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
2010-11-18 04:55:28 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_del(data);
|
|
|
|
}
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
static void
|
|
|
|
_on_parent_move(void *data,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
|
|
|
{
|
|
|
|
ELM_CTXPOPUP_DATA_GET(data, sd);
|
|
|
|
|
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
|
|
|
|
|
|
|
if (sd->visible) elm_layout_sizing_eval(data);
|
2010-11-18 04:55:28 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_on_parent_resize(void *data,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
2010-11-18 04:55:28 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(data, sd);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_hide(data);
|
2010-11-18 04:55:28 -08:00
|
|
|
}
|
|
|
|
|
2010-10-19 13:21:53 -07:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_parent_detach(Evas_Object *obj)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->parent) return;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(sd->parent, EVAS_CALLBACK_DEL, _on_parent_del, obj);
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(sd->parent, EVAS_CALLBACK_MOVE, _on_parent_move, obj);
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(sd->parent, EVAS_CALLBACK_RESIZE, _on_parent_resize, obj);
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_on_content_resized(void *data,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(data, sd);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_box_recalculate(sd->box);
|
|
|
|
elm_layout_sizing_eval(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
//FIXME: lost the content size when theme hook is called.
|
|
|
|
static Eina_Bool
|
|
|
|
_elm_ctxpopup_smart_theme(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!ELM_WIDGET_CLASS(_elm_ctxpopup_parent_sc)->theme(obj))
|
|
|
|
return EINA_FALSE;
|
2011-10-23 23:49:08 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_widget_theme_object_set
|
|
|
|
(obj, sd->bg, "ctxpopup", "bg", elm_widget_style_get(obj));
|
|
|
|
elm_widget_theme_object_set
|
|
|
|
(obj, sd->arrow, "ctxpopup", "arrow", elm_widget_style_get(obj));
|
2011-10-24 17:27:18 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->list)
|
2011-01-31 00:47:19 -08:00
|
|
|
{
|
2011-10-24 17:27:18 -07:00
|
|
|
if (!strncmp(elm_object_style_get(obj), "default", strlen("default")))
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_object_style_set(sd->list, "ctxpopup");
|
2011-03-23 19:17:34 -07:00
|
|
|
else
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_object_style_set(sd->list, elm_object_style_get(obj));
|
2011-01-31 00:47:19 -08:00
|
|
|
}
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
2011-08-28 00:12:16 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->visible) elm_layout_sizing_eval(obj);
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
/* kind of a big and tricky override here: an internal box will hold
|
|
|
|
* the actual content. content aliases won't be of much help here */
|
|
|
|
static Eina_Bool
|
|
|
|
_elm_ctxpopup_smart_content_set(Evas_Object *obj,
|
|
|
|
const char *part,
|
|
|
|
Evas_Object *content)
|
2011-08-02 21:38:44 -07:00
|
|
|
{
|
2011-12-15 21:27:11 -08:00
|
|
|
Evas_Coord min_w = -1, min_h = -1;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if ((part) && (strcmp(part, "default")))
|
|
|
|
return ELM_CONTAINER_CLASS(_elm_ctxpopup_parent_sc)->content_set
|
|
|
|
(obj, part, content);
|
|
|
|
|
|
|
|
if (!content) return EINA_FALSE;
|
|
|
|
|
|
|
|
if (content == sd->content) return EINA_TRUE;
|
|
|
|
|
|
|
|
if (sd->content) evas_object_del(sd->content);
|
|
|
|
if (sd->content == sd->list) sd->list = NULL;
|
|
|
|
|
|
|
|
evas_object_size_hint_weight_set
|
|
|
|
(content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_fill_set
|
|
|
|
(content, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
|
|
|
|
/* since it's going to be a box content, not a layout's... */
|
2011-12-15 21:27:11 -08:00
|
|
|
evas_object_show(content);
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_size_hint_min_get(content, &min_w, &min_h);
|
|
|
|
evas_object_size_hint_min_set(sd->box, min_w, min_h);
|
|
|
|
elm_box_pack_end(sd->box, content);
|
2011-12-15 21:27:11 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->content = content;
|
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
2011-08-02 21:38:44 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->visible) elm_layout_sizing_eval(obj);
|
2011-08-28 00:12:16 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
return EINA_TRUE;
|
2011-08-02 21:38:44 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
2012-08-30 09:45:51 -07:00
|
|
|
_elm_ctxpopup_smart_content_get(const Evas_Object *obj,
|
|
|
|
const char *part)
|
2011-08-02 21:38:44 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2011-08-02 21:38:44 -07:00
|
|
|
|
2012-09-04 07:10:00 -07:00
|
|
|
if ((part) && (strcmp(part, "default")))
|
|
|
|
return ELM_CONTAINER_CLASS(_elm_ctxpopup_parent_sc)->content_get
|
|
|
|
(obj, part);
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
return sd->content;
|
2011-08-02 21:38:44 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
2012-08-30 09:45:51 -07:00
|
|
|
_elm_ctxpopup_smart_content_unset(Evas_Object *obj,
|
|
|
|
const char *part)
|
2011-08-02 21:38:44 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
Evas_Object *content;
|
|
|
|
|
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
|
|
|
|
2012-09-04 07:10:00 -07:00
|
|
|
if ((part) && (strcmp(part, "default")))
|
|
|
|
return ELM_CONTAINER_CLASS(_elm_ctxpopup_parent_sc)->content_unset
|
|
|
|
(obj, part);
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
content = sd->content;
|
|
|
|
if (!content) return NULL;
|
|
|
|
|
|
|
|
sd->content = NULL;
|
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
|
|
|
|
|
|
|
if (sd->visible) elm_layout_sizing_eval(obj);
|
|
|
|
|
|
|
|
return content;
|
2011-08-02 21:38:44 -07:00
|
|
|
}
|
|
|
|
|
2011-11-16 18:16:38 -08:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_item_text_set_hook(Elm_Object_Item *it,
|
|
|
|
const char *part,
|
|
|
|
const char *label)
|
2011-11-16 18:16:38 -08:00
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Item *ctxpopup_it;
|
|
|
|
|
2012-03-22 03:14:58 -07:00
|
|
|
if ((part) && (strcmp(part, "default"))) return;
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-03-06 03:51:42 -08:00
|
|
|
ctxpopup_it = (Elm_Ctxpopup_Item *)it;
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(WIDGET(ctxpopup_it), sd);
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-03-22 03:14:58 -07:00
|
|
|
elm_object_item_part_text_set(ctxpopup_it->list_item, "default", label);
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->visible) elm_layout_sizing_eval(WIDGET(ctxpopup_it));
|
2011-11-16 18:16:38 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static const char *
|
2012-08-30 09:45:51 -07:00
|
|
|
_item_text_get_hook(const Elm_Object_Item *it,
|
|
|
|
const char *part)
|
2011-11-16 18:16:38 -08:00
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Item *ctxpopup_it;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2011-11-16 18:16:38 -08:00
|
|
|
if (part && strcmp(part, "default")) return NULL;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2012-03-06 03:51:42 -08:00
|
|
|
ctxpopup_it = (Elm_Ctxpopup_Item *)it;
|
2012-03-22 03:14:58 -07:00
|
|
|
return elm_object_item_part_text_get(ctxpopup_it->list_item, "default");
|
2011-11-16 18:16:38 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_content_set_hook(Elm_Object_Item *it,
|
|
|
|
const char *part,
|
|
|
|
Evas_Object *content)
|
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Item *ctxpopup_it;
|
|
|
|
|
2012-03-22 03:14:58 -07:00
|
|
|
if ((part) && (strcmp(part, "icon"))
|
|
|
|
&& (strcmp(part, "start"))
|
|
|
|
&& (strcmp(part, "end"))) return;
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-03-06 03:51:42 -08:00
|
|
|
ctxpopup_it = (Elm_Ctxpopup_Item *)it;
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(WIDGET(ctxpopup_it), sd);
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-03-22 03:14:58 -07:00
|
|
|
if ((part) && (!strcmp(part, "end")))
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_object_item_part_content_set(ctxpopup_it->list_item, "end", content);
|
2012-03-22 03:14:58 -07:00
|
|
|
else
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_object_item_part_content_set
|
|
|
|
(ctxpopup_it->list_item, "start", content);
|
2012-03-22 03:14:58 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->visible) elm_layout_sizing_eval(WIDGET(ctxpopup_it));
|
2011-11-16 18:16:38 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
2012-08-30 09:45:51 -07:00
|
|
|
_item_content_get_hook(const Elm_Object_Item *it,
|
|
|
|
const char *part)
|
2011-11-16 18:16:38 -08:00
|
|
|
{
|
|
|
|
Elm_Ctxpopup_Item *ctxpopup_it;
|
2012-03-22 03:14:58 -07:00
|
|
|
|
|
|
|
if (part && strcmp(part, "icon") && strcmp(part, "start")
|
|
|
|
&& strcmp(part, "end")) return NULL;
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ctxpopup_it = (Elm_Ctxpopup_Item *)it;
|
2012-03-22 03:14:58 -07:00
|
|
|
|
|
|
|
if (part && !strcmp(part, "end"))
|
2012-08-30 09:45:51 -07:00
|
|
|
return elm_object_item_part_content_get(ctxpopup_it->list_item, "end");
|
2012-03-22 03:14:58 -07:00
|
|
|
else
|
2012-08-30 09:45:51 -07:00
|
|
|
return elm_object_item_part_content_get(ctxpopup_it->list_item, "start");
|
2011-11-16 18:16:38 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-01-09 17:00:23 -08:00
|
|
|
_item_disable_hook(Elm_Object_Item *it)
|
2011-11-16 18:16:38 -08:00
|
|
|
{
|
2012-03-06 03:51:42 -08:00
|
|
|
Elm_Ctxpopup_Item *ctxpopup_it = (Elm_Ctxpopup_Item *)it;
|
2011-11-16 18:16:38 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_object_item_disabled_set
|
|
|
|
(ctxpopup_it->list_item, elm_widget_item_disabled_get(ctxpopup_it));
|
2011-11-16 18:16:38 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_item_signal_emit_hook(Elm_Object_Item *it,
|
|
|
|
const char *emission,
|
2011-11-16 18:16:38 -08:00
|
|
|
const char *source)
|
|
|
|
{
|
2012-03-06 03:51:42 -08:00
|
|
|
Elm_Ctxpopup_Item *ctxpopup_it = (Elm_Ctxpopup_Item *)it;
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2012-03-22 03:14:58 -07:00
|
|
|
elm_object_item_signal_emit(ctxpopup_it->list_item, emission, source);
|
2011-11-16 18:16:38 -08:00
|
|
|
}
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_bg_clicked_cb(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(data, sd);
|
|
|
|
|
|
|
|
_hide_signals_emit(data, sd->dir);
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_on_show(void *data __UNUSED__,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2012-03-22 03:14:58 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->list)
|
2012-03-22 03:14:58 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_list_go(sd->list);
|
|
|
|
sd->visible = EINA_TRUE;
|
From: Kim Shinwoo <kimcinoo.efl@gmail.com>
Subject: [E-devel] [patch][elementary] ctxpopup, focus-chain
i'd like to raise an issue about focus chain on the ctxpopup. the focus
would go around only in the ctxpopup. (IMHO, raster keep the previous
popup
patch. so definitely!!)
but.. first of all, current ctxpopup does not have focus_next(). even
though there is focus_next(), it is not work properly,
because the parent of ctxpopup would be a widget which does not take
care
of sub objects in the focus_next(); such as elm_list.
(every widget can be a parent of ctxpopup, if the widget is enough
size to
display ctxpopup. thus the elm_list can be a parent of ctxpopup also).
anyhow, to resolve this issue, the patch uses event() of
elm_widget_event_hook_set().
the ctxpopup item is equal to the elm_list item. but the focus chain of
elm_list does not work properly.
generally, we use 'Tab' key to move focus, but elm_list uses the
(up,down)
arrow key moreover it is not a focus.
if you want to check this patch, it would be better to use
ELM_ACCESS_MODE=1.
SVN revision: 74650
2012-07-31 05:30:48 -07:00
|
|
|
elm_object_focus_set(obj, EINA_TRUE);
|
2012-03-22 03:14:58 -07:00
|
|
|
return;
|
|
|
|
}
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->content) return;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->visible = EINA_TRUE;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_show(sd->bg);
|
|
|
|
evas_object_show(sd->arrow);
|
|
|
|
|
|
|
|
edje_object_signal_emit(sd->bg, "elm,state,show", "elm");
|
|
|
|
elm_layout_signal_emit(obj, "elm,state,show", "elm");
|
|
|
|
|
|
|
|
elm_layout_sizing_eval(obj);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2011-08-27 19:38:48 -07:00
|
|
|
elm_object_focus_set(obj, EINA_TRUE);
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
2012-02-01 03:26:25 -08:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_on_hide(void *data __UNUSED__,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
2012-02-01 03:26:25 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->visible) return;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_hide(sd->bg);
|
|
|
|
evas_object_hide(sd->arrow);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->visible = EINA_FALSE;
|
|
|
|
sd->list_visible = EINA_FALSE;
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
2011-12-15 21:27:11 -08:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_on_move(void *data __UNUSED__,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
2011-12-15 21:27:11 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (sd->visible) evas_object_show(sd->arrow);
|
|
|
|
|
|
|
|
elm_layout_sizing_eval(obj);
|
2011-12-15 21:27:11 -08:00
|
|
|
}
|
|
|
|
|
2010-10-19 13:21:53 -07:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_hide_finished_cb(void *data,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_hide(data);
|
|
|
|
evas_object_smart_callback_call(data, SIG_DISMISSED, NULL);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_list_resize_cb(void *data,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj __UNUSED__,
|
|
|
|
void *event_info __UNUSED__)
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(data, sd);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->visible) return;
|
|
|
|
if (sd->list_visible) return;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->list_visible = EINA_TRUE;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_show(sd->bg);
|
|
|
|
evas_object_show(sd->arrow);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_layout_sizing_eval(data);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
2011-12-20 22:35:22 -08:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_ctxpopup_restack_cb(void *data __UNUSED__,
|
|
|
|
Evas *e __UNUSED__,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info __UNUSED__)
|
2011-12-20 22:35:22 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2011-12-20 22:35:22 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_layer_set(sd->bg, evas_object_layer_get(obj));
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_list_del(Elm_Ctxpopup_Smart_Data *sd)
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->list) return;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_del(sd->list);
|
|
|
|
sd->list = NULL;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
2012-01-27 03:56:14 -08:00
|
|
|
static Eina_Bool
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
_item_del_pre_hook(Elm_Object_Item *it)
|
|
|
|
{
|
2012-03-22 03:14:58 -07:00
|
|
|
Evas_Object *list;
|
2012-03-06 03:51:42 -08:00
|
|
|
Elm_Ctxpopup_Item *ctxpopup_it = (Elm_Ctxpopup_Item *)it;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(WIDGET(ctxpopup_it), sd);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
|
2012-03-22 03:14:58 -07:00
|
|
|
list = elm_object_item_widget_get(ctxpopup_it->list_item);
|
|
|
|
|
|
|
|
if (eina_list_count(elm_list_items_get(list)) < 2)
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
{
|
2012-03-22 03:14:58 -07:00
|
|
|
elm_object_item_del(ctxpopup_it->list_item);
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
evas_object_hide(WIDGET(ctxpopup_it));
|
2012-08-30 09:45:51 -07:00
|
|
|
|
2012-01-27 03:56:14 -08:00
|
|
|
return EINA_TRUE;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
|
2012-03-22 03:14:58 -07:00
|
|
|
elm_object_item_del(ctxpopup_it->list_item);
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->list_visible) elm_layout_sizing_eval(WIDGET(ctxpopup_it));
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_elm_ctxpopup_smart_disable(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (!ELM_WIDGET_CLASS(_elm_ctxpopup_parent_sc)->disable(obj))
|
|
|
|
return EINA_FALSE;
|
|
|
|
|
|
|
|
elm_object_disabled_set(sd->list, elm_widget_disabled_get(obj));
|
2012-01-27 03:56:14 -08:00
|
|
|
|
|
|
|
return EINA_TRUE;
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
}
|
|
|
|
|
2012-03-14 06:03:38 -07:00
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_elm_ctxpopup_smart_add(Evas_Object *obj)
|
2012-03-14 06:03:38 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
EVAS_SMART_DATA_ALLOC(obj, Elm_Ctxpopup_Smart_Data);
|
|
|
|
|
|
|
|
ELM_WIDGET_CLASS(_elm_ctxpopup_parent_sc)->base.add(obj);
|
|
|
|
|
|
|
|
elm_layout_theme_set(obj, "ctxpopup", "base", elm_widget_style_get(obj));
|
|
|
|
elm_layout_signal_callback_add
|
|
|
|
(obj, "elm,action,hide,finished", "", _hide_finished_cb, obj);
|
|
|
|
|
|
|
|
//Background
|
|
|
|
priv->bg = edje_object_add(evas_object_evas_get(obj));
|
|
|
|
elm_widget_theme_object_set(obj, priv->bg, "ctxpopup", "bg", "default");
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(priv->bg, "elm,action,click", "", _bg_clicked_cb, obj);
|
|
|
|
|
|
|
|
evas_object_stack_below(priv->bg, obj);
|
2012-03-14 06:03:38 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
//Arrow
|
|
|
|
priv->arrow = edje_object_add(evas_object_evas_get(obj));
|
|
|
|
elm_widget_theme_object_set
|
|
|
|
(obj, priv->arrow, "ctxpopup", "arrow", "default");
|
|
|
|
|
|
|
|
priv->dir_priority[0] = ELM_CTXPOPUP_DIRECTION_UP;
|
|
|
|
priv->dir_priority[1] = ELM_CTXPOPUP_DIRECTION_LEFT;
|
|
|
|
priv->dir_priority[2] = ELM_CTXPOPUP_DIRECTION_RIGHT;
|
|
|
|
priv->dir_priority[3] = ELM_CTXPOPUP_DIRECTION_DOWN;
|
|
|
|
priv->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
|
|
|
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(obj, EVAS_CALLBACK_RESTACK, _ctxpopup_restack_cb, obj);
|
|
|
|
|
|
|
|
priv->box = elm_box_add(obj);
|
|
|
|
evas_object_size_hint_weight_set
|
|
|
|
(priv->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(priv->box, EVAS_CALLBACK_RESIZE, _on_content_resized, obj);
|
|
|
|
|
|
|
|
/* box will be our content placeholder, thus the parent's version call */
|
|
|
|
ELM_CONTAINER_CLASS(_elm_ctxpopup_parent_sc)->content_set
|
|
|
|
(obj, "elm.swallow.content", priv->box);
|
|
|
|
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _on_show, NULL);
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _on_hide, NULL);
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _on_move, NULL);
|
|
|
|
|
|
|
|
elm_widget_can_focus_set(obj, EINA_TRUE);
|
2012-03-14 06:03:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_elm_ctxpopup_smart_del(Evas_Object *obj)
|
2012-03-14 06:03:38 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(sd->box, EVAS_CALLBACK_RESIZE, _on_content_resized, obj);
|
|
|
|
_parent_detach(obj);
|
|
|
|
|
|
|
|
elm_ctxpopup_clear(obj);
|
|
|
|
evas_object_del(sd->arrow);
|
|
|
|
sd->arrow = NULL; /* stops _sizing_eval() from going on on deletion */
|
|
|
|
|
|
|
|
evas_object_del(sd->bg);
|
|
|
|
sd->bg = NULL;
|
|
|
|
|
|
|
|
ELM_WIDGET_CLASS(_elm_ctxpopup_parent_sc)->base.del(obj);
|
2012-03-14 06:03:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_elm_ctxpopup_smart_parent_set(Evas_Object *obj,
|
|
|
|
Evas_Object *parent)
|
2012-03-14 06:03:38 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
//default parent is to be hover parent
|
|
|
|
elm_ctxpopup_hover_parent_set(obj, parent);
|
2012-03-14 06:03:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-08-30 09:45:51 -07:00
|
|
|
_elm_ctxpopup_smart_set_user(Elm_Ctxpopup_Smart_Class *sc)
|
2012-03-14 06:03:38 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_WIDGET_CLASS(sc)->base.add = _elm_ctxpopup_smart_add;
|
|
|
|
ELM_WIDGET_CLASS(sc)->base.del = _elm_ctxpopup_smart_del;
|
|
|
|
|
|
|
|
ELM_WIDGET_CLASS(sc)->parent_set = _elm_ctxpopup_smart_parent_set;
|
|
|
|
ELM_WIDGET_CLASS(sc)->disable = _elm_ctxpopup_smart_disable;
|
|
|
|
ELM_WIDGET_CLASS(sc)->event = _elm_ctxpopup_smart_event;
|
|
|
|
ELM_WIDGET_CLASS(sc)->theme = _elm_ctxpopup_smart_theme;
|
|
|
|
ELM_WIDGET_CLASS(sc)->sub_object_add = _elm_ctxpopup_smart_sub_object_add;
|
|
|
|
ELM_WIDGET_CLASS(sc)->focus_next = _elm_ctxpopup_smart_focus_next;
|
|
|
|
ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
|
|
|
|
|
|
|
|
ELM_CONTAINER_CLASS(sc)->content_get = _elm_ctxpopup_smart_content_get;
|
|
|
|
ELM_CONTAINER_CLASS(sc)->content_set = _elm_ctxpopup_smart_content_set;
|
|
|
|
ELM_CONTAINER_CLASS(sc)->content_unset = _elm_ctxpopup_smart_content_unset;
|
|
|
|
|
|
|
|
ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_ctxpopup_smart_sizing_eval;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const Elm_Ctxpopup_Smart_Class *
|
|
|
|
elm_ctxpopup_smart_class_get(void)
|
|
|
|
{
|
|
|
|
static Elm_Ctxpopup_Smart_Class _sc =
|
|
|
|
ELM_CTXPOPUP_SMART_CLASS_INIT_NAME_VERSION(ELM_CTXPOPUP_SMART_NAME);
|
|
|
|
static const Elm_Ctxpopup_Smart_Class *class = NULL;
|
|
|
|
Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
|
|
|
|
|
|
|
|
if (class)
|
|
|
|
return class;
|
|
|
|
|
|
|
|
_elm_ctxpopup_smart_set(&_sc);
|
|
|
|
esc->callbacks = _smart_callbacks;
|
|
|
|
class = &_sc;
|
|
|
|
|
|
|
|
return class;
|
2012-03-14 06:03:38 -07:00
|
|
|
}
|
|
|
|
|
2010-12-08 08:18:30 -08:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_ctxpopup_add(Evas_Object *parent)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2010-12-08 08:18:30 -08:00
|
|
|
Evas_Object *obj;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
obj = elm_widget_add(_elm_ctxpopup_smart_class_new(), parent);
|
|
|
|
if (!obj) return NULL;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!elm_widget_sub_object_add(parent, obj))
|
|
|
|
ERR("could not add %p as sub object of %p", obj, parent);
|
2011-08-29 08:59:56 -07:00
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
return obj;
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_ctxpopup_hover_parent_set(Evas_Object *obj,
|
|
|
|
Evas_Object *parent)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2011-08-29 08:59:56 -07:00
|
|
|
Evas_Coord x, y, w, h;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj);
|
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2010-12-03 06:08:33 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!parent) return;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
_parent_detach(obj);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_event_callback_add
|
|
|
|
(parent, EVAS_CALLBACK_DEL, _on_parent_del, obj);
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(parent, EVAS_CALLBACK_MOVE, _on_parent_move, obj);
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(parent, EVAS_CALLBACK_RESIZE, _on_parent_resize, obj);
|
|
|
|
|
|
|
|
sd->parent = parent;
|
2011-08-29 08:28:05 -07:00
|
|
|
|
2011-09-01 21:09:17 -07:00
|
|
|
//Update Background
|
2011-08-29 09:05:24 -07:00
|
|
|
evas_object_geometry_get(parent, &x, &y, &w, &h);
|
2012-08-30 09:45:51 -07:00
|
|
|
evas_object_move(sd->bg, x, y);
|
|
|
|
evas_object_resize(sd->bg, w, h);
|
2011-08-29 08:59:56 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->visible) elm_layout_sizing_eval(obj);
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Evas_Object *
|
2010-11-30 22:52:46 -08:00
|
|
|
elm_ctxpopup_hover_parent_get(const Evas_Object *obj)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj) NULL;
|
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
return sd->parent;
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_ctxpopup_clear(Evas_Object *obj)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj);
|
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
_list_del(sd);
|
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_ctxpopup_horizontal_set(Evas_Object *obj,
|
|
|
|
Eina_Bool horizontal)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj);
|
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->horizontal = !!horizontal;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->list) return;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_list_horizontal_set(sd->list, sd->horizontal);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->visible) elm_layout_sizing_eval(obj);
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
2010-11-30 22:52:46 -08:00
|
|
|
elm_ctxpopup_horizontal_get(const Evas_Object *obj)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj) EINA_FALSE;
|
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
return sd->horizontal;
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
2011-08-13 20:36:56 -07:00
|
|
|
EAPI Elm_Object_Item *
|
2012-08-30 09:45:51 -07:00
|
|
|
elm_ctxpopup_item_append(Evas_Object *obj,
|
|
|
|
const char *label,
|
|
|
|
Evas_Object *icon,
|
|
|
|
Evas_Smart_Cb func,
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
const void *data)
|
2010-10-19 13:21:53 -07:00
|
|
|
{
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
Elm_Ctxpopup_Item *item;
|
2010-10-19 13:21:53 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj) NULL;
|
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2010-10-19 13:21:53 -07:00
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
item = elm_widget_item_new(obj, Elm_Ctxpopup_Item);
|
2011-02-13 07:19:35 -08:00
|
|
|
if (!item) return NULL;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
elementary/menu, ctxpopup, index, segment_control, diskselector, multibuttonentry, toolbar, naviframe, slideshow, hoversel, filpselector - deprecated xxxx_item_del() APIs.
But instead, made to use the elm_object_item_del() APIs
for this, elm_widget_item needed to provide elm_widget_item_del_pre_hook.
SVN revision: 67010
2012-01-09 21:02:11 -08:00
|
|
|
elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook);
|
2012-01-09 17:00:23 -08:00
|
|
|
elm_widget_item_disable_hook_set(item, _item_disable_hook);
|
2011-11-16 18:16:38 -08:00
|
|
|
elm_widget_item_text_set_hook_set(item, _item_text_set_hook);
|
|
|
|
elm_widget_item_text_get_hook_set(item, _item_text_get_hook);
|
|
|
|
elm_widget_item_content_set_hook_set(item, _item_content_set_hook);
|
|
|
|
elm_widget_item_content_get_hook_set(item, _item_content_get_hook);
|
|
|
|
elm_widget_item_signal_emit_hook_set(item, _item_signal_emit_hook);
|
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (!sd->list)
|
2012-03-22 03:14:58 -07:00
|
|
|
{
|
|
|
|
//The first item is appended.
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->list = elm_list_add(obj);
|
|
|
|
elm_list_mode_set(sd->list, ELM_LIST_EXPAND);
|
|
|
|
elm_list_horizontal_set(sd->list, sd->horizontal);
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(sd->list, EVAS_CALLBACK_RESIZE, _list_resize_cb, obj);
|
|
|
|
elm_layout_content_set(obj, "default", sd->list);
|
2012-03-22 03:14:58 -07:00
|
|
|
}
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
item->list_item =
|
|
|
|
elm_list_item_append(sd->list, label, icon, NULL, func, data);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->visible) elm_layout_sizing_eval(obj);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-03-06 03:51:42 -08:00
|
|
|
return (Elm_Object_Item *)item;
|
2010-10-19 13:21:53 -07:00
|
|
|
}
|
|
|
|
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
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)
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj);
|
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
sd->dir_priority[0] = first;
|
|
|
|
sd->dir_priority[1] = second;
|
|
|
|
sd->dir_priority[2] = third;
|
|
|
|
sd->dir_priority[3] = fourth;
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (sd->visible) elm_layout_sizing_eval(obj);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj);
|
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
if (first) *first = sd->dir_priority[0];
|
|
|
|
if (second) *second = sd->dir_priority[1];
|
|
|
|
if (third) *third = sd->dir_priority[2];
|
|
|
|
if (fourth) *fourth = sd->dir_priority[3];
|
From: ChunEon Park <chuneon.park@samsung.com>
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)
SVN revision: 56021
2011-01-10 00:59:40 -08:00
|
|
|
}
|
2011-08-28 00:12:16 -07:00
|
|
|
|
|
|
|
EAPI Elm_Ctxpopup_Direction
|
|
|
|
elm_ctxpopup_direction_get(const Evas_Object *obj)
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj) ELM_CTXPOPUP_DIRECTION_UNKNOWN;
|
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
2011-08-28 00:12:16 -07:00
|
|
|
|
2012-08-30 09:45:51 -07:00
|
|
|
return sd->dir;
|
2011-08-28 00:12:16 -07:00
|
|
|
}
|
2012-03-06 21:58:38 -08:00
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_ctxpopup_dismiss(Evas_Object *obj)
|
|
|
|
{
|
2012-08-30 09:45:51 -07:00
|
|
|
ELM_CTXPOPUP_CHECK(obj);
|
|
|
|
ELM_CTXPOPUP_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
_hide_signals_emit(obj, sd->dir);
|
2012-03-06 21:58:38 -08:00
|
|
|
}
|