diff --git a/examples/example1/src/example1.d b/examples/example1/src/example1.d index 59e2416d..f23b965e 100644 --- a/examples/example1/src/example1.d +++ b/examples/example1/src/example1.d @@ -228,6 +228,7 @@ extern (C) int UIAppMain(string[] args) { Platform.instance.uiLanguage = "en"; // load theme from file "theme_default.xml" Platform.instance.uiTheme = "theme_default"; + //Platform.instance.uiTheme = "theme_dark"; // you can override default hinting mode here (Normal, AutoHint, Disabled) FontManager.hintingMode = HintingMode.Normal; diff --git a/src/dlangui/widgets/groupbox.d b/src/dlangui/widgets/groupbox.d index 7e1965e5..76fa2bb6 100644 --- a/src/dlangui/widgets/groupbox.d +++ b/src/dlangui/widgets/groupbox.d @@ -28,11 +28,7 @@ class GroupBox : LinearLayout { protected TextWidget _caption; this() { - super("GROUP_BOX", Orientation.Vertical); - styleId = STYLE_GROUP_BOX; - _caption = new TextWidget("GROUP_BOX_CAPTION"); - _caption.styleId = STYLE_GROUP_BOX_CAPTION; - + this(null, ""d, Orientation.Vertical); } this(string ID, UIString uitext, Orientation orientation = Orientation.Vertical) { @@ -45,21 +41,11 @@ class GroupBox : LinearLayout { } this(string ID, string textResourceId, Orientation orientation = Orientation.Vertical) { - super(ID, orientation); - styleId = STYLE_GROUP_BOX; - _caption = new TextWidget("GROUP_BOX_CAPTION"); - _caption.styleId = STYLE_GROUP_BOX_CAPTION; - _caption.parent = this; - textResource = textResourceId; + this(ID, UIString(textResourceId), orientation); } this(string ID, dstring rawText, Orientation orientation = Orientation.Vertical) { - super(ID, orientation); - _caption = new TextWidget("GROUP_BOX_CAPTION"); - _caption.styleId = STYLE_GROUP_BOX_CAPTION; - _caption.parent = this; - styleId = STYLE_GROUP_BOX; - text = rawText; + this(ID, UIString(rawText), orientation); } ~this() { diff --git a/src/dlangui/widgets/styles.d b/src/dlangui/widgets/styles.d index c9639617..8f76f293 100644 --- a/src/dlangui/widgets/styles.d +++ b/src/dlangui/widgets/styles.d @@ -303,6 +303,9 @@ public: s.onThemeChanged(); foreach(s; _children) s.onThemeChanged(); + foreach(d; _customDrawables) + d.clear(); + destroy(_customDrawables); } @property const(Theme) theme() const { @@ -1600,7 +1603,7 @@ public: @property ref DrawableRef drawable() const { if (!_drawable.isNull) return (cast(DrawableAttribute)this)._drawable; - (cast(DrawableAttribute)this)._drawable = drawableCache.get(_id); + (cast(DrawableAttribute)this)._drawable = drawableCache.get(_drawableId); (cast(DrawableAttribute)this)._initialized = true; return (cast(DrawableAttribute)this)._drawable; } diff --git a/views/res/group_box_frame_bottom_dark.9.png b/views/res/group_box_frame_bottom_dark.9.png new file mode 100644 index 00000000..75d791cb Binary files /dev/null and b/views/res/group_box_frame_bottom_dark.9.png differ diff --git a/views/res/group_box_frame_up_left_dark.9.png b/views/res/group_box_frame_up_left_dark.9.png new file mode 100644 index 00000000..5ec5e0ae Binary files /dev/null and b/views/res/group_box_frame_up_left_dark.9.png differ diff --git a/views/res/group_box_frame_up_right_dark.9.png b/views/res/group_box_frame_up_right_dark.9.png new file mode 100644 index 00000000..94f93446 Binary files /dev/null and b/views/res/group_box_frame_up_right_dark.9.png differ diff --git a/views/res/slider_background_dark.9.png b/views/res/slider_background_dark.9.png new file mode 100644 index 00000000..b465834b Binary files /dev/null and b/views/res/slider_background_dark.9.png differ diff --git a/views/res/theme_dark.xml b/views/res/theme_dark.xml index cd7acaea..6b1ce4d5 100644 --- a/views/res/theme_dark.xml +++ b/views/res/theme_dark.xml @@ -98,6 +98,10 @@ + + + + + + diff --git a/views/standard_resources.list b/views/standard_resources.list index 35436585..c9c766a6 100644 --- a/views/standard_resources.list +++ b/views/standard_resources.list @@ -51,6 +51,10 @@ res/group_box_frame_bottom.9.png res/group_box_frame_up_left.9.png res/group_box_frame_up_right.9.png res/slider_background.9.png +res/group_box_frame_bottom_dark.9.png +res/group_box_frame_up_left_dark.9.png +res/group_box_frame_up_right_dark.9.png +res/slider_background_dark.9.png res/i18n/std_en.ini res/i18n/std_ru.ini res/list_item_background.xml