summaryrefslogtreecommitdiff
path: root/src/gui/skilldialog.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/skilldialog.cpp
parent6bbe09af6faa77df40112e7cf876877ef11ce74b (diff)
downloadmanaplus-82cc576b7896f39bcf71aa85c8c4b3ef786c065b.tar.gz
manaplus-82cc576b7896f39bcf71aa85c8c4b3ef786c065b.tar.bz2
manaplus-82cc576b7896f39bcf71aa85c8c4b3ef786c065b.tar.xz
manaplus-82cc576b7896f39bcf71aa85c8c4b3ef786c065b.zip
Add listbox padding.
New theme file: listbox.xml Theme option: padding
Diffstat (limited to 'src/gui/skilldialog.cpp')
-rw-r--r--src/gui/skilldialog.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp
index a735bf1b4..063e29939 100644
--- a/src/gui/skilldialog.cpp
+++ b/src/gui/skilldialog.cpp
@@ -138,8 +138,9 @@ class SkillListBox final : public ListBox
// Draw filled rectangle around the selected list element
if (mSelected >= 0)
{
- graphics->fillRectangle(gcn::Rectangle(0, getRowHeight()
- * mSelected, getWidth(), getRowHeight()));
+ graphics->fillRectangle(gcn::Rectangle(mPadding, getRowHeight()
+ * mSelected + mPadding, getWidth() - 2 * mPadding,
+ getRowHeight()));
}
// Draw the list elements
@@ -150,7 +151,7 @@ class SkillListBox final : public ListBox
{
SkillInfo *const e = model->getSkillAt(i);
if (e)
- e->draw(graphics, y, getWidth());
+ e->draw(graphics, y + mPadding, getWidth() + mPadding);
}
}
@@ -166,7 +167,7 @@ class SkillListBox final : public ListBox
const int y = event.getY() / getRowHeight();
if (!mModel || y >= mModel->getNumberOfElements())
return;
- const SkillInfo *const skill = mModel->getSkillAt(y);
+ const SkillInfo *const skill = mModel->getSkillAt(y + mPadding);
if (!skill)
return;