]> git.lyx.org Git - lyx.git/commitdiff
* added WidgetFlags argument to DockView to set Qt::Drawer flag where needed
authorStefan Schimanski <sts@lyx.org>
Tue, 29 May 2007 11:38:28 +0000 (11:38 +0000)
committerStefan Schimanski <sts@lyx.org>
Tue, 29 May 2007 11:38:28 +0000 (11:38 +0000)
* added Qt::Drawer flag to TOC
* reverted Jürgen's patch (i.e. the source view is docked below the text again),
  wide drawers are not Mac-like (tm)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18557 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/Dialogs.cpp
src/frontends/qt4/DockView.h

index 619e0ed6ac89dece72254f626be2e1e4dc81c2ad..977d7f334559e43e0fd39d50916e44bb07cae4b6 100644 (file)
@@ -243,14 +243,8 @@ Dialogs::DialogPtr Dialogs::build(string const & name)
                QViewSource * qvs = new QViewSource(*dialog);
                dialog->setController(qvs);
                GuiView & gui_view = static_cast<GuiView &>(lyxview_);
-#ifdef Q_WS_MACX
-               // Mac uses a drawer that should be on the right.
-               dialog->setView(new DockView<QViewSource, QViewSourceDialog>(
-                       *dialog, qvs, &gui_view, _("LaTeX Source")));
-#else
                dialog->setView(new DockView<QViewSource, QViewSourceDialog>(
                        *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<GuiView &>(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<QToc, TocWidget>(
+                       *dialog, qtoc, &gui_view, _("Outline"), Qt::RightDockWidgetArea, Qt::Drawer));
+#else
                dialog->setView(new DockView<QToc, TocWidget>(
                        *dialog, qtoc, &gui_view, _("Outline")));
+#endif
                dialog->bc().bp(new OkCancelPolicy);
        } else if (name == "url") {
                dialog->setController(new ControlCommand(*dialog, name, name));
index d582081c71fa176c2d4193ff10a9f09080b1e44b..d83b75814bcd6f86be154a9ef6a5515ed0ad0eae 100644 (file)
@@ -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);