diff options
author | Abhi Beckert <abhi@abhibeckert.com> | 2017-08-25 10:19:58 +1000 |
---|---|---|
committer | Abhi Beckert <abhi@abhibeckert.com> | 2017-08-25 10:19:58 +1000 |
commit | 16cf257c447d9692ce19280c510f11afa0ac12fa (patch) | |
tree | 6a67d010d2d3c4b911936c0d2b06826c87241f7e /Source | |
parent | ff0e2a82ef4452abcb407449f82fbefaac323b5d (diff) | |
download | sequelpro-16cf257c447d9692ce19280c510f11afa0ac12fa.tar.gz sequelpro-16cf257c447d9692ce19280c510f11afa0ac12fa.tar.bz2 sequelpro-16cf257c447d9692ce19280c510f11afa0ac12fa.zip |
#2863 fix LHS table views when dragging a tab off a window
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPDatabaseDocument.h | 2 | ||||
-rw-r--r-- | Source/SPWindowControllerDelegate.m | 11 |
2 files changed, 13 insertions, 0 deletions
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 <PSMTabBar/PSMTabBarControl.h> #import <PSMTabBar/PSMTabStyle.h> @@ -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; + }); } /** |