summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/button.cpp4
-rw-r--r--src/gui/widgets/namesmodel.cpp2
-rw-r--r--src/gui/widgets/setupitem.cpp3
3 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index f0337766f..265815929 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -377,8 +377,8 @@ void Button::draw(gcn::Graphics *graphics)
const int width = font->getWidth(mCaption);
if (mImages)
{
- const int width = width + mImageWidth + spacing;
- imageX = getWidth() / 2 - width / 2;
+ const int w = width + mImageWidth + spacing;
+ imageX = (getWidth() - w) / 2;
textX = imageX + mImageWidth + spacing - width / 2;
}
else
diff --git a/src/gui/widgets/namesmodel.cpp b/src/gui/widgets/namesmodel.cpp
index 299eed355..186976d13 100644
--- a/src/gui/widgets/namesmodel.cpp
+++ b/src/gui/widgets/namesmodel.cpp
@@ -52,6 +52,6 @@ std::string NamesModel::getElementAt(int i)
void NamesModel::fillFromArray(const char *const *const arr, std::size_t sz)
{
- for (int f = 0; f < sz; f ++)
+ for (size_t f = 0; f < sz; f ++)
mNames.push_back(gettext(arr[f]));
}
diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp
index d3c46e0ec..dd2d16caf 100644
--- a/src/gui/widgets/setupitem.cpp
+++ b/src/gui/widgets/setupitem.cpp
@@ -562,7 +562,8 @@ SetupItemDropDown::SetupItemDropDown(std::string text,
mHorizont(nullptr),
mLabel(nullptr),
mModel(model),
- mDropDown(nullptr)
+ mDropDown(nullptr),
+ mWidth(width)
{
mValueType = VSTR;
createControls();