#include "GuiView.h"
#include <QDockWidget>
+#include <QKeyEvent>
namespace lyx {
namespace frontend {
: QDockWidget(&parent, flags), Dialog(parent, name, title)
{
setObjectName(name);
- if (flags & Qt::Drawer)
- setFeatures(QDockWidget::NoDockWidgetFeatures);
parent.addDockWidget(area, this);
+ hide();
}
virtual ~DockView() {}
virtual QWidget * asQWidget() { return this; }
virtual QWidget const * asQWidget() const { return this; }
+ /// 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; }
//@}
};