diff --git a/src/gui/control/gallery_list.cpp b/src/gui/control/gallery_list.cpp index c302e68c..093751d7 100644 --- a/src/gui/control/gallery_list.cpp +++ b/src/gui/control/gallery_list.cpp @@ -83,6 +83,7 @@ void GalleryList::update() { } updateScrollbar(); Refresh(false); + InvalidateBestSize(); } size_t GalleryList::findItem(const wxMouseEvent& ev) const { @@ -263,13 +264,14 @@ void GalleryList::onChar(wxKeyEvent& ev) { } } -wxSize GalleryList::DoGetBestClientSize() const { +wxSize GalleryList::DoGetBestSize() const { + wxSize ws = GetSize(), cs = GetClientSize(); const int w = item_size.x + 2*MARGIN + 2*BORDER; const int h = item_size.y + 2*MARGIN + 2*BORDER; if (direction == wxHORIZONTAL) { - return wxSize(w, h * (int)column_count); + return wxSize(w, h * (int)column_count) + ws - cs; } else { - return wxSize(w * (int)column_count, h); + return wxSize(w * (int)column_count, h) + ws - cs; } } diff --git a/src/gui/control/gallery_list.hpp b/src/gui/control/gallery_list.hpp index 1630cf89..33c6bb72 100644 --- a/src/gui/control/gallery_list.hpp +++ b/src/gui/control/gallery_list.hpp @@ -71,7 +71,7 @@ class GalleryList : public wxPanel { virtual void onSelect(size_t item, size_t col, bool& changes) {} /// Return the desired size of control - virtual wxSize DoGetBestClientSize() const; + virtual wxSize DoGetBestSize() const; /// Information on the subcolumns. These are columns inside items struct SubColumn {