From 87c94e7241ad516bde363ace7087ea819608f07a Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 26 Feb 2010 00:45:08 +0100 Subject: This simple commit is inspired from mr #97 It actually hides the addTab button when moving the bars letting it reappear on the release event.. :) --- src/tabbar.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/tabbar.cpp') diff --git a/src/tabbar.cpp b/src/tabbar.cpp index 2fa4cf8e..ff996cb5 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -182,6 +182,13 @@ void TabBar::showTabPreview(int tab) void TabBar::mouseMoveEvent(QMouseEvent *event) { + if (event->buttons() & Qt::LeftButton) + { + // hide addNewTabButton when moving tabs + MainView *view = qobject_cast(parent()); + QTimer::singleShot(200, view->addTabButton(), SLOT(hide())); + } + if (ReKonfig::alwaysShowTabPreviews()) { //Find the tab under the mouse @@ -276,3 +283,12 @@ void TabBar::emptyAreaContextMenu(const QPoint &pos) menu.exec(pos); } + + +void TabBar::mouseReleaseEvent(QMouseEvent *event) +{ + MainView *mv = qobject_cast(parent()); + QTimer::singleShot(200, mv->addTabButton(), SLOT(show())); + + KTabBar::mouseReleaseEvent(event); +} -- cgit v1.2.1