aboutsummaryrefslogtreecommitdiff
path: root/src/widgets
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-04-02 20:49:49 +0530
committerAkshay Nair <phenax5@gmail.com>2025-04-02 20:49:49 +0530
commit96727d6e63ca927f3c7b68d4baa4fe672a4dcd0b (patch)
tree2e5b99bb3324a35a0bd9ecdaa2caefcf9260767a /src/widgets
parent4f945367ebc8e34263acbfca0416e3f75653924e (diff)
downloadnull-browser-96727d6e63ca927f3c7b68d4baa4fe672a4dcd0b.tar.gz
null-browser-96727d6e63ca927f3c7b68d4baa4fe672a4dcd0b.zip
Add events system for lua runtime to dispatch and register events
Diffstat (limited to '')
-rw-r--r--src/widgets/BrowserApp.cpp14
-rw-r--r--src/widgets/BrowserWindow.hpp3
2 files changed, 9 insertions, 8 deletions
diff --git a/src/widgets/BrowserApp.cpp b/src/widgets/BrowserApp.cpp
index f2d541d..d65a122 100644
--- a/src/widgets/BrowserApp.cpp
+++ b/src/widgets/BrowserApp.cpp
@@ -11,8 +11,7 @@ BrowserApp::BrowserApp() {
lua.start_event_loop();
// Router init
- auto &router = WindowActionRouter::instance();
- router.initialize();
+ WindowActionRouter::instance().initialize();
// Global event filter
qApp->installEventFilter(this);
@@ -22,14 +21,15 @@ BrowserApp::BrowserApp() {
};
BrowserWindow *BrowserApp::create_window() {
- auto *win = new BrowserWindow((const Configuration &)configuration);
- win->setWindowTitle("null-browser");
- WindowActionRouter::instance().add_window(win);
- win->show();
- return win;
+ auto *window = new BrowserWindow((const Configuration &)configuration);
+ window->setWindowTitle("null-browser");
+ WindowActionRouter::instance().add_window(window);
+ window->show();
+ return window;
}
bool BrowserApp::eventFilter(QObject *target, QEvent *event) {
+ // TODO: Prevent key release and shortcut on mode too
if (event->type() != QEvent::KeyPress)
return false;
diff --git a/src/widgets/BrowserWindow.hpp b/src/widgets/BrowserWindow.hpp
index 9aeeda3..4865ec9 100644
--- a/src/widgets/BrowserWindow.hpp
+++ b/src/widgets/BrowserWindow.hpp
@@ -6,7 +6,7 @@
#include "WindowMediator.hpp"
#include "utils.hpp"
-using WindowId = uint64_t;
+using WindowId = qsizetype;
class BrowserWindow : public QMainWindow {
Q_OBJECT
@@ -24,6 +24,7 @@ public:
signals:
void closed();
+ // void new_window_requested(const QUrl &url);
private:
WindowMediator *win_mediator;