mirror of https://github.com/buggins/dlangui.git
CombinedDrawable - work with solid fill background too
This commit is contained in:
parent
e8f11036c9
commit
8a5152c5c2
|
@ -1136,8 +1136,11 @@ class CombinedDrawable : Drawable {
|
||||||
DrawableRef background;
|
DrawableRef background;
|
||||||
Drawable border;
|
Drawable border;
|
||||||
|
|
||||||
this(string backgroundImageId, string borderDescription) {
|
this(uint backgroundColor, string backgroundImageId, string borderDescription) {
|
||||||
background = backgroundImageId !is null ? drawableCache.get(backgroundImageId) : new EmptyDrawable;
|
background =
|
||||||
|
(backgroundImageId !is null) ? drawableCache.get(backgroundImageId) :
|
||||||
|
(!backgroundColor.isFullyTransparentColor) ? new SolidFillDrawable(backgroundColor) :
|
||||||
|
new EmptyDrawable;
|
||||||
border = borderDescription !is null ? createColorDrawable(borderDescription) : new EmptyDrawable;
|
border = borderDescription !is null ? createColorDrawable(borderDescription) : new EmptyDrawable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -412,12 +412,12 @@ public:
|
||||||
if (!(cast(Style)this)._backgroundDrawable.isNull)
|
if (!(cast(Style)this)._backgroundDrawable.isNull)
|
||||||
return (cast(Style)this)._backgroundDrawable;
|
return (cast(Style)this)._backgroundDrawable;
|
||||||
string image = backgroundImageId;
|
string image = backgroundImageId;
|
||||||
|
uint color = backgroundColor;
|
||||||
if (border !is null) {
|
if (border !is null) {
|
||||||
(cast(Style)this)._backgroundDrawable = new CombinedDrawable(image, border);
|
(cast(Style)this)._backgroundDrawable = new CombinedDrawable(color, image, border);
|
||||||
} else if (image !is null) {
|
} else if (image !is null) {
|
||||||
(cast(Style)this)._backgroundDrawable = drawableCache.get(image);
|
(cast(Style)this)._backgroundDrawable = drawableCache.get(image);
|
||||||
} else {
|
} else {
|
||||||
uint color = backgroundColor;
|
|
||||||
(cast(Style)this)._backgroundDrawable = isFullyTransparentColor(color) ? new EmptyDrawable() : new SolidFillDrawable(color);
|
(cast(Style)this)._backgroundDrawable = isFullyTransparentColor(color) ? new EmptyDrawable() : new SolidFillDrawable(color);
|
||||||
}
|
}
|
||||||
return (cast(Style)this)._backgroundDrawable;
|
return (cast(Style)this)._backgroundDrawable;
|
||||||
|
|
Loading…
Reference in New Issue