Postpone EnsureVisible() to idle as this sometimes seems to be required, fixes #12480: wxDataViewCtrl::EnsureVisible does not make item visible in some
circumstances on GTK git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -200,6 +200,7 @@ private:
|
|||||||
GtkWidget *m_treeview;
|
GtkWidget *m_treeview;
|
||||||
wxDataViewCtrlInternal *m_internal;
|
wxDataViewCtrlInternal *m_internal;
|
||||||
wxDataViewColumnList m_cols;
|
wxDataViewColumnList m_cols;
|
||||||
|
wxDataViewItem m_ensureVisibleDefered;
|
||||||
|
|
||||||
virtual void AddChildGTK(wxWindowGTK* child);
|
virtual void AddChildGTK(wxWindowGTK* child);
|
||||||
void GtkEnableSelectionEvents();
|
void GtkEnableSelectionEvents();
|
||||||
|
@@ -4548,6 +4548,16 @@ void wxDataViewCtrl::OnInternalIdle()
|
|||||||
wxDataViewColumn *col = GetColumn( i );
|
wxDataViewColumn *col = GetColumn( i );
|
||||||
col->OnInternalIdle();
|
col->OnInternalIdle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_ensureVisibleDefered.IsOk())
|
||||||
|
{
|
||||||
|
ExpandAncestors(m_ensureVisibleDefered);
|
||||||
|
GtkTreeIter iter;
|
||||||
|
iter.user_data = (gpointer) m_ensureVisibleDefered.GetID();
|
||||||
|
wxGtkTreePath path(m_internal->get_path( &iter ));
|
||||||
|
gtk_tree_view_scroll_to_cell( GTK_TREE_VIEW(m_treeview), path, NULL, false, 0.0, 0.0 );
|
||||||
|
m_ensureVisibleDefered = wxDataViewItem(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDataViewCtrl::AssociateModel( wxDataViewModel *model )
|
bool wxDataViewCtrl::AssociateModel( wxDataViewModel *model )
|
||||||
@@ -4948,6 +4958,7 @@ void wxDataViewCtrl::UnselectAll()
|
|||||||
void wxDataViewCtrl::EnsureVisible(const wxDataViewItem& item,
|
void wxDataViewCtrl::EnsureVisible(const wxDataViewItem& item,
|
||||||
const wxDataViewColumn *WXUNUSED(column))
|
const wxDataViewColumn *WXUNUSED(column))
|
||||||
{
|
{
|
||||||
|
m_ensureVisibleDefered = item;
|
||||||
ExpandAncestors(item);
|
ExpandAncestors(item);
|
||||||
|
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
|
Reference in New Issue
Block a user