diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-07-13 02:16:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-07-13 02:16:32 +0300 |
commit | a42faf3f01378c00b2410905c7fb78f3b5270790 (patch) | |
tree | 53f2d347b4bb60f69d286939618e5394519eb1c8 /src/gui/widgets/radiobutton.cpp | |
parent | 9d92f9ae55927283fb9f5a3855d654aba576c5f8 (diff) | |
download | mv-a42faf3f01378c00b2410905c7fb78f3b5270790.tar.gz mv-a42faf3f01378c00b2410905c7fb78f3b5270790.tar.bz2 mv-a42faf3f01378c00b2410905c7fb78f3b5270790.tar.xz mv-a42faf3f01378c00b2410905c7fb78f3b5270790.zip |
Change radio button theming.
Diffstat (limited to 'src/gui/widgets/radiobutton.cpp')
-rw-r--r-- | src/gui/widgets/radiobutton.cpp | 41 |
1 files changed, 23 insertions, 18 deletions
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) |