From 5700005243d903a3135a005527d858313dee8734 Mon Sep 17 00:00:00 2001 From: Twan van Laarhoven Date: Fri, 10 Apr 2020 16:57:21 +0200 Subject: [PATCH] Cleanup: use DoGetBestClientSize --- src/gui/control/gallery_list.cpp | 7 +++---- src/gui/control/gallery_list.hpp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gui/control/gallery_list.cpp b/src/gui/control/gallery_list.cpp index 1a137685..4ed369a4 100644 --- a/src/gui/control/gallery_list.cpp +++ b/src/gui/control/gallery_list.cpp @@ -265,14 +265,13 @@ void GalleryList::onChar(wxKeyEvent& ev) { } } -wxSize GalleryList::DoGetBestSize() const { - wxSize ws = GetSize(), cs = GetClientSize(); +wxSize GalleryList::DoGetBestClientSize() const { 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) + ws - cs; + return wxSize(w, h * (int)column_count); } else { - return wxSize(w * (int)column_count, h) + ws - cs; + return wxSize(w * (int)column_count, h); } } diff --git a/src/gui/control/gallery_list.hpp b/src/gui/control/gallery_list.hpp index 1c3691dd..cd92d249 100644 --- a/src/gui/control/gallery_list.hpp +++ b/src/gui/control/gallery_list.hpp @@ -72,7 +72,7 @@ class GalleryList : public wxPanel { virtual void onSelect(size_t item, size_t col, bool& changes) {} /// Return the desired size of control - virtual wxSize DoGetBestSize() const; + virtual wxSize DoGetBestClientSize() const; /// Information on the subcolumns. These are columns inside items struct SubColumn {