summaryrefslogtreecommitdiff
path: root/ui/commentdialog.h
diff options
context:
space:
mode:
authorAlexander Taylor <alex@vector35.com>2023-06-15 18:12:51 -0400
committerAlexander Taylor <alex@vector35.com>2023-06-15 18:12:51 -0400
commita0ffd5cce6d40dddbc8b4869b8457196c704137f (patch)
tree0bd57715e6ceeb7e043a42f982d8e4dc7fb4969b /ui/commentdialog.h
parent54ecc8a6f8c42ba580c198b1fba38abea0a7efa0 (diff)
Change default behavior of CommentDialog.
Now accepts on Enter/Return.
Diffstat (limited to 'ui/commentdialog.h')
-rw-r--r--ui/commentdialog.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/ui/commentdialog.h b/ui/commentdialog.h
index f1c40ca5..c25e1857 100644
--- a/ui/commentdialog.h
+++ b/ui/commentdialog.h
@@ -2,8 +2,8 @@
#include <QtWidgets/QDialog>
#include <QtWidgets/QComboBox>
+#include <QtWidgets/QTextEdit>
#include "binaryninjaapi.h"
-#include "dialogtextedit.h"
#include "uicontext.h"
#include "uicomment.h"
@@ -17,11 +17,29 @@
\ingroup commentdialog
*/
+class BINARYNINJAUIAPI CommentDialogTextEdit : public QTextEdit
+{
+ Q_OBJECT
+
+public:
+ CommentDialogTextEdit(QWidget* parent);
+
+protected:
+ virtual void keyPressEvent(QKeyEvent* event) override;
+
+Q_SIGNALS:
+ void contentAccepted();
+};
+
+/*!
+
+ \ingroup commentdialog
+*/
class BINARYNINJAUIAPI CommentDialog : public QDialog
{
Q_OBJECT
- DialogTextEdit* m_comment;
+ CommentDialogTextEdit* m_comment;
UIComment m_uicomment;
public:
@@ -32,4 +50,4 @@ class BINARYNINJAUIAPI CommentDialog : public QDialog
const BinaryViewRef& getCommentBackingData();
UICommentType getCommentType();
uint64_t getCommentAddress();
-};
+}; \ No newline at end of file