mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 08:56:40 +00:00
Ladybird: Update pointer to current tab when the selected tab changes
This allows requests like dumping the DOM tree to be forwarded to the correct tab. Otherwise, the event would be forwarded to the most recently created tab.
This commit is contained in:
parent
e04db5efed
commit
4850a2d272
|
@ -10,6 +10,7 @@
|
|||
#include "Settings.h"
|
||||
#include "SettingsDialog.h"
|
||||
#include "WebView.h"
|
||||
#include <AK/TypeCasts.h>
|
||||
#include <QAction>
|
||||
#include <QDialog>
|
||||
#include <QPlainTextEdit>
|
||||
|
@ -190,6 +191,7 @@ BrowserWindow::BrowserWindow()
|
|||
QObject::connect(m_tabs_container, &QTabWidget::currentChanged, [this](int index) {
|
||||
setWindowTitle(QString("%1 - Ladybird").arg(m_tabs_container->tabText(index)));
|
||||
setWindowIcon(m_tabs_container->tabIcon(index));
|
||||
m_current_tab = verify_cast<Tab>(m_tabs_container->widget(index));
|
||||
});
|
||||
QObject::connect(m_tabs_container, &QTabWidget::tabCloseRequested, this, &BrowserWindow::close_tab);
|
||||
QObject::connect(close_current_tab_action, &QAction::triggered, this, &BrowserWindow::close_current_tab);
|
||||
|
|
Loading…
Reference in a new issue