aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPWindowControllerDelegate.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2013-01-05 21:59:32 +0000
committerrowanbeentje <rowan@beent.je>2013-01-05 21:59:32 +0000
commita3a738ea230ead792aa747e4a66ced6e8bea8562 (patch)
tree3fb47c41a7594fac74ff6e1c77158df4f334ab4f /Source/SPWindowControllerDelegate.m
parent8d397ab95afd68d5f9d7ecf5267c9a11a72d04c6 (diff)
downloadsequelpro-a3a738ea230ead792aa747e4a66ced6e8bea8562.tar.gz
sequelpro-a3a738ea230ead792aa747e4a66ced6e8bea8562.tar.bz2
sequelpro-a3a738ea230ead792aa747e4a66ced6e8bea8562.zip
- Call the NSWindow super implementation of validateMenuItem: in SPWindow, fixing Show Toolbar/Hide Toolbar menu item title not being updated correctly - addresses Issue #1521
- When the toolbar is hidden, draw a line in the window to cover up the bottom border of the window's title bar, improving appearance - Improve tab appearance when toolbar is hidden
Diffstat (limited to 'Source/SPWindowControllerDelegate.m')
-rw-r--r--Source/SPWindowControllerDelegate.m23
1 files changed, 21 insertions, 2 deletions
diff --git a/Source/SPWindowControllerDelegate.m b/Source/SPWindowControllerDelegate.m
index b4be90b5..ef52d4ef 100644
--- a/Source/SPWindowControllerDelegate.m
+++ b/Source/SPWindowControllerDelegate.m
@@ -42,6 +42,7 @@
@interface SPWindowController (SPDeclaredAPI)
- (void)_updateProgressIndicatorForItem:(NSTabViewItem *)theItem;
+- (void)_updateLineHidingViewState;
@end
@@ -113,6 +114,7 @@
*/
- (void)windowDidResignKey:(NSNotification *)notification
{
+
// Disable the "Close tab" menu item
[closeTabMenuItem setEnabled:NO];
[closeTabMenuItem setKeyEquivalent:@""];
@@ -123,6 +125,21 @@
}
/**
+ * Observe changes in main window status to update drawing state to match
+ */
+- (void)windowDidBecomeMain:(NSNotification *)notification
+{
+ [self _updateLineHidingViewState];
+}
+- (void)windowDidResignMain:(NSNotification *)notification
+{
+ [self _updateLineHidingViewState];
+
+ // Update the state again after a short delay to catch attached sheets being main
+ [self performSelector:@selector(_updateLineHidingViewState) withObject:nil afterDelay:0.1];
+}
+
+/**
* If the window is resized, notify all the tabs.
*/
- (void)windowDidResize:(NSNotification *)notification
@@ -141,6 +158,7 @@
- (void)windowWillEnterFullScreen:(NSNotification *)notification
{
[selectedTableDocument updateTitlebarStatusVisibilityForcingHide:YES];
+ [self _updateLineHidingViewState];
}
/**
@@ -149,6 +167,7 @@
- (void)windowDidExitFullScreen:(NSNotification *)notification
{
[selectedTableDocument updateTitlebarStatusVisibilityForcingHide:NO];
+ [self _updateLineHidingViewState];
}
#pragma mark -
@@ -171,9 +190,9 @@
selectedTableDocument = [tabViewItem identifier];
[selectedTableDocument didBecomeActiveTabInWindow];
-
+
if ([[self window] isKeyWindow]) [selectedTableDocument tabDidBecomeKey];
-
+
[self updateAllTabTitles:self];
}