mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:07:35 +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:
parent
bdce860ac5
commit
eecee7369f
2 changed files with 1 additions and 11 deletions
|
@ -26,9 +26,7 @@ BrowserWindow::BrowserWindow()
|
||||||
m_tabs_container->setMovable(true);
|
m_tabs_container->setMovable(true);
|
||||||
m_tabs_container->setTabsClosable(true);
|
m_tabs_container->setTabsClosable(true);
|
||||||
m_tabs_container->setDocumentMode(true);
|
m_tabs_container->setDocumentMode(true);
|
||||||
|
m_tabs_container->setTabBarAutoHide(true);
|
||||||
m_tabs_bar = m_tabs_container->findChild<QTabBar*>();
|
|
||||||
m_tabs_bar->hide();
|
|
||||||
|
|
||||||
auto* menu = menuBar()->addMenu("&File");
|
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::title_changed, this, &BrowserWindow::tab_title_changed);
|
||||||
QObject::connect(tab_ptr, &Tab::favicon_changed, this, &BrowserWindow::tab_favicon_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();
|
tab_ptr->focus_location_editor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,9 +259,6 @@ void BrowserWindow::close_tab(int index)
|
||||||
m_tabs.remove_first_matching([&](auto& entry) {
|
m_tabs.remove_first_matching([&](auto& entry) {
|
||||||
return entry == tab;
|
return entry == tab;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (m_tabs_container->count() <= 1)
|
|
||||||
m_tabs_bar->hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserWindow::close_current_tab()
|
void BrowserWindow::close_current_tab()
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
#include <QTabBar>
|
|
||||||
#include <QTabWidget>
|
#include <QTabWidget>
|
||||||
#include <QToolBar>
|
#include <QToolBar>
|
||||||
|
|
||||||
|
@ -44,7 +43,6 @@ private:
|
||||||
void debug_request(String const& request, String const& argument = "");
|
void debug_request(String const& request, String const& argument = "");
|
||||||
|
|
||||||
QTabWidget* m_tabs_container { nullptr };
|
QTabWidget* m_tabs_container { nullptr };
|
||||||
QTabBar* m_tabs_bar { nullptr };
|
|
||||||
NonnullOwnPtrVector<Tab> m_tabs;
|
NonnullOwnPtrVector<Tab> m_tabs;
|
||||||
Tab* m_current_tab { nullptr };
|
Tab* m_current_tab { nullptr };
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue