From 16cf257c447d9692ce19280c510f11afa0ac12fa Mon Sep 17 00:00:00 2001 From: Abhi Beckert Date: Fri, 25 Aug 2017 10:19:58 +1000 Subject: #2863 fix LHS table views when dragging a tab off a window --- Source/SPDatabaseDocument.h | 2 ++ Source/SPWindowControllerDelegate.m | 11 +++++++++++ 2 files changed, 13 insertions(+) (limited to 'Source') diff --git a/Source/SPDatabaseDocument.h b/Source/SPDatabaseDocument.h index fc00f647..5430b39f 100644 --- a/Source/SPDatabaseDocument.h +++ b/Source/SPDatabaseDocument.h @@ -291,6 +291,8 @@ int64_t instanceId; } +@property (assign) NSTableView *dbTablesTableView; + #ifdef SP_CODA /* ivars */ @property (assign) SPDatabaseData* databaseDataInstance; @property (assign) SPTableData* tableDataInstance; diff --git a/Source/SPWindowControllerDelegate.m b/Source/SPWindowControllerDelegate.m index 009dc0a4..ba7f6303 100644 --- a/Source/SPWindowControllerDelegate.m +++ b/Source/SPWindowControllerDelegate.m @@ -33,6 +33,8 @@ #import "SPDatabaseDocument.h" #import "SPDatabaseViewController.h" #import "SPAppController.h" +#import "SPConnectionController.h" +#import "SPFavoritesOutlineView.h" #import #import @@ -248,6 +250,15 @@ // Check the window and move it to front if it's key (eg for new window creation) if ([[tabBarControl window] isKeyWindow]) [[tabBarControl window] orderFront:self]; + + // workaround bug where "source list" table views are broken in the new window. See https://github.com/sequelpro/sequelpro/issues/2863 + SPWindowController *newWindowController = tabBarControl.window.windowController; + newWindowController.selectedTableDocument.connectionController.favoritesOutlineView.selectionHighlightStyle = NSTableViewSelectionHighlightStyleRegular; + newWindowController.selectedTableDocument.dbTablesTableView.selectionHighlightStyle = NSTableViewSelectionHighlightStyleRegular; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0)), dispatch_get_main_queue(), ^{ + newWindowController.selectedTableDocument.dbTablesTableView.selectionHighlightStyle = NSTableViewSelectionHighlightStyleSourceList; + newWindowController.selectedTableDocument.connectionController.favoritesOutlineView.selectionHighlightStyle = NSTableViewSelectionHighlightStyleSourceList; + }); } /** -- cgit v1.2.3