summaryrefslogtreecommitdiff
path: root/src/gui/widgets/extendedlistbox.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-29 00:16:54 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-29 00:16:54 +0300
commit0cd049b5b56b34b0b7ab3e3eac93dcb255c4e118 (patch)
tree5dedc441dcf535f8ac4b43f8b8ea0bb27c8ba6ac /src/gui/widgets/extendedlistbox.cpp
parent7c51eee345d27e680a26a915ffccb2d0abf063ea (diff)
downloadmanaplus-0cd049b5b56b34b0b7ab3e3eac93dcb255c4e118.tar.gz
manaplus-0cd049b5b56b34b0b7ab3e3eac93dcb255c4e118.tar.bz2
manaplus-0cd049b5b56b34b0b7ab3e3eac93dcb255c4e118.tar.xz
manaplus-0cd049b5b56b34b0b7ab3e3eac93dcb255c4e118.zip
Show flags icons in language selection list
Also add support for extended listboxes in popuplist control.
Diffstat (limited to 'src/gui/widgets/extendedlistbox.cpp')
-rw-r--r--src/gui/widgets/extendedlistbox.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp
index b932f91b0..8c850775a 100644
--- a/src/gui/widgets/extendedlistbox.cpp
+++ b/src/gui/widgets/extendedlistbox.cpp
@@ -37,12 +37,21 @@
#include "debug.h"
ExtendedListBox::ExtendedListBox(const Widget2 *const widget,
- gcn::ListModel *const listModel) :
+ gcn::ListModel *const listModel,
+ int rowHeight) :
ListBox(widget, listModel),
- mRowHeight(13),
+ mRowHeight(rowHeight),
mImagePadding(mSkin ? mSkin->getOption("imagePadding") : 0),
mSpacing(mSkin ? mSkin->getOption("spacing") : 0)
{
+ if (!mRowHeight)
+ {
+ const gcn::Font *font = getFont();
+ if (font)
+ mRowHeight = font->getHeight() + 2 * mPadding;
+ else
+ mRowHeight = 13;
+ }
}
ExtendedListBox::~ExtendedListBox()