Permalink
Browse files

#2863 fix LHS table views when dragging a tab off a window

  • Loading branch information...
abhibeckert committed Aug 25, 2017
1 parent ff0e2a8 commit 16cf257c447d9692ce19280c510f11afa0ac12fa
Showing with 13 additions and 0 deletions.
  1. +2 −0 Source/SPDatabaseDocument.h
  2. +11 −0 Source/SPWindowControllerDelegate.m
@@ -291,6 +291,8 @@
int64_t instanceId;
}
@property (assign) NSTableView *dbTablesTableView;
#ifdef SP_CODA /* ivars */
@property (assign) SPDatabaseData* databaseDataInstance;
@property (assign) SPTableData* tableDataInstance;
@@ -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 @@ - (void)tabView:(NSTabView*)aTabView didDropTabViewItem:(NSTabViewItem *)tabView
// 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;
});
}
/**

0 comments on commit 16cf257

Please sign in to comment.