color class: ensure operations work
This commit is contained in:
parent
11abaaa0b4
commit
7881e66b98
|
@ -538,16 +538,24 @@ color_scheme_apply(Evas_Object *edje,
|
||||||
EINA_SAFETY_ON_NULL_RETURN(cs);
|
EINA_SAFETY_ON_NULL_RETURN(cs);
|
||||||
|
|
||||||
#define CS_SET(_K, _F) do {\
|
#define CS_SET(_K, _F) do {\
|
||||||
edje_object_color_class_set(edje, _K, \
|
if (edje_object_color_class_set(edje, _K, \
|
||||||
cs->_F.r, cs->_F.g, cs->_F.b, cs->_F.a, \
|
cs->_F.r, cs->_F.g, cs->_F.b, cs->_F.a, \
|
||||||
cs->_F.r, cs->_F.g, cs->_F.b, cs->_F.a, \
|
cs->_F.r, cs->_F.g, cs->_F.b, cs->_F.a, \
|
||||||
cs->_F.r, cs->_F.g, cs->_F.b, cs->_F.a); \
|
cs->_F.r, cs->_F.g, cs->_F.b, cs->_F.a) \
|
||||||
|
!= EINA_TRUE) \
|
||||||
|
{ \
|
||||||
|
ERR("error setting color class '%s' on object %p", _K, edje); \
|
||||||
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define CS_SET_MANY(_K, _F1, _F2, _F3) do {\
|
#define CS_SET_MANY(_K, _F1, _F2, _F3) do { \
|
||||||
edje_object_color_class_set(edje, _K, \
|
if (edje_object_color_class_set(edje, _K, \
|
||||||
cs->_F1.r, cs->_F1.g, cs->_F1.b, cs->_F1.a, \
|
cs->_F1.r, cs->_F1.g, cs->_F1.b, cs->_F1.a, \
|
||||||
cs->_F2.r, cs->_F2.g, cs->_F2.b, cs->_F2.a, \
|
cs->_F2.r, cs->_F2.g, cs->_F2.b, cs->_F2.a, \
|
||||||
cs->_F3.r, cs->_F3.g, cs->_F3.b, cs->_F3.a); \
|
cs->_F3.r, cs->_F3.g, cs->_F3.b, cs->_F3.a) \
|
||||||
|
!= EINA_TRUE) \
|
||||||
|
{ \
|
||||||
|
ERR("error setting color class '%s' on object %p", _K, edje); \
|
||||||
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
CS_SET("BG", bg);
|
CS_SET("BG", bg);
|
||||||
|
|
|
@ -4175,9 +4175,9 @@ _handle_xterm_set_color_class(Termpty *ty, Eina_Unicode *p, int len,
|
||||||
|
|
||||||
if (edje_object_color_class_get(obj, color_class, &r, &g, &b, NULL,
|
if (edje_object_color_class_get(obj, color_class, &r, &g, &b, NULL,
|
||||||
NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, NULL,
|
||||||
NULL, NULL, NULL, NULL) != 0)
|
NULL, NULL, NULL, NULL) != EINA_TRUE)
|
||||||
{
|
{
|
||||||
ERR("error getting color class '%s'", color_class);
|
ERR("error getting color class '%s' on obj %p", color_class, obj);
|
||||||
}
|
}
|
||||||
l = snprintf(buf, sizeof(buf),
|
l = snprintf(buf, sizeof(buf),
|
||||||
"\033]%d;rgb:%.2x%.2x/%.2x%.2x/%.2x%.2x\007",
|
"\033]%d;rgb:%.2x%.2x/%.2x%.2x/%.2x%.2x\007",
|
||||||
|
@ -4189,10 +4189,13 @@ _handle_xterm_set_color_class(Termpty *ty, Eina_Unicode *p, int len,
|
||||||
unsigned char r, g, b;
|
unsigned char r, g, b;
|
||||||
if (_xterm_parse_color(ty, &p, &r, &g, &b, len) < 0)
|
if (_xterm_parse_color(ty, &p, &r, &g, &b, len) < 0)
|
||||||
goto err;
|
goto err;
|
||||||
edje_object_color_class_set(obj, color_class,
|
if (edje_object_color_class_set(obj, color_class,
|
||||||
r, g, b, 0xff,
|
r, g, b, 0xff,
|
||||||
r, g, b, 0xff,
|
r, g, b, 0xff,
|
||||||
r, g, b, 0xff);
|
r, g, b, 0xff) != EINA_TRUE)
|
||||||
|
{
|
||||||
|
ERR("error setting color class '%s' on obj %p", color_class, obj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue