Skip to content

Commit

Permalink
enhancement: guisan: fix remaining widgets colors
Browse files Browse the repository at this point in the history
These widgets were also missing their disabled color
  • Loading branch information
midwan committed Sep 12, 2024
1 parent 1e768b1 commit f9a99da
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion external/libguisan/src/widgets/imagebutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion external/libguisan/src/widgets/imagetextbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion external/libguisan/src/widgets/inputbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit f9a99da

Please sign in to comment.