summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-16 20:39:33 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-16 20:39:33 +0300
commitbc92643d8db723b5049db2dbad1ce052a0ae77a9 (patch)
tree4471be99711ee310c811e990d7c210e2393aeb6e /src/gui/widgets
parent82cc576b7896f39bcf71aa85c8c4b3ef786c065b (diff)
downloadmanaverse-bc92643d8db723b5049db2dbad1ce052a0ae77a9.tar.gz
manaverse-bc92643d8db723b5049db2dbad1ce052a0ae77a9.tar.bz2
manaverse-bc92643d8db723b5049db2dbad1ce052a0ae77a9.tar.xz
manaverse-bc92643d8db723b5049db2dbad1ce052a0ae77a9.zip
Fix code style and some other minor issues.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/extendedlistbox.cpp3
-rw-r--r--src/gui/widgets/listbox.cpp5
-rw-r--r--src/gui/widgets/progressbar.cpp4
-rw-r--r--src/gui/widgets/progressindicator.cpp7
4 files changed, 8 insertions, 11 deletions
diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp
index 249254cde..0acf66a65 100644
--- a/src/gui/widgets/extendedlistbox.cpp
+++ b/src/gui/widgets/extendedlistbox.cpp
@@ -83,7 +83,8 @@ void ExtendedListBox::draw(gcn::Graphics *graphics)
const Image *const image = model->getImageAt(i);
if (!image)
{
- graphics->drawText(mListModel->getElementAt(i), mPadding, y + textPos);
+ graphics->drawText(mListModel->getElementAt(i),
+ mPadding, y + textPos);
}
else
{
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp
index 8e56cfe9f..7885307e6 100644
--- a/src/gui/widgets/listbox.cpp
+++ b/src/gui/widgets/listbox.cpp
@@ -47,7 +47,8 @@ ListBox::ListBox(gcn::ListModel *const listModel):
gcn::ListBox(listModel),
mHighlightColor(Theme::getThemeColor(Theme::HIGHLIGHT)),
mDistributeMousePressed(true),
- mOldSelected(-1)
+ mOldSelected(-1),
+ mPadding(0)
{
mForegroundColor = Theme::getThemeColor(Theme::LISTBOX);
@@ -60,8 +61,6 @@ ListBox::ListBox(gcn::ListModel *const listModel):
if (mSkin)
mPadding = mSkin->getPadding();
- else
- mPadding = 0;
adjustSize();
}
diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp
index 6dc6346b8..5ab6d1280 100644
--- a/src/gui/widgets/progressbar.cpp
+++ b/src/gui/widgets/progressbar.cpp
@@ -56,8 +56,8 @@ ProgressBar::ProgressBar(float progress,
mFillPadding(3)
{
// The progress value is directly set at load time:
- if (progress > 1.0f || progress < 0.0f)
- progress = 1.0f;
+ if (mProgress > 1.0f || mProgress < 0.0f)
+ mProgress = 1.0f;
mColor = Theme::getProgressColor(color >= 0 ? color : 0, mProgress);
mColorToGo = mColor;
diff --git a/src/gui/widgets/progressindicator.cpp b/src/gui/widgets/progressindicator.cpp
index 565d83da7..6ff31fd0e 100644
--- a/src/gui/widgets/progressindicator.cpp
+++ b/src/gui/widgets/progressindicator.cpp
@@ -35,7 +35,8 @@
#include "debug.h"
ProgressIndicator::ProgressIndicator() :
- gcn::Widget()
+ gcn::Widget(),
+ mIndicator(nullptr)
{
ImageSet *const images = Theme::getImageSetFromTheme(
"progress-indicator.png", 32, 32);
@@ -50,10 +51,6 @@ ProgressIndicator::ProgressIndicator() :
images->decRef();
}
- else
- {
- mIndicator = nullptr;
- }
setSize(32, 32);
}