Skip to content

Commit

Permalink
Don't create new empty tab on double click outside the tab bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Abs62 committed Apr 23, 2014
1 parent c8e4138 commit 0d60382
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion maintabwidget.cc
Expand Up @@ -55,7 +55,9 @@ bool MainTabWidget::eventFilter( QObject * obj, QEvent * ev )
if( ev->type() == QEvent::MouseButtonDblClick )
{
QMouseEvent * mev = static_cast< QMouseEvent *>( ev );
if( tabBar()->tabAt( mev->pos() ) == -1 )
if( mev->y() >= tabBar()->rect().y()
&& mev->y() <= tabBar()->rect().y() + tabBar()->rect().height()
&& tabBar()->tabAt( mev->pos() ) == -1 )
{
emit doubleClicked();
return true;
Expand Down

0 comments on commit 0d60382

Please sign in to comment.