diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-03-12 20:47:57 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-03-12 21:06:52 +0530 |
| commit | 05ae8976a8e1ab5411058de244c4e2fcc87ec369 (patch) | |
| tree | cb3661ed66b9aeb6b78818228d4ec4785dbf27e1 /include/widgets/MainWindow.hpp | |
| parent | d46cf6e12452261c6aaf498dddf8e1176d349d6e (diff) | |
| download | null-browser-05ae8976a8e1ab5411058de244c4e2fcc87ec369.tar.gz null-browser-05ae8976a8e1ab5411058de244c4e2fcc87ec369.zip | |
Refactor MainWindow into InputMediator
Diffstat (limited to 'include/widgets/MainWindow.hpp')
| -rw-r--r-- | include/widgets/MainWindow.hpp | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/include/widgets/MainWindow.hpp b/include/widgets/MainWindow.hpp index 99a3895..f77ed60 100644 --- a/include/widgets/MainWindow.hpp +++ b/include/widgets/MainWindow.hpp @@ -5,16 +5,7 @@ #include <QStackedLayout> #include <QWebEngineView> -#include "LuaRuntime.hpp" -#include "widgets/InputLine.hpp" -#include "widgets/WebViewStack.hpp" - -class EvaluationType { -public: - EvaluationType() {} - virtual ~EvaluationType() = default; -}; -class NoopEval : public EvaluationType {}; +#include "InputMediator.hpp" class MainWindow : public QMainWindow { public: @@ -22,33 +13,7 @@ public: private: void keyPressEvent(QKeyEvent *event) override; - void onInputSubmit(QString input); - - void evaluateCommand(QString command); - - void hideInputLine(); - void showInputLine(); - void showURLInput(QString url, OpenType openType); - void showCommandInput(QString command = ""); - - void setEvaluationType(EvaluationType *); private: - WebViewStack *webViewStack; - InputLine *inputLine; - LuaRuntime *luaRuntime; - QStackedLayout *layout; - - EvaluationType *currentEvaluationType = new NoopEval(); + InputMediator *inputMediator; }; - -class UrlEval : public EvaluationType { -public: - UrlEval(OpenType type) : EvaluationType(), openType(type) {} - OpenType type() { return openType; } - -private: - OpenType openType; -}; - -class CommandEval : public EvaluationType {}; |
