diff options
Diffstat (limited to 'include/widgets')
| -rw-r--r-- | include/widgets/InputLine.hpp (renamed from include/widgets/CommandInput.hpp) | 10 | ||||
| -rw-r--r-- | include/widgets/MainWindow.hpp | 11 |
2 files changed, 14 insertions, 7 deletions
diff --git a/include/widgets/CommandInput.hpp b/include/widgets/InputLine.hpp index 3ce9500..2324f18 100644 --- a/include/widgets/CommandInput.hpp +++ b/include/widgets/InputLine.hpp @@ -1,19 +1,23 @@ #pragma once #include <QBoxLayout> +#include <QLabel> #include <QLineEdit> #include <QWidget> #include <QtCore> -class CommandInput : public QWidget { +#include "completion/Adapter.hpp" + +class InputLine : public QWidget { Q_OBJECT public: - CommandInput(QString defaultInput = "", QWidget *parentNode = nullptr); + InputLine(QString defaultInput = "", QWidget *parentNode = nullptr); void setInputFocus(bool focussed); bool isInputFocussed(); QString getInputCommand(); void setInputText(QString text); + void setAdapter(Adapter *adapter); signals: void submitted(QString command); @@ -26,4 +30,6 @@ protected: private: QBoxLayout *layout; QLineEdit *input; + QLabel *promptPrefix; + Adapter *adapter = nullptr; }; diff --git a/include/widgets/MainWindow.hpp b/include/widgets/MainWindow.hpp index 7f54ce2..b64bf8c 100644 --- a/include/widgets/MainWindow.hpp +++ b/include/widgets/MainWindow.hpp @@ -7,7 +7,7 @@ #include "LuaRuntime.hpp" #include "widgets/BrowserManager.hpp" -#include "widgets/CommandInput.hpp" +#include "widgets/InputLine.hpp" class MainWindow : public QMainWindow { public: @@ -15,14 +15,15 @@ public: protected: void keyPressEvent(QKeyEvent *event) override; - void toggleURLInput(); void evaluateCommand(QString command); - void hideURLInput(); - void showURLInput(); + void hideInputLine(); + void showInputLine(); + void showURLInput(QString url = ""); + void showCommandInput(QString command = ""); private: BrowserManager *browserManager; - CommandInput *commandInput; + InputLine *inputLine; LuaRuntime *luaRuntime; QStackedLayout *layout; }; |
