Skip to content

Commit

Permalink
bugfix: fixed dropdown and checkbox colors when disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
midwan committed Sep 11, 2024
1 parent 54c194b commit a242e9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion external/libguisan/src/widgets/checkbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions external/libguisan/src/widgets/dropdown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a242e9f

Please sign in to comment.