Cleanup: use DoGetBestClientSize

This commit is contained in:
Twan van Laarhoven
2020-04-10 16:57:21 +02:00
parent 25fd7dc079
commit 5700005243
2 changed files with 4 additions and 5 deletions
+3 -4
View File
@@ -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);
}
}
+1 -1
View File
@@ -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 {