Adjust the Web Inspector window title frame if needed to prevent it from intersecting...
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Nov 2012 21:10:37 +0000 (21:10 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Nov 2012 21:10:37 +0000 (21:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=102073

Reviewed by Joseph Pecoraro.

Source/WebKit/mac:

* WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindow _customTitleFrame]): Added. Adjust the title frame.

Source/WebKit2:

* UIProcess/mac/WebInspectorProxyMac.mm:
(-[WKWebInspectorWindow _customTitleFrame]): Added. Adjust the title frame.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@134471 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm

index 518c9a5..67db9eb 100644 (file)
@@ -1,3 +1,14 @@
+2012-11-13  Timothy Hatcher  <timothy@apple.com>
+
+        Adjust the Web Inspector window title frame if needed to prevent it from intersecting the dock button.
+
+        https://bugs.webkit.org/show_bug.cgi?id=102073
+
+        Reviewed by Joseph Pecoraro.
+
+        * WebCoreSupport/WebInspectorClient.mm:
+        (-[WebInspectorWindow _customTitleFrame]): Added. Adjust the title frame.
+
 2012-11-12  Simon Fraser  <simon.fraser@apple.com>
 
         Build fix after r134346 and 134347.
index 2586c2e..5334f32 100644 (file)
@@ -56,6 +56,7 @@ using namespace WebCore;
 
 @interface NSWindow (AppKitDetails)
 - (NSCursor *)_cursorForResizeDirection:(NSInteger)direction;
+- (NSRect)_customTitleFrame;
 @end
 
 @interface WebInspectorWindow : NSWindow {
@@ -75,6 +76,16 @@ using namespace WebCore;
     return [super _cursorForResizeDirection:direction];
 }
 
+- (NSRect)_customTitleFrame
+{
+    // Adjust the title frame if needed to prevent it from intersecting the dock button.
+    NSRect titleFrame = [super _customTitleFrame];
+    NSRect dockButtonFrame = _dockButton.get().frame;
+    if (NSMaxX(titleFrame) > NSMinX(dockButtonFrame) - dockButtonMargin)
+        titleFrame.size.width -= (NSMaxX(titleFrame) - NSMinX(dockButtonFrame)) + dockButtonMargin;
+    return titleFrame;
+}
+
 @end
 
 @interface WebInspectorWindowController : NSWindowController <NSWindowDelegate> {
index b559162..76ffe42 100644 (file)
@@ -1,3 +1,14 @@
+2012-11-13  Timothy Hatcher  <timothy@apple.com>
+
+        Adjust the Web Inspector window title frame if needed to prevent it from intersecting the dock button.
+
+        https://bugs.webkit.org/show_bug.cgi?id=102073
+
+        Reviewed by Joseph Pecoraro.
+
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        (-[WKWebInspectorWindow _customTitleFrame]): Added. Adjust the title frame.
+
 2012-11-13  Anders Carlsson  <andersca@apple.com>
 
         Store layer positions and sizes in the transaction
index 049f199..345cb04 100644 (file)
@@ -127,6 +127,7 @@ static const CGFloat dockButtonMargin = 3;
 
 @interface NSWindow (AppKitDetails)
 - (NSCursor *)_cursorForResizeDirection:(NSInteger)direction;
+- (NSRect)_customTitleFrame;
 @end
 
 @interface WKWebInspectorWindow : NSWindow {
@@ -146,6 +147,16 @@ static const CGFloat dockButtonMargin = 3;
     return [super _cursorForResizeDirection:direction];
 }
 
+- (NSRect)_customTitleFrame
+{
+    // Adjust the title frame if needed to prevent it from intersecting the dock button.
+    NSRect titleFrame = [super _customTitleFrame];
+    NSRect dockButtonFrame = _dockButton.get().frame;
+    if (NSMaxX(titleFrame) > NSMinX(dockButtonFrame) - dockButtonMargin)
+        titleFrame.size.width -= (NSMaxX(titleFrame) - NSMinX(dockButtonFrame)) + dockButtonMargin;
+    return titleFrame;
+}
+
 @end
 
 namespace WebKit {