diff --git a/src/dlangui/widgets/scrollbar.d b/src/dlangui/widgets/scrollbar.d
index e2d3d779..bb5ed4e9 100644
--- a/src/dlangui/widgets/scrollbar.d
+++ b/src/dlangui/widgets/scrollbar.d
@@ -320,14 +320,24 @@ class ScrollBar : AbstractSlider, OnClickHandler {
override @property AbstractSlider orientation(Orientation value) {
if (_orientation != value) {
_orientation = value;
- _btnBack.drawableId = style.customDrawableId(_orientation == Orientation.Vertical ? ATTR_SCROLLBAR_BUTTON_UP : ATTR_SCROLLBAR_BUTTON_LEFT);
- _btnForward.drawableId = style.customDrawableId(_orientation == Orientation.Vertical ? ATTR_SCROLLBAR_BUTTON_DOWN : ATTR_SCROLLBAR_BUTTON_RIGHT);
- _indicator.drawableId = style.customDrawableId(_orientation == Orientation.Vertical ? ATTR_SCROLLBAR_INDICATOR_VERTICAL : ATTR_SCROLLBAR_INDICATOR_HORIZONTAL);
+ updateDrawableIds();
requestLayout();
}
return this;
}
+ void updateDrawableIds() {
+ _btnBack.drawableId = style.customDrawableId(_orientation == Orientation.Vertical ? ATTR_SCROLLBAR_BUTTON_UP : ATTR_SCROLLBAR_BUTTON_LEFT);
+ _btnForward.drawableId = style.customDrawableId(_orientation == Orientation.Vertical ? ATTR_SCROLLBAR_BUTTON_DOWN : ATTR_SCROLLBAR_BUTTON_RIGHT);
+ _indicator.drawableId = style.customDrawableId(_orientation == Orientation.Vertical ? ATTR_SCROLLBAR_INDICATOR_VERTICAL : ATTR_SCROLLBAR_INDICATOR_HORIZONTAL);
+ }
+
+ /// handle theme change: e.g. reload some themed resources
+ override void onThemeChanged() {
+ super.onThemeChanged();
+ updateDrawableIds();
+ }
+
/// set string property value, for ML loaders
override bool setStringProperty(string name, string value) {
if (name.equal("orientation")) {
diff --git a/src/dlangui/widgets/styles.d b/src/dlangui/widgets/styles.d
index 6091e4cf..76ddcbcb 100644
--- a/src/dlangui/widgets/styles.d
+++ b/src/dlangui/widgets/styles.d
@@ -295,6 +295,13 @@ struct DrawableAttributeList {
set(key, value.drawableId);
}
}
+ void onThemeChanged() {
+ foreach(key, ref value; _customDrawables) {
+ if (value) {
+ value.onThemeChanged();
+ }
+ }
+ }
}
/// style properties
@@ -348,7 +355,7 @@ public:
s.onThemeChanged();
foreach(s; _children)
s.onThemeChanged();
- _customDrawables.clear();
+ _customDrawables.onThemeChanged();
}
@property const(Theme) theme() const {
@@ -1663,6 +1670,12 @@ public:
_drawable.clear();
_initialized = false;
}
+ void onThemeChanged() {
+ if (!_drawableId) {
+ _drawable.clear();
+ _initialized = false;
+ }
+ }
}
/// returns custom drawable replacement id for specified id from current theme, or returns passed value if not found or no current theme
diff --git a/views/res/close_dark.png b/views/res/close_dark.png
new file mode 100644
index 00000000..6fbe4732
Binary files /dev/null and b/views/res/close_dark.png differ
diff --git a/views/res/scrollbar_btn_transparent_background_dark.xml b/views/res/scrollbar_btn_transparent_background_dark.xml
new file mode 100644
index 00000000..2f43b424
--- /dev/null
+++ b/views/res/scrollbar_btn_transparent_background_dark.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
diff --git a/views/res/tab_more_dark.png b/views/res/tab_more_dark.png
new file mode 100644
index 00000000..8451008c
Binary files /dev/null and b/views/res/tab_more_dark.png differ
diff --git a/views/res/theme_dark.xml b/views/res/theme_dark.xml
index 21678d70..663c164c 100644
--- a/views/res/theme_dark.xml
+++ b/views/res/theme_dark.xml
@@ -77,21 +77,18 @@
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -103,6 +100,10 @@
backgroundImageId="scrollbar_btn_background_dark"
align="Center"
/>
+