mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Ladybird: Retreive the tab title from the underlying Tab
Rather than getting the tab name from the tab container. This resolves an issue where ampersands were being introduced to the window title when changing tabs.
This commit is contained in:
committed by
Tim Flynn
parent
b92839fad9
commit
c2829ce2a0
@@ -402,8 +402,11 @@ BrowserWindow::BrowserWindow(Vector<URL::URL> const& initial_urls, WebView::Cook
|
||||
});
|
||||
QObject::connect(quit_action, &QAction::triggered, this, &QMainWindow::close);
|
||||
QObject::connect(m_tabs_container, &QTabWidget::currentChanged, [this](int index) {
|
||||
setWindowTitle(QString("%1 - Ladybird").arg(m_tabs_container->tabText(index)));
|
||||
set_current_tab(verify_cast<Tab>(m_tabs_container->widget(index)));
|
||||
auto* tab = verify_cast<Tab>(m_tabs_container->widget(index));
|
||||
if (tab)
|
||||
setWindowTitle(QString("%1 - Ladybird").arg(tab->title()));
|
||||
|
||||
set_current_tab(tab);
|
||||
});
|
||||
QObject::connect(m_tabs_container, &QTabWidget::tabCloseRequested, this, &BrowserWindow::close_tab);
|
||||
QObject::connect(close_current_tab_action, &QAction::triggered, this, &BrowserWindow::close_current_tab);
|
||||
|
||||
@@ -52,6 +52,7 @@ public:
|
||||
void show_inspector_window(InspectorTarget = InspectorTarget::Document);
|
||||
|
||||
QIcon const& favicon() const { return m_favicon; }
|
||||
QString const& title() const { return m_title; }
|
||||
|
||||
void update_navigation_buttons_state();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user