mirror of https://github.com/buggins/dlangui.git
update dark theme; fix drawable overriding in styles/themes
This commit is contained in:
parent
dc2ccfd068
commit
ab05bf5340
|
@ -228,6 +228,7 @@ extern (C) int UIAppMain(string[] args) {
|
||||||
Platform.instance.uiLanguage = "en";
|
Platform.instance.uiLanguage = "en";
|
||||||
// load theme from file "theme_default.xml"
|
// load theme from file "theme_default.xml"
|
||||||
Platform.instance.uiTheme = "theme_default";
|
Platform.instance.uiTheme = "theme_default";
|
||||||
|
//Platform.instance.uiTheme = "theme_dark";
|
||||||
|
|
||||||
// you can override default hinting mode here (Normal, AutoHint, Disabled)
|
// you can override default hinting mode here (Normal, AutoHint, Disabled)
|
||||||
FontManager.hintingMode = HintingMode.Normal;
|
FontManager.hintingMode = HintingMode.Normal;
|
||||||
|
|
|
@ -28,11 +28,7 @@ class GroupBox : LinearLayout {
|
||||||
protected TextWidget _caption;
|
protected TextWidget _caption;
|
||||||
|
|
||||||
this() {
|
this() {
|
||||||
super("GROUP_BOX", Orientation.Vertical);
|
this(null, ""d, Orientation.Vertical);
|
||||||
styleId = STYLE_GROUP_BOX;
|
|
||||||
_caption = new TextWidget("GROUP_BOX_CAPTION");
|
|
||||||
_caption.styleId = STYLE_GROUP_BOX_CAPTION;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this(string ID, UIString uitext, Orientation orientation = 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) {
|
this(string ID, string textResourceId, Orientation orientation = Orientation.Vertical) {
|
||||||
super(ID, orientation);
|
this(ID, UIString(textResourceId), orientation);
|
||||||
styleId = STYLE_GROUP_BOX;
|
|
||||||
_caption = new TextWidget("GROUP_BOX_CAPTION");
|
|
||||||
_caption.styleId = STYLE_GROUP_BOX_CAPTION;
|
|
||||||
_caption.parent = this;
|
|
||||||
textResource = textResourceId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this(string ID, dstring rawText, Orientation orientation = Orientation.Vertical) {
|
this(string ID, dstring rawText, Orientation orientation = Orientation.Vertical) {
|
||||||
super(ID, orientation);
|
this(ID, UIString(rawText), orientation);
|
||||||
_caption = new TextWidget("GROUP_BOX_CAPTION");
|
|
||||||
_caption.styleId = STYLE_GROUP_BOX_CAPTION;
|
|
||||||
_caption.parent = this;
|
|
||||||
styleId = STYLE_GROUP_BOX;
|
|
||||||
text = rawText;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~this() {
|
~this() {
|
||||||
|
|
|
@ -303,6 +303,9 @@ public:
|
||||||
s.onThemeChanged();
|
s.onThemeChanged();
|
||||||
foreach(s; _children)
|
foreach(s; _children)
|
||||||
s.onThemeChanged();
|
s.onThemeChanged();
|
||||||
|
foreach(d; _customDrawables)
|
||||||
|
d.clear();
|
||||||
|
destroy(_customDrawables);
|
||||||
}
|
}
|
||||||
|
|
||||||
@property const(Theme) theme() const {
|
@property const(Theme) theme() const {
|
||||||
|
@ -1600,7 +1603,7 @@ public:
|
||||||
@property ref DrawableRef drawable() const {
|
@property ref DrawableRef drawable() const {
|
||||||
if (!_drawable.isNull)
|
if (!_drawable.isNull)
|
||||||
return (cast(DrawableAttribute)this)._drawable;
|
return (cast(DrawableAttribute)this)._drawable;
|
||||||
(cast(DrawableAttribute)this)._drawable = drawableCache.get(_id);
|
(cast(DrawableAttribute)this)._drawable = drawableCache.get(_drawableId);
|
||||||
(cast(DrawableAttribute)this)._initialized = true;
|
(cast(DrawableAttribute)this)._initialized = true;
|
||||||
return (cast(DrawableAttribute)this)._drawable;
|
return (cast(DrawableAttribute)this)._drawable;
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 313 B |
Binary file not shown.
After Width: | Height: | Size: 252 B |
Binary file not shown.
After Width: | Height: | Size: 267 B |
Binary file not shown.
After Width: | Height: | Size: 247 B |
|
@ -98,6 +98,10 @@
|
||||||
<style id="SCROLLBAR"
|
<style id="SCROLLBAR"
|
||||||
backgroundColor="#C0808080"
|
backgroundColor="#C0808080"
|
||||||
/>
|
/>
|
||||||
|
<style id="SLIDER"
|
||||||
|
backgroundImageId="slider_background_dark"
|
||||||
|
align="Center"
|
||||||
|
/>
|
||||||
<style id="PAGE_SCROLL"
|
<style id="PAGE_SCROLL"
|
||||||
backgroundColor="#FFFFFFFF"
|
backgroundColor="#FFFFFFFF"
|
||||||
>
|
>
|
||||||
|
@ -277,5 +281,20 @@
|
||||||
<state state_selected="true" backgroundColor="#00202020"/>
|
<state state_selected="true" backgroundColor="#00202020"/>
|
||||||
<state state_hovered="true" backgroundColor="#C0404000"/>
|
<state state_hovered="true" backgroundColor="#C0404000"/>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style id="GROUP_BOX"
|
||||||
|
margins="2pt,4pt,2pt,2pt">
|
||||||
|
<drawable id="group_box_frame_up_left" value="group_box_frame_up_left_dark"/>
|
||||||
|
<drawable id="group_box_frame_up_right" value="group_box_frame_up_right_dark"/>
|
||||||
|
<drawable id="group_box_frame_bottom" value="group_box_frame_bottom_dark"/>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style id="GROUP_BOX_CAPTION"
|
||||||
|
align="Left|VCenter"
|
||||||
|
textColor="#504840"
|
||||||
|
padding="1pt,1pt,1pt,1pt">
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
</theme>
|
</theme>
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,10 @@ res/group_box_frame_bottom.9.png
|
||||||
res/group_box_frame_up_left.9.png
|
res/group_box_frame_up_left.9.png
|
||||||
res/group_box_frame_up_right.9.png
|
res/group_box_frame_up_right.9.png
|
||||||
res/slider_background.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_en.ini
|
||||||
res/i18n/std_ru.ini
|
res/i18n/std_ru.ini
|
||||||
res/list_item_background.xml
|
res/list_item_background.xml
|
||||||
|
|
Loading…
Reference in New Issue