mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 06:57:24 -06:00
Fix tab bar visibility when the execution log tab is enabled
This commit is contained in:
@@ -36,9 +36,29 @@
|
|||||||
|
|
||||||
class HidableTabWidget : public QTabWidget {
|
class HidableTabWidget : public QTabWidget {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void showTabBar(bool show) {
|
void showTabBar(bool show) {
|
||||||
tabBar()->setVisible(show);
|
tabBar()->setVisible(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void tabInserted(int index) {
|
||||||
|
QTabWidget::tabInserted(index);
|
||||||
|
if(count() == 1) {
|
||||||
|
showTabBar(false);
|
||||||
|
} else {
|
||||||
|
showTabBar(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void tabRemoved(int index) {
|
||||||
|
QTabWidget::tabInserted(index);
|
||||||
|
if(count() == 1) {
|
||||||
|
showTabBar(false);
|
||||||
|
} else {
|
||||||
|
showTabBar(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // HIDABLETABWIDGET_H
|
#endif // HIDABLETABWIDGET_H
|
||||||
|
|||||||
@@ -385,13 +385,10 @@ void MainWindow::displayRSSTab(bool enable) {
|
|||||||
int index_tab = tabs->addTab(rssWidget, tr("RSS"));
|
int index_tab = tabs->addTab(rssWidget, tr("RSS"));
|
||||||
tabs->setTabIcon(index_tab, misc::getIcon("application-rss+xml"));
|
tabs->setTabIcon(index_tab, misc::getIcon("application-rss+xml"));
|
||||||
}
|
}
|
||||||
tabs->showTabBar(true);
|
|
||||||
} else {
|
} else {
|
||||||
if(rssWidget) {
|
if(rssWidget) {
|
||||||
delete rssWidget;
|
delete rssWidget;
|
||||||
}
|
}
|
||||||
if(!searchEngine)
|
|
||||||
tabs->showTabBar(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,13 +399,10 @@ void MainWindow::displaySearchTab(bool enable) {
|
|||||||
searchEngine = new SearchEngine(this);
|
searchEngine = new SearchEngine(this);
|
||||||
tabs->insertTab(1, searchEngine, misc::getIcon("edit-find"), tr("Search"));
|
tabs->insertTab(1, searchEngine, misc::getIcon("edit-find"), tr("Search"));
|
||||||
}
|
}
|
||||||
tabs->showTabBar(true);
|
|
||||||
} else {
|
} else {
|
||||||
if(searchEngine) {
|
if(searchEngine) {
|
||||||
delete searchEngine;
|
delete searchEngine;
|
||||||
}
|
}
|
||||||
if(!rssWidget)
|
|
||||||
tabs->showTabBar(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user