efl_ui_progressbar: remove pulse_mode

Summary:
pulse_mode is now implicit with pulse, if you set the progressbar to
pulse, the state is internally adjusted in a way that the theme is put
into the correct state. Legacy is not impacted by this because of the
previous commit.

ref T8501
Depends on D10941

Reviewers: cedric, woohyun, zmike, segfaultxavi

Reviewed By: zmike, segfaultxavi

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8501

Differential Revision: https://phab.enlightenment.org/D10942
This commit is contained in:
Marcel Hollerbach 2019-12-30 11:08:47 -05:00 committed by Mike Blumenkrantz
parent 8fefb6f099
commit 25731f84da
3 changed files with 19 additions and 48 deletions

View File

@ -96,7 +96,6 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
pb = efl_add(EFL_UI_PROGRESSBAR_CLASS, win);
efl_gfx_hint_weight_set(pb, EFL_GFX_HINT_EXPAND, 0);
efl_ui_progressbar_pulse_mode_set(pb, EINA_TRUE);
efl_pack(bx, pb);
td->pb1 = pb;
@ -122,7 +121,6 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
efl_unref(shadow);
pb = efl_add(EFL_UI_PROGRESSBAR_CLASS, win);
efl_ui_progressbar_pulse_mode_set(pb, EINA_TRUE);
efl_gfx_hint_weight_set(pb, EFL_GFX_HINT_EXPAND, 0);
efl_pack(bx, pb);
td->pb4 = pb;
@ -150,7 +148,6 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
// FIXME: Needs wheel progressbar class
pb = efl_add(EFL_UI_PROGRESSBAR_CLASS, win,
efl_ui_widget_style_set(efl_added, "wheel"));
efl_ui_progressbar_pulse_mode_set(pb, EINA_TRUE);
efl_pack(hbx, pb);
td->pb2 = pb;
@ -163,7 +160,6 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
pb = efl_add(EFL_UI_PROGRESSBAR_CLASS, win,
efl_ui_widget_style_set(efl_added, "wheel"));
efl_ui_progressbar_pulse_mode_set(pb, EINA_TRUE);
efl_pack(hbx, pb);
td->pb3 = pb;

View File

@ -406,23 +406,6 @@ _efl_ui_progressbar_efl_object_constructor(Eo *obj, Efl_Ui_Progressbar_Data *_pd
return obj;
}
EOLIAN static void
_efl_ui_progressbar_pulse_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd, Eina_Bool pulse)
{
pulse = !!pulse;
if (sd->pulse == pulse) return;
sd->pulse = pulse;
efl_ui_widget_theme_apply(obj);
}
EOLIAN static Eina_Bool
_efl_ui_progressbar_pulse_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd)
{
return sd->pulse;
}
EOLIAN static void
_efl_ui_progressbar_efl_ui_layout_orientable_orientation_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Efl_Ui_Layout_Orientation dir)
{
@ -513,6 +496,18 @@ _progress_part_min_max_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *par
_val_set(obj);
}
static void
_internal_theme_mode_pulse_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Eina_Bool pulse)
{
if (elm_widget_is_legacy(obj))
return;
if (sd->pulse == pulse)
return;
sd->pulse = pulse;
efl_ui_widget_theme_apply(obj);
}
static void
_progressbar_part_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *part_name, double val)
{
@ -527,6 +522,8 @@ _progressbar_part_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *pa
};
Eina_Bool is_cur_progressbar = !strcmp(part_name, curprogresspart[elm_widget_is_legacy(obj)]);
_internal_theme_mode_pulse_set(obj, sd, EINA_FALSE);
if ((!is_cur_progressbar) || sd->has_cur_progressbar_part)
efl_ui_range_limits_get(efl_part(obj, part_name), &min, &max);
@ -634,10 +631,13 @@ EOLIAN static void
_efl_ui_progressbar_pulse_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Eina_Bool state)
{
state = !!state;
if ((!sd->pulse) || (sd->pulse_state == state)) return;
if (sd->pulse_state == state)
return;
sd->pulse_state = state;
_internal_theme_mode_pulse_set(obj, sd, EINA_TRUE);
_apply_pulse_state(obj, sd);
}

View File

@ -4,33 +4,8 @@ class @beta Efl.Ui.Progressbar extends Efl.Ui.Layout_Base implements Efl.Ui.Rang
{
[[Elementary progressbar class]]
methods {
@property pulse_mode {
[[Control whether a given progress bar widget is at "pulsing mode" or not.
By default progress bars display values from low to
high boundaries. There are situations however in which the
progress of a given task is unknown. In these cases,
you can set a progress bar widget to a "pulsing state" to give
the user an idea that some computation is being done
without showing the precise progress rate. In the default theme, it will
animate the bar with content, switching constantly between filling it and back
to non-filled in a loop. To start and stop this pulsing
animation you need to explicitly call @.pulse.set().
]]
set {
}
get {
}
values {
pulse: bool; [[$true to put $obj in pulsing mode, $false to put it back to its default one]]
}
}
@property pulse {
[[Start/stop a given progress bar "pulsing" animation, if its under that mode.
Note: This call won't do anything if $obj is not under "pulsing mode". See @.pulse_mode.
]]
[[Start/stop a given progress bar "pulsing" animation, if its under that mode.]]
set {
}
get {