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 | |
parent | 9d92f9ae55927283fb9f5a3855d654aba576c5f8 (diff) | |
download | manaplus-a42faf3f01378c00b2410905c7fb78f3b5270790.tar.gz manaplus-a42faf3f01378c00b2410905c7fb78f3b5270790.tar.bz2 manaplus-a42faf3f01378c00b2410905c7fb78f3b5270790.tar.xz manaplus-a42faf3f01378c00b2410905c7fb78f3b5270790.zip |
Change radio button theming.
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) |