Improved more widgets when disabled
This commit is contained in:
parent
a404899a65
commit
6709962022
5 changed files with 19 additions and 13 deletions
9
external/libguisan/src/widgets/button.cpp
vendored
9
external/libguisan/src/widgets/button.cpp
vendored
|
@ -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;
|
||||
|
|
5
external/libguisan/src/widgets/checkbox.cpp
vendored
5
external/libguisan/src/widgets/checkbox.cpp
vendored
|
@ -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;
|
||||
|
||||
|
|
11
external/libguisan/src/widgets/dropdown.cpp
vendored
11
external/libguisan/src/widgets/dropdown.cpp
vendored
|
@ -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;
|
||||
|
|
2
external/libguisan/src/widgets/label.cpp
vendored
2
external/libguisan/src/widgets/label.cpp
vendored
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue