summaryrefslogtreecommitdiff
path: root/src/gui/widgets/checkbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/checkbox.cpp')
-rw-r--r--src/gui/widgets/checkbox.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp
index dc6d94b3..0fefbfe9 100644
--- a/src/gui/widgets/checkbox.cpp
+++ b/src/gui/widgets/checkbox.cpp
@@ -28,7 +28,6 @@
#include "gui/skin.h"
#include "resources/image.h"
-#include "resources/resourcemanager.h"
int CheckBox::instances = 0;
float CheckBox::mAlpha = 1.0;
@@ -45,8 +44,7 @@ CheckBox::CheckBox(const std::string &caption, bool selected):
{
if (instances == 0)
{
- ResourceManager *resman = ResourceManager::getInstance();
- Image *checkBox = resman->getImage("graphics/gui/checkbox.png");
+ Image *checkBox = SkinLoader::getImageFromTheme("checkbox.png");
checkBoxNormal = checkBox->getSubImage(0, 0, 9, 10);
checkBoxChecked = checkBox->getSubImage(9, 0, 9, 10);
checkBoxDisabled = checkBox->getSubImage(18, 0, 9, 10);
@@ -114,21 +112,29 @@ void CheckBox::drawBox(gcn::Graphics* graphics)
Image *box;
if (isEnabled())
+ {
if (isSelected())
+ {
if (mHasMouse)
box = checkBoxCheckedHi;
else
box = checkBoxChecked;
+ }
else
+ {
if (mHasMouse)
box = checkBoxNormalHi;
else
box = checkBoxNormal;
+ }
+ }
else
+ {
if (isSelected())
box = checkBoxDisabledChecked;
else
box = checkBoxDisabled;
+ }
updateAlpha();