From dd81e53fff6cfdccfa7459f6631182de4fbd8e3d Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 16 Feb 2011 18:09:34 +0100 Subject: This patch cleans up tabbar update: show/hide when ReKonfig::alwaysShowTabBar() is off and update tab button position. It also removes a "feature" introduced to hide/show tab button on tab moving: it has negative effects on tab middle click closing. Reviewed by: NOBODY (oops..) --- src/tabbar.cpp | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'src/tabbar.cpp') diff --git a/src/tabbar.cpp b/src/tabbar.cpp index 6b12a794..be20ecd3 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -70,12 +70,12 @@ static inline QByteArray highlightPropertyName(int index) TabBar::TabBar(QWidget *parent) - : KTabBar(parent) - , m_actualIndex(-1) - , m_currentTabPreviewIndex(-1) - , m_isFirstTimeOnTab(true) - , m_tabHighlightEffect(new TabHighlightEffect(this)) - , m_animationMapper(new QSignalMapper(this)) + : KTabBar(parent) + , m_actualIndex(-1) + , m_currentTabPreviewIndex(-1) + , m_isFirstTimeOnTab(true) + , m_tabHighlightEffect(new TabHighlightEffect(this)) + , m_animationMapper(new QSignalMapper(this)) { setElideMode(Qt::ElideRight); @@ -230,13 +230,6 @@ void TabBar::mouseMoveEvent(QMouseEvent *event) return; } - if (event->buttons() & Qt::LeftButton) - { - // hide addNewTabButton when moving tabs - MainView *view = qobject_cast(parent()); - QTimer::singleShot(200, view->addTabButton(), SLOT(hide())); - } - KTabBar::mouseMoveEvent(event); if (ReKonfig::hoveringTabOption() == 0) @@ -357,15 +350,6 @@ void TabBar::emptyAreaContextMenu(const QPoint &pos) } -void TabBar::mouseReleaseEvent(QMouseEvent *event) -{ - MainView *mv = qobject_cast(parent()); - QTimer::singleShot(200, mv->addTabButton(), SLOT(show())); - - KTabBar::mouseReleaseEvent(event); -} - - void TabBar::tabRemoved(int index) { if (ReKonfig::hoveringTabOption() == 0) @@ -462,4 +446,3 @@ void TabBar::removeAnimation(int index) m_animationMapper->removeMappings(anim); delete anim; } - -- cgit v1.2.1