diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2009-11-24 09:49:01 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2009-11-24 10:03:37 (GMT) |
commit | 33bb49ba251ff2fb111d1cb393476e0ec0a84e34 (patch) | |
tree | 38684ed543ed61625e7a371709589b62d0142cdc | |
parent | 0d20ec8604b318ceafd6c35dfe1d73519bf024d3 (diff) | |
download | Qt-33bb49ba251ff2fb111d1cb393476e0ec0a84e34.zip Qt-33bb49ba251ff2fb111d1cb393476e0ec0a84e34.tar.gz Qt-33bb49ba251ff2fb111d1cb393476e0ec0a84e34.tar.bz2 |
Maximizing a window makes it a bit smaller that the minimum size:Cocoa
When returning preferred sizes for the frame, we should consider the
size for non client area elements like frame, tittlebar etc.
Task-number: 6090
Reviewed-by: Denis
-rw-r--r-- | src/gui/kernel/qcocoawindowdelegate_mac.mm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/kernel/qcocoawindowdelegate_mac.mm b/src/gui/kernel/qcocoawindowdelegate_mac.mm index 9fb674e..8a22a65 100644 --- a/src/gui/kernel/qcocoawindowdelegate_mac.mm +++ b/src/gui/kernel/qcocoawindowdelegate_mac.mm @@ -324,8 +324,13 @@ static void cleanupCocoaWindowDelegate() NSRect frameToReturn = defaultFrame; QWidget *qwidget = m_windowHash->value(window); QSizeF size = qwidget->maximumSize(); - frameToReturn.size.width = qMin<CGFloat>(frameToReturn.size.width, size.width()); - frameToReturn.size.height = qMin<CGFloat>(frameToReturn.size.height, size.height()); + NSRect windowFrameRect = [window frame]; + NSRect viewFrameRect = [[window contentView] frame]; + // consider additional size required for titlebar & frame + frameToReturn.size.width = qMin<CGFloat>(frameToReturn.size.width, + size.width()+(windowFrameRect.size.width - viewFrameRect.size.width)); + frameToReturn.size.height = qMin<CGFloat>(frameToReturn.size.height, + size.height()+(windowFrameRect.size.height - viewFrameRect.size.height)); return frameToReturn; } |