diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/theme.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/radiobutton.cpp | 41 |
2 files changed, 27 insertions, 18 deletions
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index 41bf32ad5..4d22612fb 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -328,18 +328,22 @@ static SkinParameter skinParam[] = {0, "standart"}, {0, "up"}, {0, "hstart"}, + {0, "in"}, {1, "top-edge"}, {1, "highlighted"}, {1, "down"}, {1, "hmiddle"}, + {1, "in-highlighted"}, {2, "top-right-corner"}, {2, "pressed"}, {2, "left"}, {2, "hend"}, + {2, "out"}, {3, "left-edge"}, {3, "disabled"}, {3, "right"}, {3, "hgrip"}, + {3, "out-highlighted"}, {4, "bg-quad"}, {4, "vstart"}, {5, "right-edge"}, diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp index e2a3483fc..e0e01d4ed 100644 --- a/src/gui/widgets/radiobutton.cpp +++ b/src/gui/widgets/radiobutton.cpp @@ -51,20 +51,25 @@ RadioButton::RadioButton(const std::string &caption, const std::string &group, setForegroundColor(Theme::getThemeColor(Theme::TEXT)); if (instances == 0) { - radioNormal = Theme::getImageFromTheme("radioout.png"); - radioChecked = Theme::getImageFromTheme("radioin.png"); - radioDisabled = Theme::getImageFromTheme("radioout.png"); - radioDisabledChecked = Theme::getImageFromTheme("radioin.png"); - radioNormalHi = Theme::getImageFromTheme("radioout_highlight.png"); - radioCheckedHi = Theme::getImageFromTheme("radioin_highlight.png"); + if (Theme::instance()) + { + ImageRect rect; + Theme::instance()->loadRect(rect, "radio.xml", 0, 3); + radioChecked = rect.grid[0]; + radioDisabledChecked = rect.grid[0]; + radioCheckedHi = rect.grid[1]; + radioNormal = rect.grid[2]; + radioDisabled = rect.grid[2]; + radioNormalHi = rect.grid[3]; + } if (radioNormal) radioNormal->setAlpha(mAlpha); if (radioChecked) radioChecked->setAlpha(mAlpha); - if (radioDisabled) - radioDisabled->setAlpha(mAlpha); - if (radioDisabledChecked) - radioDisabledChecked->setAlpha(mAlpha); +// if (radioDisabled) +// radioDisabled->setAlpha(mAlpha); +// if (radioDisabledChecked) +// radioDisabledChecked->setAlpha(mAlpha); if (radioNormalHi) radioNormalHi->setAlpha(mAlpha); if (radioCheckedHi) @@ -84,10 +89,10 @@ RadioButton::~RadioButton() radioNormal->decRef(); if (radioChecked) radioChecked->decRef(); - if (radioDisabled) - radioDisabled->decRef(); - if (radioDisabledChecked) - radioDisabledChecked->decRef(); +// if (radioDisabled) +// radioDisabled->decRef(); +// if (radioDisabledChecked) +// radioDisabledChecked->decRef(); if (radioNormalHi) radioNormalHi->decRef(); if (radioCheckedHi) @@ -104,10 +109,10 @@ void RadioButton::drawBox(gcn::Graphics* graphics) radioNormal->setAlpha(mAlpha); if (radioChecked) radioChecked->setAlpha(mAlpha); - if (radioDisabled) - radioDisabled->setAlpha(mAlpha); - if (radioDisabledChecked) - radioDisabledChecked->setAlpha(mAlpha); +// if (radioDisabled) +// radioDisabled->setAlpha(mAlpha); +// if (radioDisabledChecked) +// radioDisabledChecked->setAlpha(mAlpha); if (radioNormalHi) radioNormalHi->setAlpha(mAlpha); if (radioCheckedHi) |