From 80564f8664bf44f35c5339487e14e8a3d930c7b2 Mon Sep 17 00:00:00 2001 From: Hal9000 Date: Wed, 30 Jan 2013 19:48:45 +0100 Subject: Extend themability of avatarlistbox. --- src/gui/widgets/avatarlistbox.cpp | 13 +++++++------ src/gui/widgets/avatarlistbox.h | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/gui/widgets') 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; -- cgit v1.2.3-70-g09d2