From 91fbca984ee056cfa9b561238ae362c429c41a9a Mon Sep 17 00:00:00 2001 From: Grim Maple Date: Sat, 8 Oct 2022 21:27:24 +0300 Subject: [PATCH] Switch to undead xml --- dub.json | 3 ++- src/dlangui/graphics/resources.d | 8 ++++---- src/dlangui/widgets/styles.d | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dub.json b/dub.json index c7fdde334..7da7bb25a 100644 --- a/dub.json +++ b/dub.json @@ -30,7 +30,8 @@ "excludedSourceFiles-windows": ["3rdparty/fontconfig/*"], "dependencies": { - "inilike": "~>1.2.1" + "inilike": "~>1.2.1", + "undead": "~>1.1.7" }, "subPackages": [ diff --git a/src/dlangui/graphics/resources.d b/src/dlangui/graphics/resources.d index 5854642ff..52fce0a17 100644 --- a/src/dlangui/graphics/resources.d +++ b/src/dlangui/graphics/resources.d @@ -101,7 +101,7 @@ import dlangui.graphics.colors; import dlangui.graphics.drawbuf; import std.file; import std.algorithm; -import std.xml; +import undead.xml; import std.conv; import std.string; import std.path; @@ -1222,8 +1222,8 @@ class CombinedDrawable : Drawable { this(uint backgroundColor, string backgroundImageId, string borderDescription, string boxShadowDescription) { boxShadow = boxShadowDescription !is null ? drawableCache.get("#box-shadow," ~ boxShadowDescription) : new EmptyDrawable; - background = - (backgroundImageId !is null) ? drawableCache.get(backgroundImageId) : + background = + (backgroundImageId !is null) ? drawableCache.get(backgroundImageId) : (!backgroundColor.isFullyTransparentColor) ? new SolidFillDrawable(backgroundColor) : null; if (background is null) background = new EmptyDrawable; @@ -1245,7 +1245,7 @@ class CombinedDrawable : Drawable { @property override int width() { return background.width + border.padding.left + border.padding.right; } @property override int height() { return background.height + border.padding.top + border.padding.bottom; } @property override Rect padding() { - return Rect(background.padding.left + border.padding.left, background.padding.top + border.padding.top, + return Rect(background.padding.left + border.padding.left, background.padding.top + border.padding.top, background.padding.right + border.padding.right, background.padding.bottom + border.padding.bottom); } } diff --git a/src/dlangui/widgets/styles.d b/src/dlangui/widgets/styles.d index bd5835223..dcfe4b4d9 100644 --- a/src/dlangui/widgets/styles.d +++ b/src/dlangui/widgets/styles.d @@ -25,9 +25,9 @@ module dlangui.widgets.styles; import dlangui.core.config; -private import std.xml; -private import std.string; -private import std.algorithm; +import undead.xml; +import std.string; +import std.algorithm; import dlangui.core.types; import dlangui.graphics.colors;