diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-10-11 17:35:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-10-11 18:00:22 +0300 |
commit | 52c7195a8ee91f95ef134d9798a47ea313df16c8 (patch) | |
tree | ca1f32cfadce611a1820b50f5386c02cd2ce06ae /src/gui/widgets/tabs | |
parent | f1b82c1b06604c2c1eed750a6c980aa0b5355560 (diff) | |
download | mv-52c7195a8ee91f95ef134d9798a47ea313df16c8.tar.gz mv-52c7195a8ee91f95ef134d9798a47ea313df16c8.tar.bz2 mv-52c7195a8ee91f95ef134d9798a47ea313df16c8.tar.xz mv-52c7195a8ee91f95ef134d9798a47ea313df16c8.zip |
Second part of checks from Parasoft C++ Test.
Diffstat (limited to 'src/gui/widgets/tabs')
-rw-r--r-- | src/gui/widgets/tabs/setup_joystick.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/tabs/tab.cpp | 55 |
2 files changed, 28 insertions, 33 deletions
diff --git a/src/gui/widgets/tabs/setup_joystick.cpp b/src/gui/widgets/tabs/setup_joystick.cpp index 15b6959a9..571d53b6f 100644 --- a/src/gui/widgets/tabs/setup_joystick.cpp +++ b/src/gui/widgets/tabs/setup_joystick.cpp @@ -178,10 +178,8 @@ void Setup_Joystick::apply() if (!joystick) return; - config.setValue("joystickEnabled", - joystick ? joystick->isEnabled() : false); + config.setValue("joystickEnabled", joystick->isEnabled()); config.setValue("useInactiveJoystick", mUseInactiveCheckBox->isSelected()); - if (joystick) - joystick->setUseInactive(mUseInactiveCheckBox->isSelected()); + joystick->setUseInactive(mUseInactiveCheckBox->isSelected()); } diff --git a/src/gui/widgets/tabs/tab.cpp b/src/gui/widgets/tabs/tab.cpp index 8c25e7b1d..733d030d2 100644 --- a/src/gui/widgets/tabs/tab.cpp +++ b/src/gui/widgets/tabs/tab.cpp @@ -215,47 +215,44 @@ void Tab::draw(gcn::Graphics *graphics) Graphics *const g = static_cast<Graphics*>(graphics); - if (skin) + // draw tab + if (openGLMode != RENDER_SAFE_OPENGL) { - // draw tab - if (openGLMode != RENDER_SAFE_OPENGL) + const ImageRect &rect = skin->getBorder(); + if (mRedraw || mode != mMode || g->getRedraw()) { - const ImageRect &rect = skin->getBorder(); - if (mRedraw || mode != mMode || g->getRedraw()) - { - mMode = mode; - mRedraw = false; - mVertexes->clear(); - g->calcWindow(mVertexes, 0, 0, - mDimension.width, mDimension.height, rect); - - if (mImage) - { - const Skin *const skin1 = tabImg[TAB_STANDARD]; - if (skin1) - { - const int padding = skin1->getPadding(); - g->calcTile(mVertexes, mImage, padding, padding); - } - } - } + mMode = mode; + mRedraw = false; + mVertexes->clear(); + g->calcWindow(mVertexes, 0, 0, + mDimension.width, mDimension.height, rect); - g->drawTile(mVertexes); - } - else - { - g->drawImageRect(0, 0, - mDimension.width, mDimension.height, skin->getBorder()); if (mImage) { const Skin *const skin1 = tabImg[TAB_STANDARD]; if (skin1) { const int padding = skin1->getPadding(); - g->drawImage(mImage, padding, padding); + g->calcTile(mVertexes, mImage, padding, padding); } } } + + g->drawTile(mVertexes); + } + else + { + g->drawImageRect(0, 0, + mDimension.width, mDimension.height, skin->getBorder()); + if (mImage) + { + const Skin *const skin1 = tabImg[TAB_STANDARD]; + if (skin1) + { + const int padding = skin1->getPadding(); + g->drawImage(mImage, padding, padding); + } + } } drawChildren(graphics); |