From df79293cc1412a19acb766f5404f1b7c185024c7 Mon Sep 17 00:00:00 2001 From: Stefan Schimanski Date: Thu, 23 Oct 2008 20:46:03 +0000 Subject: [PATCH] * fix fullscreen TOC switching between dock and drawer mode on Mac git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27063 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiToc.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/frontends/qt4/GuiToc.cpp b/src/frontends/qt4/GuiToc.cpp index 9b632748d2..507d0d0543 100644 --- a/src/frontends/qt4/GuiToc.cpp +++ b/src/frontends/qt4/GuiToc.cpp @@ -49,18 +49,21 @@ GuiToc::~GuiToc() void GuiToc::updateView() { #ifndef Q_WS_MACX - widget_->updateView(); - return; + widget_->updateView(); + return; #endif widget_->updateView(); - // Special code for Mac drawer. - if (windowFlags() & Qt::Drawer && lyxview().isFullScreen()) { + + // For Mac: switch to a docked TOC in fullscreen mode. + // We use the features() here instead of WindowFlags because + // the latter are not reliable (always returns Qt::Drawer). + if (!(features() & DockWidgetClosable) && lyxview().isFullScreen()) { setWindowFlags(Qt::Widget); setFeatures(DockWidgetClosable); // Setting features hides the dialog, see Qt's doc. show(); - } else if (!(windowFlags() & Qt::Drawer)) { + } else if ((features() & DockWidgetClosable) && !lyxview().isFullScreen()) { setWindowFlags(Qt::Drawer); setFeatures(NoDockWidgetFeatures); // Setting features hides the dialog, see Qt's doc.