}
+bool TabWorkArea::posIsTab(QPoint position)
+{
+ for (int i = 0; i < count(); ++i)
+ if (tabBar()->tabRect(i).contains(position))
+ return true;
+ return false;
+}
+
+
void TabWorkArea::mouseDoubleClickEvent(QMouseEvent * event)
{
if (event->button() != Qt::LeftButton)
// leave this code for now. (skostysh, 2016-07-21)
//
// return early if double click on existing tabs
- for (int i = 0; i < count(); ++i)
- if (tabBar()->tabRect(i).contains(event->pos()))
- return;
+ if (posIsTab(event->pos()))
+ return;
dispatch(FuncRequest(LFUN_BUFFER_NEW));
}
void mouseDoubleClickEvent(QMouseEvent * event);
private:
- ///
+ /// true if position is a tab (rather than the blank space in tab bar)
+ bool posIsTab(QPoint position);
+
int clicked_tab_;
///
QToolButton * closeBufferButton;