diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/CommandInput.hpp | 33 | ||||
| -rw-r--r-- | include/MainWindow.hpp | 21 |
2 files changed, 54 insertions, 0 deletions
diff --git a/include/CommandInput.hpp b/include/CommandInput.hpp new file mode 100644 index 0000000..e6dc53d --- /dev/null +++ b/include/CommandInput.hpp @@ -0,0 +1,33 @@ +#pragma once + +#include <QApplication> +#include <QDialog> +#include <QKeyEvent> +#include <QLabel> +#include <QLineEdit> +#include <QObject> +#include <QVBoxLayout> +#include <QWebEnginePage> +#include <QWebEngineView> +#include <QWidget> +#include <QWindow> +#include <lua.hpp> + +class CommandInput : public QFrame { + Q_OBJECT + +public: + CommandInput(QString defaultInput = "", QWidget *parentNode = nullptr); + void setInputFocus(bool focussed); + bool isInputFocussed(); + +signals: + void submitted(QString command); + +protected: + void keyPressEvent(QKeyEvent *event) override; + +private: + QBoxLayout *layout; + QLineEdit *input; +}; diff --git a/include/MainWindow.hpp b/include/MainWindow.hpp new file mode 100644 index 0000000..20e07c0 --- /dev/null +++ b/include/MainWindow.hpp @@ -0,0 +1,21 @@ +#pragma once + +#include <QMainWindow> +#include <QObject> +#include <QWebEngineView> + +#include "CommandInput.hpp" + +class MainWindow : public QMainWindow { +public: + MainWindow(); + +protected: + void keyPressEvent(QKeyEvent *event) override; + void toggleURLInput(); + void evaluateCommand(QString command); + +private: + QWebEngineView *web; + CommandInput *urlInputUI; +}; |
