mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-21 16:58:58 +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:
parent
b92839fad9
commit
c2829ce2a0
Notes:
sideshowbarker
2024-07-17 01:51:00 +09:00
Author: https://github.com/jamierocks
Commit: c2829ce2a0
Pull-request: https://github.com/SerenityOS/serenity/pull/24135
Reviewed-by: https://github.com/trflynn89
2 changed files with 6 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue