diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-02-26 00:45:08 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-02-26 00:45:08 +0100 |
commit | 87c94e7241ad516bde363ace7087ea819608f07a (patch) | |
tree | 0420b82cff445b7cb500e5461f67f4e363a4d7d2 /src | |
parent | to be really sure about.. Q_ASSERT it! (diff) | |
download | rekonq-87c94e7241ad516bde363ace7087ea819608f07a.tar.xz |
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.. :)
Diffstat (limited to 'src')
-rw-r--r-- | src/tabbar.cpp | 16 | ||||
-rw-r--r-- | src/tabbar.h | 1 |
2 files changed, 17 insertions, 0 deletions
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<MainView *>(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<MainView *>(parent()); + QTimer::singleShot(200, mv->addTabButton(), SLOT(show())); + + KTabBar::mouseReleaseEvent(event); +} diff --git a/src/tabbar.h b/src/tabbar.h index 9d1fd7a9..5d297e4c 100644 --- a/src/tabbar.h +++ b/src/tabbar.h @@ -80,6 +80,7 @@ protected: virtual void mouseMoveEvent(QMouseEvent *event); virtual void leaveEvent(QEvent *event); virtual void mousePressEvent(QMouseEvent *event); + virtual void mouseReleaseEvent(QMouseEvent *event); private slots: void cloneTab(); |