aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichaël Bouchaud (yoz) <yoz@efl.so>2016-09-02 01:58:27 +0200
committerMichaël Bouchaud (yoz) <yoz@efl.so>2016-09-02 02:13:19 +0200
commita9a9240421e9f99f3f7a6d0ac45bea875c070e5d (patch)
tree3f5faee68ac02b3b4aa26d4474ceb1239d1d8796
parentElm: Dont insert errors by default in code (diff)
downloadefl-a9a9240421e9f99f3f7a6d0ac45bea875c070e5d.tar.gz
elementary: Introduce a new edje_external param to the progressbar widget.
This widget was lacking an edje_external param to notify the widget to start or stop pulsing from edje. @fix Now the edje_external progressbar test works as expected.
-rw-r--r--data/elementary/objects/test_external.edc30
-rw-r--r--src/edje_external/elementary/elm_progressbar.c28
-rw-r--r--src/lib/elementary/elm_progressbar.c6
-rw-r--r--src/lib/elementary/elm_progressbar.eo5
4 files changed, 68 insertions, 1 deletions
diff --git a/data/elementary/objects/test_external.edc b/data/elementary/objects/test_external.edc
index 3a77ef06a1..f2b7a3b7aa 100644
--- a/data/elementary/objects/test_external.edc
+++ b/data/elementary/objects/test_external.edc
@@ -735,6 +735,18 @@ embryo script and from C code.";
}
program { name: "disable_button3";
action: PARAM_SET "ext_button3" "disabled" 1;
+ after: "start_pulsing1";
+ }
+ program { name: "start_pulsing1";
+ action: PARAM_SET "ext_pbar2" "pulsing" 1;
+ after: "start_pulsing2";
+ }
+ program { name: "start_pulsing2";
+ action: PARAM_SET "ext_pbar5" "pulsing" 1;
+ after: "start_pulsing3";
+ }
+ program { name: "start_pulsing3";
+ action: PARAM_SET "ext_pbar7" "pulsing" 1;
after: "anim_0";
}
program { name: "anim_0";
@@ -801,6 +813,18 @@ embryo script and from C code.";
}
program { name: "reenable_button3";
action: PARAM_SET "ext_button3" "disabled" 0;
+ after: "stop_pulsing1";
+ }
+ program { name: "stop_pulsing1";
+ action: PARAM_SET "ext_pbar2" "pulsing" 0;
+ after: "stop_pulsing2";
+ }
+ program { name: "stop_pulsing2";
+ action: PARAM_SET "ext_pbar5" "pulsing" 0;
+ after: "stop_pulsing3";
+ }
+ program { name: "stop_pulsing3";
+ action: PARAM_SET "ext_pbar7" "pulsing" 0;
}
script {
public my_value;
@@ -819,6 +843,9 @@ embryo script and from C code.";
external_param_set_bool(PART:"ext_button1", "disabled", 0);
external_param_set_bool(PART:"ext_button2", "disabled", 0);
external_param_set_bool(PART:"ext_button3", "disabled", 0);
+ external_param_set_bool(PART:"ext_pbar2", "pulsing", 0);
+ external_param_set_bool(PART:"ext_pbar5", "pulsing", 0);
+ external_param_set_bool(PART:"ext_pbar7", "pulsing", 0);
}
}
}
@@ -830,6 +857,9 @@ embryo script and from C code.";
external_param_set_bool(PART:"ext_button1", "disabled", 1);
external_param_set_bool(PART:"ext_button2", "disabled", 1);
external_param_set_bool(PART:"ext_button3", "disabled", 1);
+ external_param_set_bool(PART:"ext_pbar2", "pulsing", 1);
+ external_param_set_bool(PART:"ext_pbar5", "pulsing", 1);
+ external_param_set_bool(PART:"ext_pbar7", "pulsing", 1);
timer_cb(0);
}
}
diff --git a/src/edje_external/elementary/elm_progressbar.c b/src/edje_external/elementary/elm_progressbar.c
index d044a6adab..28148b5a20 100644
--- a/src/edje_external/elementary/elm_progressbar.c
+++ b/src/edje_external/elementary/elm_progressbar.c
@@ -16,6 +16,8 @@ typedef struct _Elm_Params_Progressbar
Eina_Bool horizontal_exists:1;
Eina_Bool pulse:1;
Eina_Bool pulse_exists:1;
+ Eina_Bool pulsing:1;
+ Eina_Bool pulsing_exists:1;
} Elm_Params_Progressbar;
static void
@@ -45,6 +47,8 @@ external_progressbar_state_set(void *data EINA_UNUSED, Evas_Object *obj,
elm_progressbar_unit_format_set(obj, p->unit);
if (p->pulse_exists)
elm_progressbar_pulse_set(obj, p->pulse);
+ if (p->pulsing_exists)
+ elm_progressbar_pulse(obj, p->pulsing);
}
static Eina_Bool
@@ -85,7 +89,7 @@ external_progressbar_param_set(void *data EINA_UNUSED, Evas_Object *obj,
return EINA_TRUE;
}
}
- else if (!strcmp(param->name, "pulse"))
+ else if (!strcmp(param->name, "pulse"))
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
{
@@ -93,6 +97,14 @@ external_progressbar_param_set(void *data EINA_UNUSED, Evas_Object *obj,
return EINA_TRUE;
}
}
+ else if (!strcmp(param->name, "pulsing"))
+ {
+ if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
+ {
+ elm_progressbar_pulse(obj, param->i);
+ return EINA_TRUE;
+ }
+ }
else if (!strcmp(param->name, "inverted"))
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
@@ -165,6 +177,14 @@ external_progressbar_param_get(void *data EINA_UNUSED, const Evas_Object *obj,
return EINA_TRUE;
}
}
+ else if (!strcmp(param->name, "pulsing"))
+ {
+ if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
+ {
+ param->i = elm_progressbar_is_pulsing_get(obj);
+ return EINA_TRUE;
+ }
+ }
else if (!strcmp(param->name, "inverted"))
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
@@ -238,6 +258,11 @@ external_progressbar_params_parse(void *data EINA_UNUSED,
mem->pulse = !!param->i;
mem->pulse_exists = EINA_TRUE;
}
+ else if (!strcmp(param->name, "pulsing"))
+ {
+ mem->pulsing = !!param->i;
+ mem->pulsing_exists = EINA_TRUE;
+ }
else if (!strcmp(param->name, "unit format"))
mem->unit = eina_stringshare_add(param->s);
else if (!strcmp(param->name, "label"))
@@ -274,6 +299,7 @@ static Edje_External_Param_Info external_progressbar_params[] = {
EDJE_EXTERNAL_PARAM_INFO_DOUBLE("value"),
EDJE_EXTERNAL_PARAM_INFO_BOOL("horizontal"),
EDJE_EXTERNAL_PARAM_INFO_BOOL("pulse"),
+ EDJE_EXTERNAL_PARAM_INFO_BOOL("pulsing"),
EDJE_EXTERNAL_PARAM_INFO_BOOL("inverted"),
EDJE_EXTERNAL_PARAM_INFO_INT("span"),
EDJE_EXTERNAL_PARAM_INFO_STRING_DEFAULT("unit format", "%1.2f"),
diff --git a/src/lib/elementary/elm_progressbar.c b/src/lib/elementary/elm_progressbar.c
index 994c9f3168..e8d4beaf89 100644
--- a/src/lib/elementary/elm_progressbar.c
+++ b/src/lib/elementary/elm_progressbar.c
@@ -477,6 +477,12 @@ _elm_progressbar_pulse(Eo *obj, Elm_Progressbar_Data *sd, Eina_Bool state)
elm_layout_signal_emit(obj, "elm,state,pulse,stop", "elm");
}
+EOLIAN static Eina_Bool
+_elm_progressbar_is_pulsing_get(const Eo *obj EINA_UNUSED, Elm_Progressbar_Data *sd)
+{
+ return (sd->pulse_state && sd->pulse);
+}
+
EOLIAN static void
_elm_progressbar_part_value_set(Eo *obj EINA_UNUSED, Elm_Progressbar_Data *sd, const char *part_name, double val)
{
diff --git a/src/lib/elementary/elm_progressbar.eo b/src/lib/elementary/elm_progressbar.eo
index b7d935e2a8..885d82607b 100644
--- a/src/lib/elementary/elm_progressbar.eo
+++ b/src/lib/elementary/elm_progressbar.eo
@@ -53,6 +53,11 @@ class Elm.Progressbar (Elm.Layout, Efl.Ui.Progress,
@in state: bool; [[$true, to start the pulsing animation, $false to stop it]]
}
}
+ is_pulsing_get @const {
+ [[Get the pulsing state on a given progressbar widget. ]]
+
+ return: bool; [[$true if the $obj is currently pulsing ]]
+ }
}
implements {
class.constructor;