Only allow to re-order tabs if we have more than 1

Otherwise it's confusing

Fixes: #27
This commit is contained in:
Sergio Martins
2020-02-18 11:06:04 +00:00
parent 232e96ee0e
commit a35e088988
2 changed files with 9 additions and 0 deletions

View File

@@ -80,6 +80,14 @@ void TabBarWidget::mousePressEvent(QMouseEvent *e)
QTabBar::mousePressEvent(e);
}
void TabBarWidget::mouseMoveEvent(QMouseEvent *e)
{
if (count() > 1) {
// Only allow to re-order tabs if we have more than 1 tab, otherwise it's just weird.
QTabBar::mouseMoveEvent(e);
}
}
bool TabBarWidget::dragCanStart(QPoint pressPos, QPoint pos) const
{
// Here we allow the user to re-order tabs instead of dragging them off.