mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 10:08:10 +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
1 changed files with 2 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue