1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:57:45 +00:00

Ladybird: Clean up tab bar autohide

Qt has this feature built-in, so there's no need to create a custom
implementation
This commit is contained in:
Aaron Dewes 2022-09-22 18:23:59 +02:00 committed by Andrew Kaster
parent bdce860ac5
commit eecee7369f
2 changed files with 1 additions and 11 deletions

View file

@ -26,9 +26,7 @@ BrowserWindow::BrowserWindow()
m_tabs_container->setMovable(true);
m_tabs_container->setTabsClosable(true);
m_tabs_container->setDocumentMode(true);
m_tabs_bar = m_tabs_container->findChild<QTabBar*>();
m_tabs_bar->hide();
m_tabs_container->setTabBarAutoHide(true);
auto* menu = menuBar()->addMenu("&File");
@ -251,9 +249,6 @@ void BrowserWindow::new_tab()
QObject::connect(tab_ptr, &Tab::title_changed, this, &BrowserWindow::tab_title_changed);
QObject::connect(tab_ptr, &Tab::favicon_changed, this, &BrowserWindow::tab_favicon_changed);
if (m_tabs_container->count() > 1)
m_tabs_bar->show();
tab_ptr->focus_location_editor();
}
@ -264,9 +259,6 @@ void BrowserWindow::close_tab(int index)
m_tabs.remove_first_matching([&](auto& entry) {
return entry == tab;
});
if (m_tabs_container->count() <= 1)
m_tabs_bar->hide();
}
void BrowserWindow::close_current_tab()

View file

@ -11,7 +11,6 @@
#include <QLineEdit>
#include <QMainWindow>
#include <QMenuBar>
#include <QTabBar>
#include <QTabWidget>
#include <QToolBar>
@ -44,7 +43,6 @@ private:
void debug_request(String const& request, String const& argument = "");
QTabWidget* m_tabs_container { nullptr };
QTabBar* m_tabs_bar { nullptr };
NonnullOwnPtrVector<Tab> m_tabs;
Tab* m_current_tab { nullptr };
};