This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository efl.
View the commit online.
commit 3a21da845d590654129927740dfa907bfa55adcb
Author: Cedric BAIL <[email protected]>
AuthorDate: Fri Oct 30 20:35:52 2026 -0600
elementary: a progress bar's value given while it is constructed is kept
range_value is a constructor of Efl.Ui.Progressbar, but a value set
inside efl_add() came out as 0. The setter clamped it to the limits of
the theme's progress part, and before the theme is loaded that part
does not exist, so the limits read as 0..0. It only worked when
something else had loaded the theme first, a text for instance.
The progress bar's own limits are known from its constructor on. The
setter now checks its value against those.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/lib/elementary/efl_ui_progressbar.c | 10 +++++++++-
src/tests/elementary/efl_ui_test_progressbar.c | 12 ++++++++++++
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c
index d43e06a895..cf04d79c9d 100644
--- a/src/lib/elementary/efl_ui_progressbar.c
+++ b/src/lib/elementary/efl_ui_progressbar.c
@@ -460,7 +460,15 @@ _progressbar_part_value_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, const char *pa
_internal_theme_mode_pulse_set(obj, sd, EINA_FALSE);
- if ((!is_cur_progressbar) || sd->has_cur_progressbar_part)
+ /* The progress bar's own limits are known before its theme is: a value
+ * given while it is constructed is checked against them, not against
+ * the 0..0 of a part the theme has not created yet. */
+ if (is_cur_progressbar)
+ {
+ min = sd->val_min;
+ max = sd->val_max;
+ }
+ else
efl_ui_range_limits_get(efl_part(obj, part_name), &min, &max);
if (val < min) val = min;
diff --git a/src/tests/elementary/efl_ui_test_progressbar.c b/src/tests/elementary/efl_ui_test_progressbar.c
index e40b90df88..e635461c23 100644
--- a/src/tests/elementary/efl_ui_test_progressbar.c
+++ b/src/tests/elementary/efl_ui_test_progressbar.c
@@ -31,9 +31,21 @@ EFL_START_TEST(pb_progress_label)
}
EFL_END_TEST
+/* Without a text, nothing loads the theme before the value is set. */
+EFL_START_TEST(pb_value_while_constructed)
+{
+ Eo *bar = efl_add(EFL_UI_PROGRESSBAR_CLASS, win,
+ efl_ui_range_limits_set(efl_added, 0.0, 100.0),
+ efl_ui_range_value_set(efl_added, 65.0));
+
+ ck_assert(EINA_DBL_EQ(efl_ui_range_value_get(bar), 65.0));
+}
+EFL_END_TEST
+
void efl_ui_test_progressbar(TCase *tc)
{
tcase_add_checked_fixture(tc, check_setup, NULL);
tcase_add_test(tc, pb_text);
tcase_add_test(tc, pb_progress_label);
+ tcase_add_test(tc, pb_value_while_constructed);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.