From 61f99089288138989cf244d174882aa5088b738b Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 9 Mar 2025 19:47:50 +0530 Subject: Refactor directory structure --- include/widgets/CommandInput.hpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 include/widgets/CommandInput.hpp (limited to 'include/widgets/CommandInput.hpp') diff --git a/include/widgets/CommandInput.hpp b/include/widgets/CommandInput.hpp new file mode 100644 index 0000000..a6ca0ed --- /dev/null +++ b/include/widgets/CommandInput.hpp @@ -0,0 +1,28 @@ +#pragma once + +#include +#include +#include + +class CommandInput : public QWidget { + Q_OBJECT + +public: + CommandInput(QString defaultInput = "", QWidget *parentNode = nullptr); + void setInputFocus(bool focussed); + bool isInputFocussed(); + QString getInputCommand(); + void setInputText(QString text); + +signals: + void submitted(QString command); + void cancelled(); + +protected: + void keyPressEvent(QKeyEvent *event) override; + void emitSubmit(); + +private: + QBoxLayout *layout; + QLineEdit *input; +}; -- cgit v1.3.1