summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qcocoawindowdelegate_mac.mm
diff options
context:
space:
mode:
authorPrasanth Ullattil <prasanth.ullattil@nokia.com>2010-07-28 08:13:33 (GMT)
committerPrasanth Ullattil <prasanth.ullattil@nokia.com>2010-07-28 12:41:07 (GMT)
commit68c091c29eb8204a2959858e305b26b850801250 (patch)
tree6362bfdda1cd97f5041e35ac169954ccc3c37cc6 /src/gui/kernel/qcocoawindowdelegate_mac.mm
parentd1024fa94a9358b4f6839c8321c49ca6343e7bd2 (diff)
downloadQt-68c091c29eb8204a2959858e305b26b850801250.zip
Qt-68c091c29eb8204a2959858e305b26b850801250.tar.gz
Qt-68c091c29eb8204a2959858e305b26b850801250.tar.bz2
Wrong geometery for QMainWindow with Unified toolbar on Cocoa.
If a mainwindow is shown maximized (initially) with unified toolbar, the top portion of the widget gets hidden underneath the native toolbar. This is because while showing the window, the toolbar is resized. Which causes the client area of the NSWindow to resize, we need to update the frame of the NSView for QMainWindow based on this new size. Task-number: QTBUG-10500 Reviewed-by: Denis
Diffstat (limited to 'src/gui/kernel/qcocoawindowdelegate_mac.mm')
-rw-r--r--src/gui/kernel/qcocoawindowdelegate_mac.mm20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/kernel/qcocoawindowdelegate_mac.mm b/src/gui/kernel/qcocoawindowdelegate_mac.mm
index 2b9cf85..ffba6c2 100644
--- a/src/gui/kernel/qcocoawindowdelegate_mac.mm
+++ b/src/gui/kernel/qcocoawindowdelegate_mac.mm
@@ -394,5 +394,25 @@ static void cleanupCocoaWindowDelegate()
}
return NO;
}
+
+- (void)syncContentViewFrame: (NSNotification *)notification
+{
+ NSView *cView = [notification object];
+ if (cView) {
+ NSWindow *window = [cView window];
+ QWidget *qwidget = m_windowHash->value(window);
+ if (qwidget) {
+ QWidgetData *widgetData = qt_qwidget_data(qwidget);
+ NSRect rect = [cView frame];
+ const QSize newSize(rect.size.width, rect.size.height);
+ const QSize &oldSize = widgetData->crect.size();
+ if (newSize != oldSize) {
+ [self syncSizeForWidget:qwidget toSize:newSize fromSize:oldSize];
+ }
+ }
+
+ }
+}
+
@end
#endif// QT_MAC_USE_COCOA