diff options
Diffstat (limited to 'src/gui/widgets/listbox.cpp')
-rw-r--r-- | src/gui/widgets/listbox.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index 259e49972..3592b12da 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -48,6 +48,7 @@ ListBox::ListBox(gcn::ListModel *const listModel): mOldSelected(-1) { mForegroundColor = Theme::getThemeColor(Theme::LISTBOX); + adjustSize(); } ListBox::~ListBox() @@ -193,3 +194,14 @@ void ListBox::refocus() if (isFocusable()) mFocusHandler->requestFocus(this); } + +void ListBox::adjustSize() +{ + if (mListModel) + setHeight(getRowHeight() * mListModel->getNumberOfElements()); +} + +void ListBox::logic() +{ + adjustSize(); +} |