From: Vincent van Ravesteijn Date: Thu, 11 Mar 2010 19:33:08 +0000 (+0000) Subject: Adjust the window settings for MacOSX. X-Git-Tag: 2.0.0~3826 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=cabde10fa39d346d5a9f08a5a8b7a92d652181cb;p=features.git Adjust the window settings for MacOSX. - No more Drawers, - ProgressView and SourceView are docked at the bottom, - SpellChecker, FindAndReplace and Outline are floating by default, but dockable. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33716 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/DockView.h b/src/frontends/qt4/DockView.h index bb456d9b5d..2ff08f63e2 100644 --- a/src/frontends/qt4/DockView.h +++ b/src/frontends/qt4/DockView.h @@ -39,8 +39,6 @@ public: : QDockWidget(&parent, flags), Dialog(parent, name, title) { setObjectName(name); - if (flags & Qt::Drawer) - setFeatures(QDockWidget::NoDockWidgetFeatures); parent.addDockWidget(area, this); hide(); } diff --git a/src/frontends/qt4/FindAndReplace.cpp b/src/frontends/qt4/FindAndReplace.cpp index 50f3641b57..d57c272fc2 100644 --- a/src/frontends/qt4/FindAndReplace.cpp +++ b/src/frontends/qt4/FindAndReplace.cpp @@ -615,7 +615,12 @@ bool FindAndReplace::initialiseParams(std::string const & params) Dialog * createGuiSearchAdv(GuiView & lv) { - return new FindAndReplace(lv, Qt::RightDockWidgetArea); + FindAndReplace * gui = new FindAndReplace(lv, Qt::RightDockWidgetArea); +#ifdef Q_WS_MACX + // On Mac show and floating + gui->setFloating(true); +#endif + return gui; } diff --git a/src/frontends/qt4/GuiProgressView.cpp b/src/frontends/qt4/GuiProgressView.cpp index a608c53442..3413963f3e 100644 --- a/src/frontends/qt4/GuiProgressView.cpp +++ b/src/frontends/qt4/GuiProgressView.cpp @@ -237,11 +237,7 @@ void GuiProgressView::hideEvent(QHideEvent*) Dialog * createGuiProgressView(GuiView & guiview) { -#ifdef Q_WS_MACX - return new GuiProgressView(guiview, Qt::RightDockWidgetArea, Qt::Drawer); -#else return new GuiProgressView(guiview, Qt::BottomDockWidgetArea); -#endif } diff --git a/src/frontends/qt4/GuiSpellchecker.cpp b/src/frontends/qt4/GuiSpellchecker.cpp index 5c766eb04f..fe03e249b9 100644 --- a/src/frontends/qt4/GuiSpellchecker.cpp +++ b/src/frontends/qt4/GuiSpellchecker.cpp @@ -338,7 +338,15 @@ void GuiSpellchecker::showSummary() } -Dialog * createGuiSpellchecker(GuiView & lv) { return new GuiSpellchecker(lv); } +Dialog * createGuiSpellchecker(GuiView & lv) +{ + GuiSpellchecker * gui = new GuiSpellchecker(lv); +#ifdef Q_WS_MACX + gui->setFloating(true); +#endif + return gui; +} + } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt4/GuiToc.cpp b/src/frontends/qt4/GuiToc.cpp index 787bbb7058..e7840b102e 100644 --- a/src/frontends/qt4/GuiToc.cpp +++ b/src/frontends/qt4/GuiToc.cpp @@ -48,27 +48,8 @@ GuiToc::~GuiToc() void GuiToc::updateView() { -#ifndef Q_WS_MACX widget_->updateView(); return; -#endif - - widget_->updateView(); - - // 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 ((features() & DockWidgetClosable) && !lyxview().isFullScreen()) { - setWindowFlags(Qt::Drawer); - setFeatures(NoDockWidgetFeatures); - // Setting features hides the dialog, see Qt's doc. - show(); - } } @@ -115,13 +96,15 @@ bool GuiToc::getStatus(Cursor & cur, FuncRequest const & cmd, Dialog * createGuiToc(GuiView & lv) { - GuiView & guiview = static_cast(lv); + GuiToc * toc; #ifdef Q_WS_MACX - // On Mac show as a drawer at the right - return new GuiToc(guiview, Qt::RightDockWidgetArea, Qt::Drawer); + // On Mac show at the right and floating + toc = new GuiToc(lv, Qt::RightDockWidgetArea); + toc->setFloating(true); #else - return new GuiToc(guiview); + toc = new GuiToc(lv); #endif + return toc; }