diff options
Diffstat (limited to 'src/tabbar.cpp')
-rw-r--r-- | src/tabbar.cpp | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/tabbar.cpp b/src/tabbar.cpp index 0866bfd8..286d7d45 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -77,11 +77,6 @@ TabBar::TabBar(QWidget *parent) } -TabBar::~TabBar() -{ -} - - QSize TabBar::tabSizeHint(int index) const { MainView *view = qobject_cast<MainView *>(parent()); @@ -189,6 +184,26 @@ void TabBar::showTabPreview() } +void TabBar::hideEvent(QHideEvent *event) +{ + if (!event->spontaneous()) + { + qobject_cast<MainView *>(parent())->addTabButton()->hide(); + } + QTabBar::hideEvent(event); +} + + +void TabBar::showEvent(QShowEvent *event) +{ + QTabBar::showEvent(event); + if (!event->spontaneous()) + { + qobject_cast<MainView *>(parent())->addTabButton()->show(); + } +} + + void TabBar::mouseMoveEvent(QMouseEvent *event) { if (count() == 1) @@ -338,9 +353,8 @@ void TabBar::mouseReleaseEvent(QMouseEvent *event) } -void TabBar::tabRemoved(int index) +void TabBar::tabRemoved(int /*index*/) { - Q_UNUSED(index) if (ReKonfig::alwaysShowTabPreviews()) { if (!m_previewPopup.isNull()) @@ -374,7 +388,7 @@ void TabBar::setupHistoryActions() if(!isEnabled) return; - foreach (const HistoryItem &item, mv->recentlyClosedTabs()) + Q_FOREACH(const HistoryItem &item, mv->recentlyClosedTabs()) { KAction *a = new KAction(Application::iconManager()->iconForUrl(item.url), item.title, this); a->setData(item.url); |