enhancement: guisan: fix remaining widgets colors

These widgets were also missing their disabled color
This commit is contained in:
Dimitris Panokostas 2024-09-12 18:58:39 +02:00
parent f83bda648a
commit e465e3f845
No known key found for this signature in database
GPG Key ID: 330156A68E9E0929
3 changed files with 12 additions and 3 deletions

View File

@ -153,7 +153,10 @@ namespace gcn
graphics->drawLine(getWidth() - 1, 1, getWidth() - 1, getHeight() - 1);
graphics->drawLine(1, getHeight() - 1, getWidth() - 1, getHeight() - 1);
graphics->setColor(getForegroundColor());
if (isEnabled())
graphics->setColor(getForegroundColor());
else
graphics->setColor(Color(128, 128, 128));
const int textX = getWidth() / 2 - (mImage ? mImage->getWidth() : 0) / 2;
const int textY = getHeight() / 2 - (mImage ? mImage->getHeight() : 0) / 2;

View File

@ -162,7 +162,10 @@ namespace gcn
graphics->drawLine(getWidth() - 1, 1, getWidth() - 1, getHeight() - 1);
graphics->drawLine(1, getHeight() - 1, getWidth() - 1, getHeight() - 1);
graphics->setColor(getForegroundColor());
if (isEnabled())
graphics->setColor(getForegroundColor());
else
graphics->setColor(Color(128, 128, 128));
int imageX, imageY;
int textX, textY;

View File

@ -225,7 +225,10 @@ namespace gcn
throw GCN_EXCEPTION("Unknown alignment.");
}
graphics->setColor(getForegroundColor());
if (isEnabled())
graphics->setColor(getForegroundColor());
else
graphics->setColor(Color(128, 128, 128));
graphics->setFont(getFont());
graphics->pushClipArea(Rectangle(0, 0, getWidth(), getTitleBarHeight() - 1));
graphics->drawText(getCaption(), textX, textY, getAlignment(), isEnabled());