diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-12-20 14:33:23 +0100 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-12-20 14:34:53 +0100 |
commit | 2d0564e3477f9caca736deb187fb54dbcf33b900 (patch) | |
tree | 5f034dfa2ad3b833e72d34440697a50f1a4468a7 | |
parent | 9fa6013b8871ae79c4f34047c4dd82c5d607e9f9 (diff) |
efl_ui_progressbar: remove pulse_modedevs/bu5hm4n/work_progressbar
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
-rw-r--r-- | src/bin/elementary/test_part_shadow.c | 4 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_progressbar.c | 36 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_progressbar.eo | 27 |
3 files changed, 19 insertions, 48 deletions
diff --git a/src/bin/elementary/test_part_shadow.c b/src/bin/elementary/test_part_shadow.c index c8e0f18591..dd6f388bdb 100644 --- a/src/bin/elementary/test_part_shadow.c +++ b/src/bin/elementary/test_part_shadow.c | |||
@@ -96,7 +96,6 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve | |||
96 | 96 | ||
97 | pb = efl_add(EFL_UI_PROGRESSBAR_CLASS, win); | 97 | pb = efl_add(EFL_UI_PROGRESSBAR_CLASS, win); |
98 | efl_gfx_hint_weight_set(pb, EFL_GFX_HINT_EXPAND, 0); | 98 | efl_gfx_hint_weight_set(pb, EFL_GFX_HINT_EXPAND, 0); |
99 | efl_ui_progressbar_pulse_mode_set(pb, EINA_TRUE); | ||
100 | efl_pack(bx, pb); | 99 | efl_pack(bx, pb); |
101 | td->pb1 = pb; | 100 | td->pb1 = pb; |
102 | 101 | ||
@@ -122,7 +121,6 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve | |||
122 | efl_unref(shadow); | 121 | efl_unref(shadow); |
123 | 122 | ||
124 | pb = efl_add(EFL_UI_PROGRESSBAR_CLASS, win); | 123 | pb = efl_add(EFL_UI_PROGRESSBAR_CLASS, win); |
125 | efl_ui_progressbar_pulse_mode_set(pb, EINA_TRUE); | ||
126 | efl_gfx_hint_weight_set(pb, EFL_GFX_HINT_EXPAND, 0); | 124 | efl_gfx_hint_weight_set(pb, EFL_GFX_HINT_EXPAND, 0); |
127 | efl_pack(bx, pb); | 125 | efl_pack(bx, pb); |
128 | td->pb4 = pb; | 126 | td->pb4 = pb; |
@@ -150,7 +148,6 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve | |||
150 | // FIXME: Needs wheel progressbar class | 148 | // FIXME: Needs wheel progressbar class |
151 | pb = efl_add(EFL_UI_PROGRESSBAR_CLASS, win, | 149 | pb = efl_add(EFL_UI_PROGRESSBAR_CLASS, win, |
152 | efl_ui_widget_style_set(efl_added, "wheel")); | 150 | efl_ui_widget_style_set(efl_added, "wheel")); |
153 | efl_ui_progressbar_pulse_mode_set(pb, EINA_TRUE); | ||
154 | efl_pack(hbx, pb); | 151 | efl_pack(hbx, pb); |
155 | td->pb2 = pb; | 152 | td->pb2 = pb; |
156 | 153 | ||
@@ -163,7 +160,6 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve | |||
163 | 160 | ||
164 | pb = efl_add(EFL_UI_PROGRESSBAR_CLASS, win, | 161 | pb = efl_add(EFL_UI_PROGRESSBAR_CLASS, win, |
165 | efl_ui_widget_style_set(efl_added, "wheel")); | 162 | efl_ui_widget_style_set(efl_added, "wheel")); |
166 | efl_ui_progressbar_pulse_mode_set(pb, EINA_TRUE); | ||
167 | efl_pack(hbx, pb); | 163 | efl_pack(hbx, pb); |
168 | td->pb3 = pb; | 164 | td->pb3 = pb; |
169 | 165 | ||
diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c index 77b7eb428d..4d186aedff 100644 --- a/src/lib/elementary/efl_ui_progressbar.c +++ b/src/lib/elementary/efl_ui_progressbar.c | |||
@@ -407,23 +407,6 @@ _efl_ui_progressbar_efl_object_constructor(Eo *obj, Efl_Ui_Progressbar_Data *_pd | |||
407 | } | 407 | } |
408 | 408 | ||
409 | EOLIAN static void | 409 | EOLIAN static void |
410 | _efl_ui_progressbar_pulse_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd, Eina_Bool pulse) | ||
411 | { | ||
412 | pulse = !!pulse; | ||
413 | if (sd->pulse == pulse) return; | ||
414 | |||
415 | sd->pulse = pulse; | ||
416 | |||
417 | efl_ui_widget_theme_apply(obj); | ||
418 | } | ||
419 | |||
420 | EOLIAN static Eina_Bool | ||
421 | _efl_ui_progressbar_pulse_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Progressbar_Data *sd) | ||
422 | { | ||
423 | return sd->pulse; | ||
424 | } | ||
425 | |||
426 | EOLIAN static void | ||
427 | _efl_ui_progressbar_efl_ui_layout_orientable_orientation_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Efl_Ui_Layout_Orientation dir) | 410 | _efl_ui_progressbar_efl_ui_layout_orientable_orientation_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Efl_Ui_Layout_Orientation dir) |
428 | { | 411 | { |
429 | if (sd->dir == dir) return; | 412 | if (sd->dir == dir) return; |
@@ -514,6 +497,18 @@ _progress_part_min_max_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *par | |||
514 | } | 497 | } |
515 | 498 | ||
516 | static void | 499 | static void |
500 | _internal_theme_mode_pulse_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Eina_Bool pulse) | ||
501 | { | ||
502 | if (elm_widget_is_legacy(obj)) | ||
503 | return; | ||
504 | if (sd->pulse == pulse) | ||
505 | return; | ||
506 | sd->pulse = pulse; | ||
507 | efl_ui_widget_theme_apply(obj); | ||
508 | } | ||
509 | |||
510 | |||
511 | static void | ||
517 | _progressbar_part_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *part_name, double val) | 512 | _progressbar_part_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *part_name, double val) |
518 | { | 513 | { |
519 | Efl_Ui_Progress_Status *ps; | 514 | Efl_Ui_Progress_Status *ps; |
@@ -527,6 +522,8 @@ _progressbar_part_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *pa | |||
527 | }; | 522 | }; |
528 | Eina_Bool is_cur_progressbar = !strcmp(part_name, curprogresspart[elm_widget_is_legacy(obj)]); | 523 | Eina_Bool is_cur_progressbar = !strcmp(part_name, curprogresspart[elm_widget_is_legacy(obj)]); |
529 | 524 | ||
525 | _internal_theme_mode_pulse_set(obj, sd, EINA_FALSE); | ||
526 | |||
530 | if ((!is_cur_progressbar) || sd->has_cur_progressbar_part) | 527 | if ((!is_cur_progressbar) || sd->has_cur_progressbar_part) |
531 | efl_ui_range_limits_get(efl_part(obj, part_name), &min, &max); | 528 | efl_ui_range_limits_get(efl_part(obj, part_name), &min, &max); |
532 | 529 | ||
@@ -633,10 +630,13 @@ EOLIAN static void | |||
633 | _efl_ui_progressbar_pulse_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Eina_Bool state) | 630 | _efl_ui_progressbar_pulse_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Eina_Bool state) |
634 | { | 631 | { |
635 | state = !!state; | 632 | state = !!state; |
636 | if ((!sd->pulse) || (sd->pulse_state == state)) return; | 633 | |
634 | if (sd->pulse_state == state) | ||
635 | return; | ||
637 | 636 | ||
638 | sd->pulse_state = state; | 637 | sd->pulse_state = state; |
639 | 638 | ||
639 | _internal_theme_mode_pulse_set(obj, sd, EINA_TRUE); | ||
640 | _apply_pulse_state(obj, sd); | 640 | _apply_pulse_state(obj, sd); |
641 | } | 641 | } |
642 | 642 | ||
diff --git a/src/lib/elementary/efl_ui_progressbar.eo b/src/lib/elementary/efl_ui_progressbar.eo index e2994a266f..7166d8ee44 100644 --- a/src/lib/elementary/efl_ui_progressbar.eo +++ b/src/lib/elementary/efl_ui_progressbar.eo | |||
@@ -4,33 +4,8 @@ class @beta Efl.Ui.Progressbar extends Efl.Ui.Layout_Base implements Efl.Ui.Rang | |||
4 | { | 4 | { |
5 | [[Elementary progressbar class]] | 5 | [[Elementary progressbar class]] |
6 | methods { | 6 | methods { |
7 | @property pulse_mode { | ||
8 | [[Control whether a given progress bar widget is at "pulsing mode" or not. | ||
9 | |||
10 | By default progress bars display values from low to | ||
11 | high boundaries. There are situations however in which the | ||
12 | progress of a given task is unknown. In these cases, | ||
13 | you can set a progress bar widget to a "pulsing state" to give | ||
14 | the user an idea that some computation is being done | ||
15 | without showing the precise progress rate. In the default theme, it will | ||
16 | animate the bar with content, switching constantly between filling it and back | ||
17 | to non-filled in a loop. To start and stop this pulsing | ||
18 | animation you need to explicitly call @.pulse.set(). | ||
19 | ]] | ||
20 | |||
21 | set { | ||
22 | } | ||
23 | get { | ||
24 | } | ||
25 | values { | ||
26 | pulse: bool; [[$true to put $obj in pulsing mode, $false to put it back to its default one]] | ||
27 | } | ||
28 | } | ||
29 | @property pulse { | 7 | @property pulse { |
30 | [[Start/stop a given progress bar "pulsing" animation, if its under that mode. | 8 | [[Start/stop a given progress bar "pulsing" animation, if its under that mode.]] |
31 | |||
32 | Note: This call won't do anything if $obj is not under "pulsing mode". See @.pulse_mode. | ||
33 | ]] | ||
34 | set { | 9 | set { |
35 | } | 10 | } |
36 | get { | 11 | get { |