From 5485f3953936f687587a7591027ef1285bcb2e91 Mon Sep 17 00:00:00 2001 From: Edwin Leuven Date: Sun, 18 Apr 2010 11:30:20 +0000 Subject: [PATCH] new buffer on double click in empty area of the tab bar git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34201 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiWorkArea.cpp | 14 ++++++++++++++ src/frontends/qt4/GuiWorkArea.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 7d5d6035ac..5e63244e75 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -1391,6 +1391,20 @@ TabWorkArea::TabWorkArea(QWidget * parent) } +void TabWorkArea::mouseDoubleClickEvent(QMouseEvent * event) +{ + if (event->button() != Qt::LeftButton) + return; + + // return early if double click on existing tabs + for (int i = 0; i < count(); ++i) + if (tabBar()->tabRect(i).contains(event->pos())) + return; + + dispatch(FuncRequest(LFUN_BUFFER_NEW)); +} + + void TabWorkArea::setFullScreen(bool full_screen) { for (int i = 0; i != count(); ++i) { diff --git a/src/frontends/qt4/GuiWorkArea.h b/src/frontends/qt4/GuiWorkArea.h index f38018fa4f..9a0e2a2d22 100644 --- a/src/frontends/qt4/GuiWorkArea.h +++ b/src/frontends/qt4/GuiWorkArea.h @@ -337,6 +337,8 @@ private Q_SLOTS: void showContextMenu(const QPoint & pos); /// void moveTab(int fromIndex, int toIndex); + /// + void mouseDoubleClickEvent(QMouseEvent * event); private: ///