]> 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 bb456d9b5deea53ebf93641146ea0c936db7a5bd..1024bb50fd6636d1ff34a5079abb7b5cc488eb90 100644 (file)
@@ -16,6 +16,7 @@
 #include "GuiView.h"
 
 #include <QDockWidget>
+#include <QKeyEvent>
 
 namespace lyx {
 namespace frontend {
@@ -39,8 +40,6 @@ public:
                : QDockWidget(&parent, flags), Dialog(parent, name, title)
        {
                setObjectName(name);
-               if (flags & Qt::Drawer)
-                       setFeatures(QDockWidget::NoDockWidgetFeatures);
                parent.addDockWidget(area, this);
                hide();
        }
@@ -53,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; }
        //@}
 };