Fix colors used for TextButtons, MenuToolbarButton and ModalWindow (#25)
* fix colors for modal window and toolbar buttons in menu popuos * fix TextButton correctly so all TextButtons in app just work * fix TextButton correctly so the app just worksX Co-authored-by: kkoenig1@optonline.com <kkoenig1@optonline.com>
This commit is contained in:
committed by
GitHub
co-authored by
kkoenig1@optonline.com <kkoenig1@optonline.com>
parent
672dc8389b
commit
461b8971a2
+3
-2
@@ -70,7 +70,7 @@ void Button::checkEvents()
|
||||
|
||||
void TextButton::paint(BitmapBuffer * dc)
|
||||
{
|
||||
auto textColor = COLOR_THEME_SECONDARY1;
|
||||
auto textColor = getTextFlags();
|
||||
auto bgColor = COLOR_THEME_SECONDARY2;
|
||||
|
||||
if (bgColorHandler) {
|
||||
@@ -79,6 +79,7 @@ void TextButton::paint(BitmapBuffer * dc)
|
||||
bgColor = COLOR_THEME_ACTIVE;
|
||||
} else if (hasFocus()) {
|
||||
bgColor = COLOR_THEME_FOCUS;
|
||||
textColor = COLOR_THEME_PRIMARY2;
|
||||
}
|
||||
|
||||
if (checked()) {
|
||||
@@ -104,7 +105,7 @@ void TextButton::paint(BitmapBuffer * dc)
|
||||
}
|
||||
|
||||
dc->drawText(rect.w / 2, 1 + (rect.h - getFontHeight(textFlags)) / 2,
|
||||
text.c_str(), CENTERED | textFlags | textColor);
|
||||
text.c_str(), CENTERED | textColor);
|
||||
}
|
||||
|
||||
void IconButton::paint(BitmapBuffer * dc)
|
||||
|
||||
+1
@@ -96,6 +96,7 @@ class TextButton: public Button
|
||||
Button(parent, rect, std::move(pressHandler), windowFlags, textFlags),
|
||||
text(std::move(text))
|
||||
{
|
||||
setTextFlags(textFlags | COLOR_THEME_PRIMARY1);
|
||||
}
|
||||
|
||||
#if defined(DEBUG_WINDOWS)
|
||||
|
||||
+1
-1
@@ -32,6 +32,6 @@ void MenuToolbarButton::paint(BitmapBuffer * dc)
|
||||
&picto, 1, CENTERED | COLOR_THEME_PRIMARY2);
|
||||
} else {
|
||||
dc->drawSizedText(rect.w / 2, (rect.h - getFontHeight(FONT(STD))) / 2 + 1,
|
||||
&picto, 1, CENTERED | COLOR_THEME_SECONDARY1);
|
||||
&picto, 1, CENTERED | COLOR_THEME_PRIMARY1);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ void ModalWindow::deleteLater(bool detach, bool trash)
|
||||
|
||||
void ModalWindow::paint(BitmapBuffer * dc)
|
||||
{
|
||||
dc->drawFilledRect(0, 0, width(), height(), SOLID, COLOR_THEME_PRIMARY1, OPACITY(5));
|
||||
dc->drawFilledRect(0, 0, width(), height(), SOLID, COLOR_THEME_SECONDARY3, OPACITY(5));
|
||||
}
|
||||
|
||||
void ModalWindowContent::paint(BitmapBuffer * dc)
|
||||
|
||||
Reference in New Issue
Block a user