Adjusted the example for backgrounds. Nope brushes isn't gonna work; absolute positioning of gradients is a problem.

This commit is contained in:
Pietro Gagliardi 2017-02-13 01:44:18 -05:00
parent 40c388e01d
commit 9eba197fd1
3 changed files with 16 additions and 0 deletions

View File

@ -296,6 +296,7 @@ static int specsIdentical(struct attr *attr, uiAttributeSpec *spec)
// TODO use a closest match? // TODO use a closest match?
return attr->spec.Double == spec->Double; return attr->spec.Double == spec->Double;
case uiAttributeColor: case uiAttributeColor:
case uiAttributeBackground:
// TODO use a closest match? // TODO use a closest match?
return attr->spec.R == spec->R && return attr->spec.R == spec->R &&
attr->spec.G == spec->G && attr->spec.G == spec->G &&

View File

@ -76,6 +76,20 @@ static void setupAttributedString(void)
uiAttributedStringAppendUnattributed(attrstr, ", "); uiAttributedStringAppendUnattributed(attrstr, ", ");
next = "multiple backgrounds";
start = uiAttributedStringLen(attrstr);
end = start + strlen(next);
uiAttributedStringAppendUnattributed(attrstr, next);
spec.Type = uiAttributeBackground;
// Direct2D "Peach Puff" (#FFDAB9)
spec.R = 1.0;
spec.G = 0.85490196078431372;
spec.B = 0.7254901960784313;
spec.A = 0.5;
uiAttributedStringSetAttribute(attrstr, &spec, start, end);
uiAttributedStringAppendUnattributed(attrstr, ", ");
next = "multiple TODO"; next = "multiple TODO";
} }

View File

@ -8,6 +8,7 @@ _UI_ENUM(uiAttribute) {
uiAttributeItalic, uiAttributeItalic,
uiAttributeStretch, uiAttributeStretch,
uiAttributeColor, // use R, G, B, A uiAttributeColor, // use R, G, B, A
uiAttributeBackground, // use R, G, B, A
// TODO // TODO
// TODO uiAttributeSystem, // TODO uiAttributeSystem,
// TODO uiAttributeCustom, // TODO uiAttributeCustom,