slider popup outside widget mode. backwards-compatible too. :)
i know - freeze is on. last thing going into elm. only because i rejected the patch at the last minute and it was small enough to do now. SVN revision: 73450
This commit is contained in:
parent
78c52a9599
commit
9e254d1313
|
@ -256,20 +256,20 @@
|
||||||
* Add and use elm_widget_item_widget_get()
|
* Add and use elm_widget_item_widget_get()
|
||||||
* Fix elm_segment_control to not abuse user's data from item.
|
* Fix elm_segment_control to not abuse user's data from item.
|
||||||
|
|
||||||
2012-07-3 Cedric Bail
|
2012-07-03 Cedric Bail
|
||||||
|
|
||||||
* Initialize Emotion when necessary.
|
* Initialize Emotion when necessary.
|
||||||
|
|
||||||
2012-07-3 Minseok Kim
|
2012-07-03 Minseok Kim
|
||||||
|
|
||||||
* Add elm_multibuttonentry_editable_set() and
|
* Add elm_multibuttonentry_editable_set() and
|
||||||
elm_multibuttonentry_editable_get()
|
elm_multibuttonentry_editable_get()
|
||||||
|
|
||||||
2012-07-3 Shinwoo Kim (kimcinoo)
|
2012-07-03 Shinwoo Kim (kimcinoo)
|
||||||
|
|
||||||
* Add access hook to widget infra.
|
* Add access hook to widget infra.
|
||||||
|
|
||||||
2012-07-5 Carsten Haitzler (The Rasterman)
|
2012-07-05 Carsten Haitzler (The Rasterman)
|
||||||
|
|
||||||
* Fix several FB related issues:
|
* Fix several FB related issues:
|
||||||
* Fallback to FB from X11 so it "just works"
|
* Fallback to FB from X11 so it "just works"
|
||||||
|
@ -279,9 +279,13 @@
|
||||||
softcursor mode defaulting to auto.
|
softcursor mode defaulting to auto.
|
||||||
* Add elm_win_screen_dpi_get()
|
* Add elm_win_screen_dpi_get()
|
||||||
|
|
||||||
2012-07-6 Shinwoo Kim (kimcinoo)
|
2012-07-06 Shinwoo Kim (kimcinoo)
|
||||||
|
|
||||||
* Add layout access enable/disable api:
|
* Add layout access enable/disable api:
|
||||||
* elm_layout_edje_object_can_access_set/get()
|
* elm_layout_edje_object_can_access_set/get()
|
||||||
|
|
||||||
|
2012-07-07 Carsten Haitzler (The Rasterman)
|
||||||
|
|
||||||
|
* Add slider popup mode (based in idea originally proposed in
|
||||||
|
patches from Sumanth Krishna Mannam, but susbequently rejected
|
||||||
|
a few times as it didn't measure up to commitable standards).
|
||||||
|
|
|
@ -356,11 +356,22 @@ group { name: "elm/slider/horizontal/default";
|
||||||
text.min: 1 1;
|
text.min: 1 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
part { name: "elm.dragable.slider";
|
part { name: "button";
|
||||||
type: GROUP;
|
type: GROUP;
|
||||||
source: "elm/slider/horizontal/indicator/default";
|
source: "elm/slider/horizontal/indicator/default";
|
||||||
mouse_events: 1;
|
mouse_events: 0;
|
||||||
repeat_events: 1;
|
description { state: "default" 0.0;
|
||||||
|
fixed: 1 1;
|
||||||
|
rel1.to: "elm.dragable.slider";
|
||||||
|
rel2.to: "elm.dragable.slider";
|
||||||
|
}
|
||||||
|
description { state: "hidden" 0.0;
|
||||||
|
inherit: "default" 0.0;
|
||||||
|
visible: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
part { name: "elm.dragable.slider";
|
||||||
|
type: RECT;
|
||||||
scale: 1;
|
scale: 1;
|
||||||
dragable {
|
dragable {
|
||||||
x: 1 1 0;
|
x: 1 1 0;
|
||||||
|
@ -368,8 +379,8 @@ group { name: "elm/slider/horizontal/default";
|
||||||
confine: "bg";
|
confine: "bg";
|
||||||
}
|
}
|
||||||
description { state: "default" 0.0;
|
description { state: "default" 0.0;
|
||||||
min: 0 24;
|
min: 0 0;
|
||||||
max: 0 24;
|
max: 0 0;
|
||||||
fixed: 1 1;
|
fixed: 1 1;
|
||||||
rel1 {
|
rel1 {
|
||||||
relative: 0.5 0.0;
|
relative: 0.5 0.0;
|
||||||
|
@ -379,7 +390,30 @@ group { name: "elm/slider/horizontal/default";
|
||||||
relative: 0.5 1.0;
|
relative: 0.5 1.0;
|
||||||
to_x: "bg";
|
to_x: "bg";
|
||||||
}
|
}
|
||||||
color: 255 0 0 100;
|
color: 0 0 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
part { name: "slideevent";
|
||||||
|
type: RECT;
|
||||||
|
mouse_events: 1;
|
||||||
|
scale: 1;
|
||||||
|
dragable.events: "elm.dragable.slider";
|
||||||
|
description { state: "default" 0.0;
|
||||||
|
fixed: 1 1;
|
||||||
|
min: 24 24;
|
||||||
|
max: 24 24;
|
||||||
|
rel1.to: "elm.dragable.slider";
|
||||||
|
rel2.to: "elm.dragable.slider";
|
||||||
|
color: 0 0 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
part { name: "elm.track.slider";
|
||||||
|
type: SWALLOW;
|
||||||
|
mouse_events: 0;
|
||||||
|
description { state: "default" 0.0;
|
||||||
|
max: 0 0;
|
||||||
|
rel1.to: "elm.dragable.slider";
|
||||||
|
rel2.to: "elm.dragable.slider";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
part { name: "disabler";
|
part { name: "disabler";
|
||||||
|
@ -395,6 +429,38 @@ group { name: "elm/slider/horizontal/default";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
programs {
|
programs {
|
||||||
|
program { name: "indicator_show";
|
||||||
|
signal: "elm,state,indicator,show";
|
||||||
|
source: "elm";
|
||||||
|
action: SIGNAL_EMIT "popup,show" "elm";
|
||||||
|
after: "popup_show2";
|
||||||
|
}
|
||||||
|
program { name: "indicator_hide";
|
||||||
|
signal: "elm,state,indicator,hide";
|
||||||
|
source: "elm";
|
||||||
|
action: SIGNAL_EMIT "popup,hide" "elm";
|
||||||
|
after: "popup_hide2";
|
||||||
|
}
|
||||||
|
program { name: "popup_show";
|
||||||
|
signal: "mouse,down,1";
|
||||||
|
source: "slideevent";
|
||||||
|
action: SIGNAL_EMIT "popup,show" "elm";
|
||||||
|
after: "popup_show2";
|
||||||
|
}
|
||||||
|
program { name: "popup_show2";
|
||||||
|
action: STATE_SET "hidden" 0.0;
|
||||||
|
target: "button";
|
||||||
|
}
|
||||||
|
program { name: "popup_hide";
|
||||||
|
signal: "mouse,up,1";
|
||||||
|
source: "slideevent";
|
||||||
|
action: SIGNAL_EMIT "popup,hide" "elm";
|
||||||
|
after: "popup_hide2";
|
||||||
|
}
|
||||||
|
program { name: "popup_hide2";
|
||||||
|
action: STATE_SET "default" 0.0;
|
||||||
|
target: "button";
|
||||||
|
}
|
||||||
program { name: "text_show";
|
program { name: "text_show";
|
||||||
signal: "elm,state,text,visible";
|
signal: "elm,state,text,visible";
|
||||||
source: "elm";
|
source: "elm";
|
||||||
|
@ -854,11 +920,22 @@ group { name: "elm/slider/vertical/default";
|
||||||
color3: 0 0 0 0;
|
color3: 0 0 0 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
part { name: "elm.dragable.slider";
|
part { name: "button";
|
||||||
type: GROUP;
|
type: GROUP;
|
||||||
source: "elm/slider/vertical/indicator/default";
|
source: "elm/slider/horizontal/indicator/default";
|
||||||
mouse_events: 1;
|
mouse_events: 0;
|
||||||
repeat_events: 1;
|
description { state: "default" 0.0;
|
||||||
|
fixed: 1 1;
|
||||||
|
rel1.to: "elm.dragable.slider";
|
||||||
|
rel2.to: "elm.dragable.slider";
|
||||||
|
}
|
||||||
|
description { state: "hidden" 0.0;
|
||||||
|
inherit: "default" 0.0;
|
||||||
|
visible: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
part { name: "elm.dragable.slider";
|
||||||
|
type: RECT;
|
||||||
scale: 1;
|
scale: 1;
|
||||||
dragable {
|
dragable {
|
||||||
x: 0 0 0;
|
x: 0 0 0;
|
||||||
|
@ -866,20 +943,43 @@ group { name: "elm/slider/vertical/default";
|
||||||
confine: "bg";
|
confine: "bg";
|
||||||
}
|
}
|
||||||
description { state: "default" 0.0;
|
description { state: "default" 0.0;
|
||||||
min: 24 0;
|
min: 0 0;
|
||||||
max: 24 0;
|
max: 0 0;
|
||||||
fixed: 1 1;
|
fixed: 1 1;
|
||||||
rel1 {
|
rel1 {
|
||||||
relative: 0.5 0.0;
|
relative: 0.0 0.5;
|
||||||
to_y: "bg";
|
to_x: "bg";
|
||||||
}
|
}
|
||||||
rel2 {
|
rel2 {
|
||||||
relative: 0.5 1.0;
|
relative: 1.0 0.5;
|
||||||
to_y: "bg";
|
to_x: "bg";
|
||||||
}
|
}
|
||||||
color: 0 0 0 0;
|
color: 0 0 0 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
part { name: "slideevent";
|
||||||
|
type: RECT;
|
||||||
|
mouse_events: 1;
|
||||||
|
scale: 1;
|
||||||
|
dragable.events: "elm.dragable.slider";
|
||||||
|
description { state: "default" 0.0;
|
||||||
|
fixed: 1 1;
|
||||||
|
min: 24 24;
|
||||||
|
max: 24 24;
|
||||||
|
rel1.to: "elm.dragable.slider";
|
||||||
|
rel2.to: "elm.dragable.slider";
|
||||||
|
color: 0 0 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
part { name: "elm.track.slider";
|
||||||
|
type: SWALLOW;
|
||||||
|
mouse_events: 0;
|
||||||
|
description { state: "default" 0.0;
|
||||||
|
max: 0 0;
|
||||||
|
rel1.to: "elm.dragable.slider";
|
||||||
|
rel2.to: "elm.dragable.slider";
|
||||||
|
}
|
||||||
|
}
|
||||||
part { name: "disabler";
|
part { name: "disabler";
|
||||||
type: RECT;
|
type: RECT;
|
||||||
description { state: "default" 0.0;
|
description { state: "default" 0.0;
|
||||||
|
@ -894,6 +994,38 @@ group { name: "elm/slider/vertical/default";
|
||||||
}
|
}
|
||||||
|
|
||||||
programs {
|
programs {
|
||||||
|
program { name: "indicator_show";
|
||||||
|
signal: "elm,state,indicator,show";
|
||||||
|
source: "elm";
|
||||||
|
action: SIGNAL_EMIT "popup,show" "elm";
|
||||||
|
after: "popup_show2";
|
||||||
|
}
|
||||||
|
program { name: "indicator_hide";
|
||||||
|
signal: "elm,state,indicator,hide";
|
||||||
|
source: "elm";
|
||||||
|
action: SIGNAL_EMIT "popup,hide" "elm";
|
||||||
|
after: "popup_hide2";
|
||||||
|
}
|
||||||
|
program { name: "popup_show";
|
||||||
|
signal: "mouse,down,1";
|
||||||
|
source: "slideevent";
|
||||||
|
action: SIGNAL_EMIT "popup,show" "elm";
|
||||||
|
after: "popup_show2";
|
||||||
|
}
|
||||||
|
program { name: "popup_show2";
|
||||||
|
action: STATE_SET "hidden" 0.0;
|
||||||
|
target: "button";
|
||||||
|
}
|
||||||
|
program { name: "popup_hide";
|
||||||
|
signal: "mouse,up,1";
|
||||||
|
source: "slideevent";
|
||||||
|
action: SIGNAL_EMIT "popup,hide" "elm";
|
||||||
|
after: "popup_hide2";
|
||||||
|
}
|
||||||
|
program { name: "popup_hide2";
|
||||||
|
action: STATE_SET "default" 0.0;
|
||||||
|
target: "button";
|
||||||
|
}
|
||||||
program { name: "text_show";
|
program { name: "text_show";
|
||||||
signal: "elm,state,text,visible";
|
signal: "elm,state,text,visible";
|
||||||
source: "elm";
|
source: "elm";
|
||||||
|
@ -1061,6 +1193,10 @@ group { name: "elm/slider/horizontal/indicator/default";
|
||||||
alias: "elm/slider/horizontal/indicator/disabled";
|
alias: "elm/slider/horizontal/indicator/disabled";
|
||||||
alias: "elm/slider/vertical/indicator/default";
|
alias: "elm/slider/vertical/indicator/default";
|
||||||
alias: "elm/slider/vertical/indicator/disabled";
|
alias: "elm/slider/vertical/indicator/disabled";
|
||||||
|
|
||||||
|
alias: "elm/slider/horizontal/popup/default";
|
||||||
|
alias: "elm/slider/vertical/popup/default";
|
||||||
|
|
||||||
images {
|
images {
|
||||||
image: "sl_bt_0.png" COMP;
|
image: "sl_bt_0.png" COMP;
|
||||||
image: "sl_bt_1.png" COMP;
|
image: "sl_bt_1.png" COMP;
|
||||||
|
@ -1323,6 +1459,25 @@ group { name: "elm/slider/horizontal/indicator/default";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
programs {
|
programs {
|
||||||
|
program { name: "popup_show";
|
||||||
|
signal: "popup,show";
|
||||||
|
source: "elm";
|
||||||
|
script {
|
||||||
|
thumb_down();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
program { name: "popup_hide";
|
||||||
|
signal: "popup,hide";
|
||||||
|
source: "elm";
|
||||||
|
action: SIGNAL_EMIT "popup,hide,done" "elm";
|
||||||
|
}
|
||||||
|
program { name: "popup_hide2";
|
||||||
|
signal: "popup,hide";
|
||||||
|
source: "elm";
|
||||||
|
script {
|
||||||
|
thumb_up();
|
||||||
|
}
|
||||||
|
}
|
||||||
program { name: "set_val_show";
|
program { name: "set_val_show";
|
||||||
signal: "elm,state,val,show";
|
signal: "elm,state,val,show";
|
||||||
source: "elm";
|
source: "elm";
|
||||||
|
|
|
@ -10,7 +10,7 @@ struct _Elm_Slider_Smart_Data
|
||||||
{
|
{
|
||||||
Elm_Layout_Smart_Data base;
|
Elm_Layout_Smart_Data base;
|
||||||
|
|
||||||
Evas_Object *spacer;
|
Evas_Object *spacer, *popup, *track;
|
||||||
Ecore_Timer *delay;
|
Ecore_Timer *delay;
|
||||||
|
|
||||||
const char *units;
|
const char *units;
|
||||||
|
@ -31,6 +31,7 @@ struct _Elm_Slider_Smart_Data
|
||||||
Eina_Bool indicator_show : 1;
|
Eina_Bool indicator_show : 1;
|
||||||
Eina_Bool spacer_down : 1;
|
Eina_Bool spacer_down : 1;
|
||||||
Eina_Bool frozen : 1;
|
Eina_Bool frozen : 1;
|
||||||
|
Eina_Bool popup_hiding : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
static const Elm_Layout_Part_Alias_Description _content_aliases[] =
|
static const Elm_Layout_Part_Alias_Description _content_aliases[] =
|
||||||
|
@ -111,7 +112,7 @@ _val_fetch(Evas_Object *obj)
|
||||||
edje_object_part_drag_value_get
|
edje_object_part_drag_value_get
|
||||||
(ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.slider", &posx, &posy);
|
(ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.slider", &posx, &posy);
|
||||||
if (sd->horizontal) pos = posx;
|
if (sd->horizontal) pos = posx;
|
||||||
else pos = posy;
|
else pos = posy;
|
||||||
|
|
||||||
rtl = elm_widget_mirrored_get(obj);
|
rtl = elm_widget_mirrored_get(obj);
|
||||||
if ((!rtl && sd->inverted) ||
|
if ((!rtl && sd->inverted) ||
|
||||||
|
@ -189,7 +190,10 @@ _indicator_set(Evas_Object *obj)
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
||||||
buf = sd->indicator_format_func(sd->val);
|
buf = sd->indicator_format_func(sd->val);
|
||||||
|
elm_layout_text_set(obj, "elm.indicator", buf);
|
||||||
elm_layout_text_set(obj, "elm.dragable.slider:elm.indicator", buf);
|
elm_layout_text_set(obj, "elm.dragable.slider:elm.indicator", buf);
|
||||||
|
if (sd->popup)
|
||||||
|
edje_object_part_text_set(sd->popup, "elm.indicator", buf);
|
||||||
|
|
||||||
if (sd->indicator_format_free) sd->indicator_format_free(buf);
|
if (sd->indicator_format_free) sd->indicator_format_free(buf);
|
||||||
}
|
}
|
||||||
|
@ -198,9 +202,18 @@ _indicator_set(Evas_Object *obj)
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), sd->indicator, sd->val);
|
snprintf(buf, sizeof(buf), sd->indicator, sd->val);
|
||||||
|
elm_layout_text_set(obj, "elm.indicator", buf);
|
||||||
elm_layout_text_set(obj, "elm.dragable.slider:elm.indicator", buf);
|
elm_layout_text_set(obj, "elm.dragable.slider:elm.indicator", buf);
|
||||||
|
if (sd->popup)
|
||||||
|
edje_object_part_text_set(sd->popup, "elm.indicator", buf);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
elm_layout_text_set(obj, "elm.indicator", NULL);
|
||||||
|
elm_layout_text_set(obj, "elm.dragable.slider:elm.indicator", NULL);
|
||||||
|
if (sd->popup)
|
||||||
|
edje_object_part_text_set(sd->popup, "elm.indicator", NULL);
|
||||||
}
|
}
|
||||||
else elm_layout_text_set(obj, "elm.dragable.slider:elm.indicator", NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -287,6 +300,68 @@ _drag_down(void *data,
|
||||||
(ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.slider", step, step);
|
(ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.slider", step, step);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_popup_show(void *data,
|
||||||
|
Evas_Object *obj __UNUSED__,
|
||||||
|
const char *emission __UNUSED__,
|
||||||
|
const char *source __UNUSED__)
|
||||||
|
{
|
||||||
|
ELM_SLIDER_DATA_GET(data, sd);
|
||||||
|
if (sd->popup)
|
||||||
|
{
|
||||||
|
evas_object_raise(sd->popup);
|
||||||
|
evas_object_show(sd->popup);
|
||||||
|
edje_object_signal_emit(sd->popup, "popup,show", "elm");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_popup_hide(void *data,
|
||||||
|
Evas_Object *obj __UNUSED__,
|
||||||
|
const char *emission __UNUSED__,
|
||||||
|
const char *source __UNUSED__)
|
||||||
|
{
|
||||||
|
ELM_SLIDER_DATA_GET(data, sd);
|
||||||
|
if (sd->popup)
|
||||||
|
{
|
||||||
|
if (!sd->popup_hiding)
|
||||||
|
{
|
||||||
|
edje_object_signal_emit(sd->popup, "popup,hide", "elm");
|
||||||
|
sd->popup_hiding = EINA_TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_popup_hide_done(void *data,
|
||||||
|
Evas_Object *obj __UNUSED__,
|
||||||
|
const char *emission __UNUSED__,
|
||||||
|
const char *source __UNUSED__)
|
||||||
|
{
|
||||||
|
ELM_SLIDER_DATA_GET(data, sd);
|
||||||
|
if (sd->popup)
|
||||||
|
{
|
||||||
|
if (sd->popup_hiding)
|
||||||
|
{
|
||||||
|
evas_object_hide(sd->popup);
|
||||||
|
sd->popup_hiding = EINA_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_popup_emit(void *data,
|
||||||
|
Evas_Object *obj __UNUSED__,
|
||||||
|
const char *emission,
|
||||||
|
const char *source)
|
||||||
|
{
|
||||||
|
ELM_SLIDER_DATA_GET(data, sd);
|
||||||
|
if (sd->popup)
|
||||||
|
{
|
||||||
|
edje_object_signal_emit(sd->popup, emission, source);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_elm_slider_smart_event(Evas_Object *obj,
|
_elm_slider_smart_event(Evas_Object *obj,
|
||||||
Evas_Object *src __UNUSED__,
|
Evas_Object *src __UNUSED__,
|
||||||
|
@ -375,9 +450,21 @@ _elm_slider_smart_theme(Evas_Object *obj)
|
||||||
ELM_SLIDER_DATA_GET(obj, sd);
|
ELM_SLIDER_DATA_GET(obj, sd);
|
||||||
|
|
||||||
if (sd->horizontal)
|
if (sd->horizontal)
|
||||||
eina_stringshare_replace(&ELM_LAYOUT_DATA(sd)->group, "horizontal");
|
{
|
||||||
|
eina_stringshare_replace(&ELM_LAYOUT_DATA(sd)->group, "horizontal");
|
||||||
|
if (sd->popup)
|
||||||
|
_elm_theme_set(NULL, sd->popup,
|
||||||
|
"slider", "horizontal/popup",
|
||||||
|
elm_widget_style_get(obj));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
eina_stringshare_replace(&ELM_LAYOUT_DATA(sd)->group, "vertical");
|
{
|
||||||
|
eina_stringshare_replace(&ELM_LAYOUT_DATA(sd)->group, "vertical");
|
||||||
|
if (sd->popup)
|
||||||
|
_elm_theme_set(NULL, sd->popup,
|
||||||
|
"slider", "vertical/popup",
|
||||||
|
elm_widget_style_get(obj));
|
||||||
|
}
|
||||||
|
|
||||||
if (!ELM_WIDGET_CLASS(_elm_slider_parent_sc)->theme(obj)) return EINA_FALSE;
|
if (!ELM_WIDGET_CLASS(_elm_slider_parent_sc)->theme(obj)) return EINA_FALSE;
|
||||||
|
|
||||||
|
@ -394,11 +481,17 @@ _elm_slider_smart_theme(Evas_Object *obj)
|
||||||
elm_config_scale_get());
|
elm_config_scale_get());
|
||||||
|
|
||||||
if (sd->inverted)
|
if (sd->inverted)
|
||||||
elm_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
|
{
|
||||||
|
elm_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
|
||||||
|
if (sd->popup)
|
||||||
|
edje_object_signal_emit(sd->popup, "elm,state,inverted,on", "elm");
|
||||||
|
}
|
||||||
|
|
||||||
_visuals_refresh(obj);
|
_visuals_refresh(obj);
|
||||||
|
|
||||||
edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
|
edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
|
||||||
|
if (sd->popup)
|
||||||
|
edje_object_message_signal_process(sd->popup);
|
||||||
|
|
||||||
elm_layout_sizing_eval(obj);
|
elm_layout_sizing_eval(obj);
|
||||||
|
|
||||||
|
@ -544,6 +637,32 @@ _spacer_up_cb(void *data,
|
||||||
elm_layout_signal_emit(data, "elm,state,indicator,hide", "elm");
|
elm_layout_signal_emit(data, "elm,state,indicator,hide", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_track_move_cb(void *data,
|
||||||
|
Evas *e __UNUSED__,
|
||||||
|
Evas_Object *obj,
|
||||||
|
void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
Evas_Coord x, y;
|
||||||
|
|
||||||
|
ELM_SLIDER_DATA_GET(data, sd);
|
||||||
|
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
|
||||||
|
evas_object_move(sd->popup, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_track_resize_cb(void *data,
|
||||||
|
Evas *e __UNUSED__,
|
||||||
|
Evas_Object *obj,
|
||||||
|
void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
Evas_Coord w, h;
|
||||||
|
|
||||||
|
ELM_SLIDER_DATA_GET(data, sd);
|
||||||
|
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
|
||||||
|
evas_object_move(sd->popup, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_min_max_set(Evas_Object *obj)
|
_min_max_set(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
@ -599,6 +718,9 @@ _elm_slider_smart_add(Evas_Object *obj)
|
||||||
elm_layout_signal_callback_add(obj, "drag,stop", "*", _drag_stop, obj);
|
elm_layout_signal_callback_add(obj, "drag,stop", "*", _drag_stop, obj);
|
||||||
elm_layout_signal_callback_add(obj, "drag,step", "*", _drag_step, obj);
|
elm_layout_signal_callback_add(obj, "drag,step", "*", _drag_step, obj);
|
||||||
elm_layout_signal_callback_add(obj, "drag,page", "*", _drag_stop, obj);
|
elm_layout_signal_callback_add(obj, "drag,page", "*", _drag_stop, obj);
|
||||||
|
elm_layout_signal_callback_add(obj, "popup,show", "elm", _popup_show, obj);
|
||||||
|
elm_layout_signal_callback_add(obj, "popup,hide", "elm", _popup_hide, obj);
|
||||||
|
elm_layout_signal_callback_add(obj, "*", "popup,emit", _popup_emit, obj);
|
||||||
edje_object_part_drag_value_set
|
edje_object_part_drag_value_set
|
||||||
(ELM_WIDGET_DATA(priv)->resize_obj, "elm.dragable.slider", 0.0, 0.0);
|
(ELM_WIDGET_DATA(priv)->resize_obj, "elm.dragable.slider", 0.0, 0.0);
|
||||||
|
|
||||||
|
@ -607,6 +729,30 @@ _elm_slider_smart_add(Evas_Object *obj)
|
||||||
evas_object_pass_events_set(priv->spacer, EINA_TRUE);
|
evas_object_pass_events_set(priv->spacer, EINA_TRUE);
|
||||||
elm_layout_content_set(obj, "elm.swallow.bar", priv->spacer);
|
elm_layout_content_set(obj, "elm.swallow.bar", priv->spacer);
|
||||||
|
|
||||||
|
/* if theme has an overlayed slider mode, then lets support it */
|
||||||
|
if (edje_object_part_exists(elm_layout_edje_get(obj),
|
||||||
|
"elm.track.slider"))
|
||||||
|
{
|
||||||
|
// XXX popup needs to adapt to theme etc.
|
||||||
|
priv->popup = edje_object_add(evas_object_evas_get(obj));
|
||||||
|
_elm_theme_set(NULL, priv->popup,
|
||||||
|
"slider", "horizontal/popup",
|
||||||
|
elm_widget_style_get(obj));
|
||||||
|
edje_object_signal_callback_add(priv->popup, "popup,hide,done", "elm",
|
||||||
|
_popup_hide_done, obj);
|
||||||
|
|
||||||
|
/* create a rectangle to track position+size of the dragable */
|
||||||
|
priv->track = evas_object_rectangle_add(evas_object_evas_get(obj));
|
||||||
|
evas_object_event_callback_add
|
||||||
|
(priv->track, EVAS_CALLBACK_MOVE, _track_move_cb, obj);
|
||||||
|
evas_object_event_callback_add
|
||||||
|
(priv->track, EVAS_CALLBACK_RESIZE, _track_resize_cb, obj);
|
||||||
|
|
||||||
|
evas_object_color_set(priv->track, 0, 0, 0, 0);
|
||||||
|
evas_object_pass_events_set(priv->track, EINA_TRUE);
|
||||||
|
elm_layout_content_set(obj, "elm.track.slider", priv->track);
|
||||||
|
}
|
||||||
|
|
||||||
evas_object_event_callback_add
|
evas_object_event_callback_add
|
||||||
(priv->spacer, EVAS_CALLBACK_MOUSE_DOWN, _spacer_down_cb, obj);
|
(priv->spacer, EVAS_CALLBACK_MOUSE_DOWN, _spacer_down_cb, obj);
|
||||||
evas_object_event_callback_add
|
evas_object_event_callback_add
|
||||||
|
@ -625,6 +771,8 @@ _elm_slider_smart_del(Evas_Object *obj)
|
||||||
if (sd->indicator) eina_stringshare_del(sd->indicator);
|
if (sd->indicator) eina_stringshare_del(sd->indicator);
|
||||||
if (sd->units) eina_stringshare_del(sd->units);
|
if (sd->units) eina_stringshare_del(sd->units);
|
||||||
if (sd->delay) ecore_timer_del(sd->delay);
|
if (sd->delay) ecore_timer_del(sd->delay);
|
||||||
|
|
||||||
|
if (sd->popup) evas_object_del(sd->popup);
|
||||||
|
|
||||||
ELM_WIDGET_CLASS(_elm_slider_parent_sc)->base.del(obj);
|
ELM_WIDGET_CLASS(_elm_slider_parent_sc)->base.del(obj);
|
||||||
}
|
}
|
||||||
|
@ -688,9 +836,17 @@ elm_slider_span_size_set(Evas_Object *obj,
|
||||||
elm_config_scale_get());
|
elm_config_scale_get());
|
||||||
|
|
||||||
if (sd->indicator_show)
|
if (sd->indicator_show)
|
||||||
elm_layout_signal_emit(obj, "elm,state,val,show", "elm");
|
{
|
||||||
|
elm_layout_signal_emit(obj, "elm,state,val,show", "elm");
|
||||||
|
if (sd->popup)
|
||||||
|
edje_object_signal_emit(sd->popup, "elm,state,val,show", "elm");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
elm_layout_signal_emit(obj, "elm,state,val,hide", "elm");
|
{
|
||||||
|
elm_layout_signal_emit(obj, "elm,state,val,hide", "elm");
|
||||||
|
if (sd->popup)
|
||||||
|
edje_object_signal_emit(sd->popup, "elm,state,val,hide", "elm");
|
||||||
|
}
|
||||||
|
|
||||||
elm_layout_sizing_eval(obj);
|
elm_layout_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
|
@ -716,11 +872,15 @@ elm_slider_unit_format_set(Evas_Object *obj,
|
||||||
{
|
{
|
||||||
elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
|
elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
|
||||||
edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
|
edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
|
||||||
|
if (sd->popup)
|
||||||
|
edje_object_signal_emit(sd->popup, "elm,state,units,visible", "elm");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
elm_layout_signal_emit(obj, "elm,state,units,hidden", "elm");
|
elm_layout_signal_emit(obj, "elm,state,units,hidden", "elm");
|
||||||
edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
|
edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
|
||||||
|
if (sd->popup)
|
||||||
|
edje_object_signal_emit(sd->popup, "elm,state,units,hidden", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
_min_max_set(obj);
|
_min_max_set(obj);
|
||||||
|
@ -852,9 +1012,17 @@ elm_slider_inverted_set(Evas_Object *obj,
|
||||||
sd->inverted = inverted;
|
sd->inverted = inverted;
|
||||||
|
|
||||||
if (sd->inverted)
|
if (sd->inverted)
|
||||||
elm_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
|
{
|
||||||
|
elm_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
|
||||||
|
if (sd->popup)
|
||||||
|
edje_object_signal_emit(sd->popup, "elm,state,inverted,on", "elm");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
elm_layout_signal_emit(obj, "elm,state,inverted,off", "elm");
|
{
|
||||||
|
elm_layout_signal_emit(obj, "elm,state,inverted,off", "elm");
|
||||||
|
if (sd->popup)
|
||||||
|
edje_object_signal_emit(sd->popup, "elm,state,inverted,off", "elm");
|
||||||
|
}
|
||||||
|
|
||||||
edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
|
edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
|
||||||
|
|
||||||
|
@ -909,10 +1077,14 @@ elm_slider_indicator_show_set(Evas_Object *obj,
|
||||||
{
|
{
|
||||||
sd->indicator_show = EINA_TRUE;
|
sd->indicator_show = EINA_TRUE;
|
||||||
elm_layout_signal_emit(obj, "elm,state,val,show", "elm");
|
elm_layout_signal_emit(obj, "elm,state,val,show", "elm");
|
||||||
|
if (sd->popup)
|
||||||
|
edje_object_signal_emit(sd->popup, "elm,state,val,show", "elm");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sd->indicator_show = EINA_FALSE;
|
sd->indicator_show = EINA_FALSE;
|
||||||
elm_layout_signal_emit(obj, "elm,state,val,hide", "elm");
|
elm_layout_signal_emit(obj, "elm,state,val,hide", "elm");
|
||||||
|
if (sd->popup)
|
||||||
|
edje_object_signal_emit(sd->popup, "elm,state,val,hide", "elm");
|
||||||
}
|
}
|
||||||
|
|
||||||
elm_layout_sizing_eval(obj);
|
elm_layout_sizing_eval(obj);
|
||||||
|
|
Loading…
Reference in New Issue