summaryrefslogtreecommitdiff
path: root/src/gui/serverdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-16 03:22:50 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-16 03:25:37 +0300
commit82cc576b7896f39bcf71aa85c8c4b3ef786c065b (patch)
tree2207f3bb4a0b1fa896fe183da245287525d65117 /src/gui/serverdialog.cpp
parent6bbe09af6faa77df40112e7cf876877ef11ce74b (diff)
downloadplus-82cc576b7896f39bcf71aa85c8c4b3ef786c065b.tar.gz
plus-82cc576b7896f39bcf71aa85c8c4b3ef786c065b.tar.bz2
plus-82cc576b7896f39bcf71aa85c8c4b3ef786c065b.tar.xz
plus-82cc576b7896f39bcf71aa85c8c4b3ef786c065b.zip
Add listbox padding.
New theme file: listbox.xml Theme option: padding
Diffstat (limited to 'src/gui/serverdialog.cpp')
-rw-r--r--src/gui/serverdialog.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index 408c1c3e2..673bfbcd5 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -186,8 +186,9 @@ public:
// Draw filled rectangle around the selected list element
if (mSelected >= 0)
{
- graphics->fillRectangle(gcn::Rectangle(0,
- height * mSelected, getWidth(), height));
+ graphics->fillRectangle(gcn::Rectangle(mPadding,
+ height * mSelected + mPadding, getWidth() - 2 * mPadding,
+ height));
}
// Draw the list elements
@@ -199,32 +200,32 @@ public:
graphics->setColor(mTextColor);
int top;
- int x = 2;
+ int x = mPadding;
if (!info.name.empty())
{
graphics->setFont(boldFont);
x += boldFont->getWidth(info.name) + 15;
- graphics->drawText(info.name, 2, y);
- top = y + boldFont->getHeight() + 2;
+ graphics->drawText(info.name, mPadding, y + mPadding);
+ top = y + boldFont->getHeight() + mPadding;
}
else
{
- top = y + height / 4 + 2;
+ top = y + height / 4 + mPadding;
}
graphics->setFont(getFont());
if (!info.description.empty())
- graphics->drawText(info.description, x, y);
- graphics->drawText(model->getElementAt(i), 2, top);
+ graphics->drawText(info.description, x, y + mPadding);
+ graphics->drawText(model->getElementAt(i), mPadding, top);
if (info.version.first > 0)
{
graphics->setColor(mNotSupportedColor);
graphics->drawText(info.version.second,
- getWidth() - info.version.first - 2, top);
+ getWidth() - info.version.first - mPadding, top);
}
}
}