void TabBar::tabRemoved(int index) { Q_UNUSED(index) showCloseButton(currentIndex()); setVisible(!(count() == 1 && m_hideTabBarWithOneTab)); }
void TabBar::updatePinnedTabCloseButton(int index) { if (!validIndex(index)) { return; } WebTab* webTab = qobject_cast<WebTab*>(m_tabWidget->widget(index)); QAbstractButton* button = qobject_cast<QAbstractButton*>(tabButton(index, closeButtonPosition())); bool pinned = webTab && webTab->isPinned(); if (pinned) { if (button) { button->hide(); } } else { if (button) { button->show(); } else { showCloseButton(index); } } }
void TabBar::overflowChanged(bool overflowed) { // Make sure close buttons on inactive tabs are hidden // This is needed for when leaving fullscreen from non-overflowed to overflowed state if (overflowed && m_showCloseOnInactive != 1) { setTabsClosable(false); showCloseButton(currentIndex()); } }
void TabBar::currentTabChanged(int index) { if (!validIndex(index)) { return; } hideTabPreview(false); showCloseButton(index); hideCloseButton(m_tabWidget->lastTabIndex()); }
void TabBar::tabRemoved(int index) { Q_UNUSED(index) showCloseButton(currentIndex()); setVisible(!(count() == 1 && m_hideTabBarWithOneTab)); // Make sure to move add tab button to correct position when there are no normal tabs if (normalTabsCount() == 0) { int xForAddTabButton = cornerWidth(Qt::TopLeftCorner) + pinTabBarWidth(); if (QApplication::layoutDirection() == Qt::RightToLeft) xForAddTabButton = width() - xForAddTabButton; emit moveAddTabButton(xForAddTabButton); } }
void TabBar::currentTabChanged(int index) { if (!validIndex(index)) { return; } // Don't hide close buttons when dragging tabs if (m_dragStartPosition.isNull()) { showCloseButton(index); hideCloseButton(m_tabWidget->lastTabIndex()); ensureVisible(index); } m_tabWidget->currentTabChanged(index); }
void TabBar::currentTabChanged(int index) { if (!validIndex(index)) { return; } // Don't hide close buttons when dragging tabs if (m_dragStartPosition.isNull()) { showCloseButton(index); if (m_lastTab) { hideCloseButton(m_lastTab->tabIndex()); } QTimer::singleShot(100, this, [this]() { ensureVisible(); }); } m_lastTab = webTab(index); m_tabWidget->currentTabChanged(index); }
void TabBar::tabRemoved(int index) { Q_UNUSED(index) showCloseButton(currentIndex()); }