]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/DockView.h
Fix the tab ordering of GuiDocument components.
[lyx.git] / src / frontends / qt4 / DockView.h
index 57354a83929481069fae04d1a2061316bd1a55ad..1024bb50fd6636d1ff34a5079abb7b5cc488eb90 100644 (file)
@@ -16,6 +16,7 @@
 #include "GuiView.h"
 
 #include <QDockWidget>
+#include <QKeyEvent>
 
 namespace lyx {
 namespace frontend {
@@ -39,9 +40,8 @@ public:
                : QDockWidget(&parent, flags), Dialog(parent, name, title)
        {
                setObjectName(name);
-               if (flags & Qt::Drawer)
-                       setFeatures(QDockWidget::NoDockWidgetFeatures);
                parent.addDockWidget(area, this);
+               hide();
        }
 
        virtual ~DockView() {}
@@ -52,10 +52,24 @@ public:
        /// We don't want to restore geometry session for dock widgets.
        void restoreSession() {}
 
+       void keyPressEvent(QKeyEvent * ev)
+       {
+               if (ev->key() == Qt::Key_Escape) {
+                       QMainWindow * mw = static_cast<QMainWindow *>(parent());
+                       if (!mw) {
+                               ev->ignore();
+                               return;
+                       }
+                       mw->activateWindow();
+                       mw->setFocus();
+                       ev->accept();
+               }
+       }
        /// Dialog inherited methods
        //@{
        void applyView() {}
        bool isClosing() const { return false; }
+       bool needBufferOpen() const { return false; }
        //@}
 };