From 16aa6f6c79de5f0dae97c29afc13aa4bf798d428 Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Wed, 11 Sep 2024 15:06:49 +0200 Subject: [PATCH] bugfix: fixed dropdown and checkbox colors when disabled --- external/libguisan/src/widgets/checkbox.cpp | 2 +- external/libguisan/src/widgets/dropdown.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/external/libguisan/src/widgets/checkbox.cpp b/external/libguisan/src/widgets/checkbox.cpp index 16bf4f54f..b3e110028 100644 --- a/external/libguisan/src/widgets/checkbox.cpp +++ b/external/libguisan/src/widgets/checkbox.cpp @@ -100,7 +100,7 @@ namespace gcn const int h = getHeight() + getHeight() / 2; - graphics->drawText(getCaption(), h - 2, 1); + graphics->drawText(getCaption(), h - 2, 1, Graphics::Left, isEnabled()); } void CheckBox::drawBox(Graphics* graphics) diff --git a/external/libguisan/src/widgets/dropdown.cpp b/external/libguisan/src/widgets/dropdown.cpp index 001ac9396..7834f04c2 100644 --- a/external/libguisan/src/widgets/dropdown.cpp +++ b/external/libguisan/src/widgets/dropdown.cpp @@ -192,7 +192,7 @@ namespace gcn graphics->setFont(getFont()); if (mListBox->getListModel() && mListBox->getSelected() >= 0) - graphics->drawText(mListBox->getListModel()->getElementAt(mListBox->getSelected()), 1, 0); + graphics->drawText(mListBox->getListModel()->getElementAt(mListBox->getSelected()), 1, 0, Graphics::Left, isEnabled()); // Push a clip area before drawing the button. graphics->pushClipArea(Rectangle(currentClipArea.width - currentClipArea.height, @@ -256,7 +256,10 @@ namespace gcn graphics->fillRectangle( Rectangle(1, 1, currentClipArea.width - 2, currentClipArea.height - 2)); - graphics->setColor(getForegroundColor()); + if (isEnabled()) + graphics->setColor(getForegroundColor()); + else + graphics->setColor(Color(128, 128, 128)); int i; int n = currentClipArea.height / 3;