Improved more widgets when disabled

This commit is contained in:
Dimitris Panokostas 2020-05-17 02:13:22 +02:00
parent a404899a65
commit 6709962022
5 changed files with 19 additions and 13 deletions

View file

@ -80,7 +80,7 @@ namespace gcn
mSpacing(4)
{
setFocusable(true);
adjustSize();
Button::adjustSize();
setBorderSize(1);
addMouseListener(this);
@ -97,7 +97,7 @@ namespace gcn
mSpacing(4)
{
setFocusable(true);
adjustSize();
Button::adjustSize();
setBorderSize(1);
addMouseListener(this);
@ -169,7 +169,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 text_x;
const auto text_y = getHeight() / 2 - getFont()->getHeight() / 2;

View file

@ -93,7 +93,10 @@ namespace gcn
drawBox(graphics);
graphics->setFont(getFont());
graphics->setColor(getForegroundColor());
if (isEnabled())
graphics->setColor(getForegroundColor());
else
graphics->setColor(Color(128, 128, 128));
const auto h = getHeight() + getHeight() / 2;

View file

@ -173,9 +173,10 @@ namespace gcn
}
if (mListBox->getListModel() && mListBox->getSelected() >= 0)
{
graphics->drawText(mListBox->getListModel()->getElementAt(mListBox->getSelected()), 2, 1);
}
if (!isEnabled())
graphics->drawText("N/A", 2, 1);
drawButton(graphics);
@ -278,7 +279,11 @@ namespace gcn
y + h - 1,
x + h - 2,
y + h - 1);
graphics->setColor(getForegroundColor());
if (isEnabled())
graphics->setColor(getForegroundColor());
else
graphics->setColor(Color(128, 128, 128));
const auto hh = h / 3;
const auto hx = x + h / 2;

View file

@ -123,7 +123,7 @@ namespace gcn
graphics->setFont(getFont());
auto color = getForegroundColor();
if (!isEnabled())
color = getBaseColor() - 0x101010;
color = Color(128, 128, 128);
graphics->setColor(color);
graphics->drawText(getCaption(), text_x, text_y, getAlignment());
}

View file

@ -1187,11 +1187,6 @@ void DisableResume()
if (emulating)
{
cmdStart->setEnabled(false);
gcn::Color backCol;
backCol.r = 128;
backCol.g = 128;
backCol.b = 128;
cmdStart->setForegroundColor(backCol);
}
}