diff options
| author | Amol Godbole <[email protected]> | 2023-11-09 22:38:00 -0600 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2023-11-12 08:54:57 +0000 |
| commit | d4e862fb4c34e0d4cb26410e582aff7112a0673b (patch) | |
| tree | 09b567c9bd027a410fde01a8515fc52159fdb12f /src | |
| parent | 1f0b22fca733feba05c3d7f4fda449bc35db2e39 (diff) | |
DolphinTabWidget: Use tabBarAutoHide property
The tab bar was being hidden manually. Instead, set the tabBarAutoHide
property to true.
BUG: 476742
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphintabwidget.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp index edc1cb7d8..11a720d20 100644 --- a/src/dolphintabwidget.cpp +++ b/src/dolphintabwidget.cpp @@ -35,12 +35,12 @@ DolphinTabWidget::DolphinTabWidget(DolphinNavigatorsWidgetAction *navigatorsWidg connect(tabBar, &DolphinTabBar::openNewActivatedTab, this, QOverload<int>::of(&DolphinTabWidget::openNewActivatedTab)); connect(tabBar, &DolphinTabBar::tabDropEvent, this, &DolphinTabWidget::tabDropEvent); connect(tabBar, &DolphinTabBar::tabDetachRequested, this, &DolphinTabWidget::detachTab); - tabBar->hide(); setTabBar(tabBar); setDocumentMode(true); setElideMode(Qt::ElideRight); setUsesScrollButtons(true); + setTabBarAutoHide(true); } DolphinTabPage *DolphinTabWidget::currentTabPage() const @@ -451,7 +451,7 @@ void DolphinTabWidget::tabInserted(int index) { QTabWidget::tabInserted(index); - if (count() > 1) { + if (tabBar()->isVisible()) { // Resolve all pending tab icons for (int i = 0; i < count(); ++i) { const QUrl url = tabPageAt(i)->activeViewContainer()->url(); @@ -464,8 +464,6 @@ void DolphinTabWidget::tabInserted(int index) tabBar()->setTabToolTip(index, url.toDisplayString(QUrl::PreferLocalFile)); } } - - tabBar()->show(); } Q_EMIT tabCountChanged(count()); @@ -475,12 +473,6 @@ void DolphinTabWidget::tabRemoved(int index) { QTabWidget::tabRemoved(index); - // If only one tab is left, then remove the tab entry so that - // closing the last tab is not possible. - if (count() < 2) { - tabBar()->hide(); - } - Q_EMIT tabCountChanged(count()); } |
