From a0ffd5cce6d40dddbc8b4869b8457196c704137f Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Thu, 15 Jun 2023 18:12:51 -0400 Subject: Change default behavior of CommentDialog. Now accepts on Enter/Return. --- ui/commentdialog.h | 24 +++++++++++++++++++++--- 1 file 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 #include +#include #include "binaryninjaapi.h" -#include "dialogtextedit.h" #include "uicontext.h" #include "uicomment.h" @@ -13,6 +13,24 @@ \ingroup uiapi */ +/*! + + \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 @@ -21,7 +39,7 @@ 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 -- cgit v1.3.1