From 3033b52c1cbc5c69fc38a899a6695357fd331a2d Mon Sep 17 00:00:00 2001 From: Stefan Schimanski Date: Tue, 29 May 2007 11:38:28 +0000 Subject: [PATCH] =?utf8?q?*=20added=20WidgetFlags=20argument=20to=20DockVi?= =?utf8?q?ew=20to=20set=20Qt::Drawer=20flag=20where=20needed=20*=20added?= =?utf8?q?=20Qt::Drawer=20flag=20to=20TOC=20*=20reverted=20J=C3=BCrgen's?= =?utf8?q?=20patch=20(i.e.=20the=20source=20view=20is=20docked=20below=20t?= =?utf8?q?he=20text=20again),=20=20=20wide=20drawers=20are=20not=20Mac-lik?= =?utf8?q?e=20(tm)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18557 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/Dialogs.cpp | 12 ++++++------ src/frontends/qt4/DockView.h | 8 ++++++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/frontends/qt4/Dialogs.cpp b/src/frontends/qt4/Dialogs.cpp index 619e0ed6ac..977d7f3345 100644 --- a/src/frontends/qt4/Dialogs.cpp +++ b/src/frontends/qt4/Dialogs.cpp @@ -243,14 +243,8 @@ Dialogs::DialogPtr Dialogs::build(string const & name) QViewSource * qvs = new QViewSource(*dialog); dialog->setController(qvs); GuiView & gui_view = static_cast(lyxview_); -#ifdef Q_WS_MACX - // Mac uses a drawer that should be on the right. - dialog->setView(new DockView( - *dialog, qvs, &gui_view, _("LaTeX Source"))); -#else dialog->setView(new DockView( *dialog, qvs, &gui_view, _("LaTeX Source"), Qt::BottomDockWidgetArea)); -#endif dialog->bc().bp(new OkCancelPolicy); } else if (name == "mathdelimiter") { dialog->setController(new ControlMath(*dialog)); @@ -311,8 +305,14 @@ Dialogs::DialogPtr Dialogs::build(string const & name) GuiView & gui_view = static_cast(lyxview_); QToc * qtoc = new QToc(*dialog, &gui_view); dialog->setController(qtoc); +#ifdef Q_WS_MACX + // On Mac show as a drawer at the right + dialog->setView(new DockView( + *dialog, qtoc, &gui_view, _("Outline"), Qt::RightDockWidgetArea, Qt::Drawer)); +#else dialog->setView(new DockView( *dialog, qtoc, &gui_view, _("Outline"))); +#endif dialog->bc().bp(new OkCancelPolicy); } else if (name == "url") { dialog->setController(new ControlCommand(*dialog, name, name)); diff --git a/src/frontends/qt4/DockView.h b/src/frontends/qt4/DockView.h index d582081c71..d83b75814b 100644 --- a/src/frontends/qt4/DockView.h +++ b/src/frontends/qt4/DockView.h @@ -35,10 +35,14 @@ public: Controller * form, ///< Associated model/controller QMainWindow * parent, ///< the main window where to dock. docstring const & title, ///< Window title (shown in the top title bar). - Qt::DockWidgetArea area = Qt::LeftDockWidgetArea + Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of the dock (and also drawer) + Qt::WindowFlags flags = 0 ) - : QDockWidget(toqstr(title), parent), Dialog::View(dialog, title) + : QDockWidget(toqstr(title), parent, flags), + Dialog::View(dialog, title) { + if (flags & Qt::Drawer) + setFeatures(QDockWidget::NoDockWidgetFeatures); widget_.reset(new Widget(form)); setWidget(widget_.get()); parent->addDockWidget(area, this); -- 2.39.2