Fix wxGenericCollapsiblePane best size calculation

DoGetBestSize() actually calculated the best client size and not the
full size, as it didn't take the pane border into account.

Fix this in the simplest possible way, by just renaming the function to
DoGetBestClientSize() instead.

This ensures that the pane is actually big enough to show its contents,
without cutting off the text shown in its header.

Closes #18515.
This commit is contained in:
Vadim Zeitlin
2019-09-30 23:28:40 +02:00
parent 5d904856aa
commit ef7ab73206
3 changed files with 11 additions and 3 deletions

View File

@@ -73,7 +73,7 @@ public:
protected:
// overridden methods
virtual wxSize DoGetBestSize() const wxOVERRIDE;
virtual wxSize DoGetBestClientSize() const wxOVERRIDE;
int GetBorder() const;

View File

@@ -112,7 +112,7 @@ wxGenericCollapsiblePane::~wxGenericCollapsiblePane()
wxDELETE(m_sz);
}
wxSize wxGenericCollapsiblePane::DoGetBestSize() const
wxSize wxGenericCollapsiblePane::DoGetBestClientSize() const
{
// NB: do not use GetSize() but rather GetMinSize()
wxSize sz = m_sz->GetMinSize();

View File

@@ -220,7 +220,15 @@ bool wxOSXDataViewModelNotifier::ValueChanged(wxDataViewItem const& item, unsign
bool wxOSXDataViewModelNotifier::Cleared()
{
return m_DataViewCtrlPtr->GetDataViewPeer()->Reload();
// As when individual items are deleted, we must ensure that we don't touch
// the model item possibly being edited, as it's not valid any more.
m_DataViewCtrlPtr->SetDeleting(true);
const bool rc = m_DataViewCtrlPtr->GetDataViewPeer()->Reload();
m_DataViewCtrlPtr->SetDeleting(false);
return rc;
}
void wxOSXDataViewModelNotifier::Resort()