Fix disabled bg

This commit is contained in:
iota97 committed 2022-02-14 11:30:37 +01:00
1 parent f4b5c16e1b
commit 7860aea62f
3 files changed
+13 -24

No files matched your search

+9 -20
View File
@@ -415,6 +415,9 @@ ClickableItem::ClickableItem(LayoutParams *layoutParams) : Clickable(layoutParam
void ClickableItem::Draw(UIContext &dc) {
Style style = dc.theme->itemStyle;
if (!IsEnabled()) {
style = dc.theme->itemDisabledStyle;
}
if (HasFocus()) {
style = dc.theme->itemFocusedStyle;
}
@@ -475,27 +478,13 @@ void Choice::HighlightChanged(bool highlighted){
}
void Choice::Draw(UIContext &dc) {
if (!IsSticky()) {
ClickableItem::Draw(dc);
} else {
Style style = dc.theme->itemStyle;
if (highlighted_) {
style = dc.theme->itemHighlightedStyle;
}
if (down_) {
style = dc.theme->itemDownStyle;
}
if (HasFocus()) {
style = dc.theme->itemFocusedStyle;
}
DrawBG(dc, style);
}
Style style = dc.theme->itemStyle;
if (!IsEnabled()) {
style = dc.theme->itemDisabledStyle;
}
if (HasFocus()) style = dc.theme->itemFocusedStyle;
if (down_) style = dc.theme->itemDownStyle;
if (!IsEnabled()) style = dc.theme->itemDisabledStyle;
if (highlighted_) style = dc.theme->itemHighlightedStyle;
DrawBG(dc, style);
if (image_.isValid() && text_.empty()) {
dc.Draw()->DrawImageRotated(image_, bounds_.centerX(), bounds_.centerY(), imgScale_, imgRot_, style.fgColor, imgFlipH_);
+2 -2
View File
@@ -42,7 +42,7 @@ struct ThemeInfo {
uint32_t uItemDownStyleFg = 0xFFFFFFFF;
uint32_t uItemDownStyleBg = 0xFFBD9939;
uint32_t uItemDisabledStyleFg = 0x80EEEEEE;
uint32_t uItemDisabledStyleBg = 0x55E0D4AF;
uint32_t uItemDisabledStyleBg = 0x55000000;
uint32_t uItemHighlightedStyleFg = 0xFFFFFFFF;
uint32_t uItemHighlightedStyleBg = 0x55BDBB39;
@@ -53,7 +53,7 @@ struct ThemeInfo {
uint32_t uButtonDownStyleFg = 0xFFFFFFFF;
uint32_t uButtonDownStyleBg = 0xFFBD9939;
uint32_t uButtonDisabledStyleFg = 0x80EEEEEE;
uint32_t uButtonDisabledStyleBg = 0x55E0D4AF;
uint32_t uButtonDisabledStyleBg = 0x55000000;
uint32_t uButtonHighlightedStyleFg = 0xFFFFFFFF;
uint32_t uButtonHighlightedStyleBg = 0x55BDBB39;
+2 -2
View File
@@ -7,7 +7,7 @@ ItemFocusedStyleBg = 0xffedc24c
ItemDownStyleFg = 0xffffffff
ItemDownStyleBg = 0xffbd9939
ItemDisabledStyleFg = 0x80eeeeee
ItemDisabledStyleBg = 0x55e0d4af
ItemDisabledStyleBg = 0x55000000
ItemHighlightedStyleFg = 0xffffffff
ItemHighlightedStyleBg = 0x55bdbb39
ButtonStyleFg = 0xffffffff
@@ -17,7 +17,7 @@ ButtonFocusedStyleBg = 0xffedc24c
ButtonDownStyleFg = 0xffffffff
ButtonDownStyleBg = 0xffbd9939
ButtonDisabledStyleFg = 0x80eeeeee
ButtonDisabledStyleBg = 0x55e0d4af
ButtonDisabledStyleBg = 0x55000000
ButtonHighlightedStyleFg = 0xffffffff
ButtonHighlightedStyleBg = 0x55bdbb39
HeaderStyleFg = 0xffffffff