FIX: [STUDIO-3513] the objectlist always enters wxEVT_SIZE

the objectlist always enters wxEVT_SIZE when scaling

Change-Id: I93371cee86437bc0309f041b0d59f28bc3b206aa
This commit is contained in:
maosheng.wei 2023-07-12 18:23:34 +08:00 committed by Lane.Wei
parent 2aca9da207
commit 2515a1adf7
2 changed files with 8 additions and 1 deletions

View file

@ -272,6 +272,12 @@ ObjectList::ObjectList(wxWindow* parent) :
//Bind(wxCUSTOMEVT_LAST_VOLUME_IS_DELETED, [this](wxCommandEvent& e) { last_volume_is_deleted(e.GetInt()); });
Bind(wxEVT_SIZE, ([this](wxSizeEvent &e) {
if (m_last_size == this->GetSize()) {
e.Skip();
return;
} else {
m_last_size = this->GetSize();
}
#ifdef __WXGTK__
// On GTK, the EnsureVisible call is postponed to Idle processing (see wxDataViewCtrl::m_ensureVisibleDefered).
// So the postponed EnsureVisible() call is planned for an item, which may not exist at the Idle processing time, if this wxEVT_SIZE
@ -286,7 +292,7 @@ ObjectList::ObjectList(wxWindow* parent) :
#endif
e.Skip();
}));
m_last_size = this->GetSize();
}
ObjectList::~ObjectList()