raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2b91c4d9b8c1990d434541a6a5717891f3e3d9c9

commit 2b91c4d9b8c1990d434541a6a5717891f3e3d9c9
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Thu May 6 13:06:23 2021 +0100

    edje - add new color class apply func to force cc to apply now
---
 src/lib/edje/Edje_Common.h | 10 ++++++++++
 src/lib/edje/edje_util.c   | 16 ++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/src/lib/edje/Edje_Common.h b/src/lib/edje/Edje_Common.h
index 5e486fe2de..c94a2ff9ac 100644
--- a/src/lib/edje/Edje_Common.h
+++ b/src/lib/edje/Edje_Common.h
@@ -1452,6 +1452,16 @@ EAPI void edje_password_show_last_timeout_set(double 
password_show_last_timeout)
  */
 EAPI Eina_Bool    edje_color_class_set            (const char *color_class, 
int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int 
b3, int a3);
 
+/**
+ * @brief Applies changes mad when setting Edje color classes.
+ *
+ * This forces all changes to color classes made by (for example)
+ * edje_color_class_set() to actually take effect.
+ * 
+ * @since 1.26
+ */
+EAPI void         edje_color_class_apply          (void);
+
 /**
  * @brief Gets Edje color class.
  *
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index 16171b6c41..625898947d 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -712,6 +712,22 @@ edje_color_class_set(const char *color_class, int r, int 
g, int b, int a, int r2
    return result;
 }
 
+EAPI void
+edje_color_class_apply(void)
+{
+   Edje *ed;
+
+   EINA_INLIST_FOREACH(_edje_edjes, ed)
+     {
+        ed->dirty = EINA_TRUE;
+        ed->recalc_call = EINA_TRUE;
+#ifdef EDJE_CALC_CACHE
+        ed->all_part_change = EINA_TRUE;
+#endif
+        _edje_recalc(ed);
+     }
+}
+
 EOLIAN Eina_Bool
 _edje_global_efl_gfx_color_class_color_class_set(Eo *obj EINA_UNUSED, void *pd 
EINA_UNUSED,
                                                  const char *color_class, 
Efl_Gfx_Color_Class_Layer layer, int r, int g, int b, int a)

-- 


Reply via email to