diff --git a/src/plugins/TabManager/data/addtab.png b/src/plugins/TabManager/data/addtab.png new file mode 100644 index 000000000..4dd036574 Binary files /dev/null and b/src/plugins/TabManager/data/addtab.png differ diff --git a/src/plugins/TabManager/tabmanagerdelegate.cpp b/src/plugins/TabManager/tabmanagerdelegate.cpp index 6250ce9cb..21add9118 100644 --- a/src/plugins/TabManager/tabmanagerdelegate.cpp +++ b/src/plugins/TabManager/tabmanagerdelegate.cpp @@ -64,12 +64,13 @@ void TabManagerDelegate::paint(QPainter* painter, const QStyleOptionViewItem &op // draw close button if (index.column() == 1) { - if (index.parent().isValid() && opt.state & QStyle::State_MouseOver) { + if (opt.state & QStyle::State_MouseOver) { static const int buttonSize = 16; static const QPixmap closeTabButton(":tabmanager/data/closetab.png"); + static const QPixmap addTabButton(":tabmanager/data/addtab.png"); const QRect rect(opt.rect.right() - buttonSize, (opt.rect.height() - buttonSize) / 2 + opt.rect.y(), buttonSize, buttonSize); - painter->drawPixmap(style->visualRect(direction, opt.rect, rect), closeTabButton); + painter->drawPixmap(style->visualRect(direction, opt.rect, rect), (index.parent().isValid() ? closeTabButton : addTabButton)); } painter->restore(); diff --git a/src/plugins/TabManager/tabmanagerplugin.qrc b/src/plugins/TabManager/tabmanagerplugin.qrc index 6a9a11608..357dde820 100644 --- a/src/plugins/TabManager/tabmanagerplugin.qrc +++ b/src/plugins/TabManager/tabmanagerplugin.qrc @@ -8,6 +8,7 @@ data/tab-pinned.png data/side-by-side.png data/closetab.png + data/addtab.png locale/ar_SA.qm locale/bg_BG.qm locale/ca_ES.qm diff --git a/src/plugins/TabManager/tabmanagerwidget.cpp b/src/plugins/TabManager/tabmanagerwidget.cpp index 881ff3412..f65e69459 100644 --- a/src/plugins/TabManager/tabmanagerwidget.cpp +++ b/src/plugins/TabManager/tabmanagerwidget.cpp @@ -222,8 +222,11 @@ void TabManagerWidget::onItemActivated(QTreeWidgetItem* item, int column) return; } - if (column == 1 && item->childCount() == 0 && tabWidget) { - mainWindow->tabWidget()->requestCloseTab(mainWindow->tabWidget()->indexOf(tabWidget)); + if (column == 1) { + if (item->childCount() == 0 && tabWidget) + mainWindow->tabWidget()->requestCloseTab(mainWindow->tabWidget()->indexOf(tabWidget)); + else if (item->childCount() > 0) + QMetaObject::invokeMethod(mainWindow, "addTab"); return; }