summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-06-30 15:07:16 (GMT)
committerNorwegian Rock Cat <qt-info@nokia.com>2009-06-30 15:15:41 (GMT)
commit11ee32888b1b2370c70708e1385c26dc3a0a367c (patch)
tree7c1e40575bdcbf8745b3fcfe96358c2a5432a96f /src/gui/kernel
parent5d40eff80123b2739987fbf7fc720b0c6ad91226 (diff)
downloadQt-11ee32888b1b2370c70708e1385c26dc3a0a367c.zip
Qt-11ee32888b1b2370c70708e1385c26dc3a0a367c.tar.gz
Qt-11ee32888b1b2370c70708e1385c26dc3a0a367c.tar.bz2
Fix Toolbars in unified toolbar looking bad Carbon w/Fullscreen changes
There was a bug in the Carbon code when an item went in full-screen, than out with a unified toolbar. In those cases the toolbars would end up getting but into the mainwindow area. The reason this was happening was that we were calling transferChildren() after we had set up our toolbar. This cause problems because we end up pulling the QToolbars right out of the unified toolbar. The easiest way to solve this is to just update the status on it again. This should solve any issues. I also added some logic to avoid calling this too many times in that one case. Luckily, this seems to only affect Carbon. Task-number: 254462 Reviewed-by: Jens Bache-Wiig
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qwidget_mac.mm19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 1c71fbd..ec9a049 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -2730,10 +2730,15 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
createWinId();
if (q->isWindow()) {
#ifndef QT_MAC_USE_COCOA
- if (QMainWindowLayout *mwl = qobject_cast<QMainWindowLayout *>(q->layout())) {
- mwl->updateHIToolBarStatus();
+ // We do this down below for wasCreated, so avoid doing this twice
+ // (only for performance, it gets called a lot anyway).
+ if (!wasCreated) {
+ if (QMainWindowLayout *mwl = qobject_cast<QMainWindowLayout *>(q->layout())) {
+ mwl->updateHIToolBarStatus();
+ }
}
#else
+ // Simply transfer our toolbar over. Everything should stay put, unlike in Carbon.
if (oldToolbar && !(f & Qt::FramelessWindowHint)) {
OSWindowRef newWindow = qt_mac_window_for(q);
[newWindow setToolbar:oldToolbar];
@@ -2748,6 +2753,16 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
if (wasCreated) {
transferChildren();
+#ifndef QT_MAC_USE_COCOA
+ // If we were a unified window, We just transfered our toolbars out of the unified toolbar.
+ // So redo the status one more time. It apparently is not an issue with Cocoa.
+ if (q->isWindow()) {
+ if (QMainWindowLayout *mwl = qobject_cast<QMainWindowLayout *>(q->layout())) {
+ mwl->updateHIToolBarStatus();
+ }
+ }
+#endif
+
if (topData &&
(!topData->caption.isEmpty() || !topData->filePath.isEmpty()))
setWindowTitle_helper(q->windowTitle());