mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03: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:
parent
b92839fad9
commit
c2829ce2a0
Notes:
sideshowbarker
2024-07-17 01:51:00 +09:00
Author: https://github.com/jamierocks Commit: https://github.com/SerenityOS/serenity/commit/c2829ce2a0 Pull-request: https://github.com/SerenityOS/serenity/pull/24135 Reviewed-by: https://github.com/trflynn89
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user