mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:47:35 +00:00
Ladybird: Trigger browser to quit when the main window is closed
This patch adds an event handler to the main window which allows it to respond to a user closing the window. This event is then passed on to the LibCore event loop, which allows the application quit itself. Previously the application would hang, only running in the background, until killed by an external force.
This commit is contained in:
parent
95e3e06a1e
commit
7bf3010185
3 changed files with 19 additions and 3 deletions
|
@ -1,3 +1,4 @@
|
|||
#include <LibCore/Forward.h>
|
||||
#include <QIcon>
|
||||
#include <QLineEdit>
|
||||
#include <QMainWindow>
|
||||
|
@ -10,10 +11,12 @@ class WebView;
|
|||
class BrowserWindow : public QMainWindow {
|
||||
Q_OBJECT
|
||||
public:
|
||||
BrowserWindow();
|
||||
explicit BrowserWindow(Core::EventLoop&);
|
||||
|
||||
WebView& view() { return *m_view; }
|
||||
|
||||
virtual void closeEvent(QCloseEvent*) override;
|
||||
|
||||
public slots:
|
||||
void location_edit_return_pressed();
|
||||
void page_title_changed(QString);
|
||||
|
@ -23,4 +26,5 @@ private:
|
|||
QToolBar* m_toolbar { nullptr };
|
||||
QLineEdit* m_location_edit { nullptr };
|
||||
WebView* m_view { nullptr };
|
||||
Core::EventLoop& m_event_loop;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue