summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorHal9000 <miglietta.francesco@gmail.com>2013-01-30 19:48:45 +0100
committerHal9000 <miglietta.francesco@gmail.com>2013-01-30 19:48:45 +0100
commit80564f8664bf44f35c5339487e14e8a3d930c7b2 (patch)
tree3a9f5e8dc7083b4fcd872e2a0f2d874b070a1b70 /src/gui
parent9426129bc51ef8b63ddd4b76999dee4a86ce4de7 (diff)
downloadplus-80564f8664bf44f35c5339487e14e8a3d930c7b2.tar.gz
plus-80564f8664bf44f35c5339487e14e8a3d930c7b2.tar.bz2
plus-80564f8664bf44f35c5339487e14e8a3d930c7b2.tar.xz
plus-80564f8664bf44f35c5339487e14e8a3d930c7b2.zip
Extend themability of avatarlistbox.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/avatarlistbox.cpp13
-rw-r--r--src/gui/widgets/avatarlistbox.h1
2 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp
index 92a6443be..ff62b0155 100644
--- a/src/gui/widgets/avatarlistbox.cpp
+++ b/src/gui/widgets/avatarlistbox.cpp
@@ -48,7 +48,8 @@ AvatarListBox::AvatarListBox(const Widget2 *const widget,
ListBox(widget, model, "avatarlistbox.xml"),
mShowGender(config.getBoolValue("showgender")),
mShowLevel(config.getBoolValue("showlevel")),
- mHighlightColor(getThemeColor(Theme::HIGHLIGHT))
+ mHighlightColor(getThemeColor(Theme::HIGHLIGHT)),
+ mImagePadding(mSkin ? mSkin->getOption("imagePadding") : 0)
{
instances++;
@@ -127,7 +128,7 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics)
const Image *const icon = a->getOnline()
? onlineIcon : offlineIcon;
if (icon)
- graphics->drawImage(icon, mPadding, y + mPadding);
+ graphics->drawImage(icon, mImagePadding, y + mPadding);
}
std::string text;
@@ -268,20 +269,20 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics)
{
if (a->getType() == MapItem::SEPARATOR)
{
- boldFont->drawString(graphics, text, mPadding, y + mPadding);
+ boldFont->drawString(graphics, text, mImagePadding + mPadding, y + mPadding);
}
else
{
boldFont->drawString(graphics, text,
- 15 + mPadding, y + mPadding);
+ 15 + mImagePadding + mPadding, y + mPadding);
}
}
else
{
if (a->getType() == MapItem::SEPARATOR)
- font->drawString(graphics, text, mPadding, y + mPadding);
+ font->drawString(graphics, text, mImagePadding + mPadding, y + mPadding);
else
- font->drawString(graphics, text, 15 + mPadding, y + mPadding);
+ font->drawString(graphics, text, 15 + mImagePadding + mPadding, y + mPadding);
}
}
diff --git a/src/gui/widgets/avatarlistbox.h b/src/gui/widgets/avatarlistbox.h
index e48c00bd1..7d283abea 100644
--- a/src/gui/widgets/avatarlistbox.h
+++ b/src/gui/widgets/avatarlistbox.h
@@ -64,6 +64,7 @@ public:
private:
bool mShowGender;
bool mShowLevel;
+ int mImagePadding;
gcn::Color mHighlightColor;
static int instances;