diff --git a/src/dlangui/graphics/resources.d b/src/dlangui/graphics/resources.d index 30713bd3..6ea86c86 100644 --- a/src/dlangui/graphics/resources.d +++ b/src/dlangui/graphics/resources.d @@ -1136,8 +1136,11 @@ class CombinedDrawable : Drawable { DrawableRef background; Drawable border; - this(string backgroundImageId, string borderDescription) { - background = backgroundImageId !is null ? drawableCache.get(backgroundImageId) : new EmptyDrawable; + this(uint backgroundColor, string backgroundImageId, string borderDescription) { + background = + (backgroundImageId !is null) ? drawableCache.get(backgroundImageId) : + (!backgroundColor.isFullyTransparentColor) ? new SolidFillDrawable(backgroundColor) : + new EmptyDrawable; border = borderDescription !is null ? createColorDrawable(borderDescription) : new EmptyDrawable; } diff --git a/src/dlangui/widgets/styles.d b/src/dlangui/widgets/styles.d index a96bf9f0..31e1af9c 100644 --- a/src/dlangui/widgets/styles.d +++ b/src/dlangui/widgets/styles.d @@ -412,12 +412,12 @@ public: if (!(cast(Style)this)._backgroundDrawable.isNull) return (cast(Style)this)._backgroundDrawable; string image = backgroundImageId; + uint color = backgroundColor; 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) { (cast(Style)this)._backgroundDrawable = drawableCache.get(image); } else { - uint color = backgroundColor; (cast(Style)this)._backgroundDrawable = isFullyTransparentColor(color) ? new EmptyDrawable() : new SolidFillDrawable(color); } return (cast(Style)this)._backgroundDrawable;