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 | |
parent | 9d92f9ae55927283fb9f5a3855d654aba576c5f8 (diff) | |
download | mv-a42faf3f01378c00b2410905c7fb78f3b5270790.tar.gz mv-a42faf3f01378c00b2410905c7fb78f3b5270790.tar.bz2 mv-a42faf3f01378c00b2410905c7fb78f3b5270790.tar.xz mv-a42faf3f01378c00b2410905c7fb78f3b5270790.zip |
Change radio button theming.
-rw-r--r-- | data/graphics/gui/CMakeLists.txt | 5 | ||||
-rw-r--r-- | data/graphics/gui/Makefile.am | 5 | ||||
-rw-r--r-- | data/graphics/gui/radio.xml | 8 | ||||
-rw-r--r-- | data/graphics/gui/radioin.png | bin | 454 -> 0 bytes | |||
-rw-r--r-- | data/graphics/gui/radioin_highlight.png | bin | 485 -> 0 bytes | |||
-rw-r--r-- | data/graphics/gui/radioout.png | bin | 380 -> 0 bytes | |||
-rw-r--r-- | data/graphics/gui/radioout_highlight.png | bin | 434 -> 0 bytes | |||
-rw-r--r-- | data/graphics/gui/window.png | bin | 16084 -> 17037 bytes | |||
-rw-r--r-- | src/gui/theme.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/radiobutton.cpp | 41 |
10 files changed, 37 insertions, 26 deletions
diff --git a/data/graphics/gui/CMakeLists.txt b/data/graphics/gui/CMakeLists.txt index 6cd7c3698..e5f01895a 100644 --- a/data/graphics/gui/CMakeLists.txt +++ b/data/graphics/gui/CMakeLists.txt @@ -20,10 +20,7 @@ SET (FILES playerbox_background.xml progress-indicator.png progressbar.xml - radioin.png - radioin_highlight.png - radioout.png - radioout_highlight.png + radio.xml resize.xml scroll.xml scroll_background.xml diff --git a/data/graphics/gui/Makefile.am b/data/graphics/gui/Makefile.am index f43d75e38..d2e5c1534 100644 --- a/data/graphics/gui/Makefile.am +++ b/data/graphics/gui/Makefile.am @@ -23,10 +23,7 @@ gui_DATA = \ playerbox_background.xml \ progress-indicator.png \ progressbar.xml \ - radioin.png \ - radioin_highlight.png \ - radioout.png \ - radioout_highlight.png \ + radio.xml \ resize.xml \ scroll.xml \ scroll_background.xml \ diff --git a/data/graphics/gui/radio.xml b/data/graphics/gui/radio.xml new file mode 100644 index 000000000..d825e5973 --- /dev/null +++ b/data/graphics/gui/radio.xml @@ -0,0 +1,8 @@ +<skinset name="Default" image="window.png"> + <widget type="Window" xpos="137" ypos="132"> + <part type="in" xpos="0" ypos="0" width="10" height="10" /> + <part type="in-highlighted" xpos="14" ypos="0" width="10" height="10" /> + <part type="out" xpos="0" ypos="14" width="10" height="10" /> + <part type="out-highlighted" xpos="14" ypos="14" width="10" height="10" /> + </widget> +</skinset> diff --git a/data/graphics/gui/radioin.png b/data/graphics/gui/radioin.png Binary files differdeleted file mode 100644 index 12e027fec..000000000 --- a/data/graphics/gui/radioin.png +++ /dev/null diff --git a/data/graphics/gui/radioin_highlight.png b/data/graphics/gui/radioin_highlight.png Binary files differdeleted file mode 100644 index b193d3e30..000000000 --- a/data/graphics/gui/radioin_highlight.png +++ /dev/null diff --git a/data/graphics/gui/radioout.png b/data/graphics/gui/radioout.png Binary files differdeleted file mode 100644 index 5eb67bd85..000000000 --- a/data/graphics/gui/radioout.png +++ /dev/null diff --git a/data/graphics/gui/radioout_highlight.png b/data/graphics/gui/radioout_highlight.png Binary files differdeleted file mode 100644 index dd31e6e30..000000000 --- a/data/graphics/gui/radioout_highlight.png +++ /dev/null diff --git a/data/graphics/gui/window.png b/data/graphics/gui/window.png Binary files differindex c0840e7ae..814111175 100644 --- a/data/graphics/gui/window.png +++ b/data/graphics/gui/window.png 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) |