From 9ee866551f98a994a241aa61d87bc8acf94cd2f5 Mon Sep 17 00:00:00 2001 From: Andreas Falkenhahn Date: Tue, 22 Dec 2020 02:04:32 +0100 Subject: [PATCH] Mac: Update column width when expanding/collapsing Adjust autosizing columns of wxDataViewCtrl when items are expanded or collapsed through the UI as well. Complements commit e89e76bb82. See #14939. See #19003. --- src/osx/cocoa/dataview.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index 46af4690db..361407cb5a 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -1643,6 +1643,7 @@ outlineView:(NSOutlineView*)outlineView currentlyEditedColumn = currentlyEditedRow = -1; + [self setAutoresizesOutlineColumn:NO]; [self registerForDraggedTypes:[NSArray arrayWithObjects:DataViewPboardType,NSStringPboardType,nil]]; [self setDelegate:self]; [self setDoubleAction:@selector(actionDoubleClick:)]; @@ -1900,6 +1901,8 @@ outlineView:(NSOutlineView*)outlineView [[notification userInfo] objectForKey:@"NSObject"]); wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_COLLAPSED, dvc, item); dvc->GetEventHandler()->ProcessEvent(event); + + dvc->AdjustAutosizedColumns(); } -(void) outlineViewItemDidExpand:(NSNotification*)notification @@ -1910,6 +1913,8 @@ outlineView:(NSOutlineView*)outlineView [[notification userInfo] objectForKey:@"NSObject"]); wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_EXPANDED, dvc, item); dvc->GetEventHandler()->ProcessEvent(event); + + dvc->AdjustAutosizedColumns(); } -(void) outlineViewSelectionDidChange:(NSNotification*)notification