diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-16 03:22:50 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-16 03:25:37 +0300 |
commit | 82cc576b7896f39bcf71aa85c8c4b3ef786c065b (patch) | |
tree | 2207f3bb4a0b1fa896fe183da245287525d65117 /src/gui/skilldialog.cpp | |
parent | 6bbe09af6faa77df40112e7cf876877ef11ce74b (diff) | |
download | plus-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/skilldialog.cpp')
-rw-r--r-- | src/gui/skilldialog.cpp | 9 |
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; |