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
This commit is contained in:
Edwin Leuven 2010-04-18 11:30:20 +00:00
parent 8dffd93995
commit 5485f39539
2 changed files with 16 additions and 0 deletions

View File

@ -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) {

View File

@ -337,6 +337,8 @@ private Q_SLOTS:
void showContextMenu(const QPoint & pos);
///
void moveTab(int fromIndex, int toIndex);
///
void mouseDoubleClickEvent(QMouseEvent * event);
private:
///