Last active
June 12, 2020 11:16
-
-
Save TerryGeng/c91640b042709018468a4c4c0c4db4ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/mumble/CustomElements.cpp b/src/mumble/CustomElements.cpp | |
index 0de9bb2f..1b5d5d28 100644 | |
--- a/src/mumble/CustomElements.cpp | |
+++ b/src/mumble/CustomElements.cpp | |
@@ -99,6 +99,16 @@ void ChatbarTextEdit::contextMenuEvent(QContextMenuEvent *qcme) { | |
delete menu; | |
} | |
+void ChatbarTextEdit::dragEnterEvent(QDragEnterEvent *evt) { | |
+ inFocus(true); | |
+ evt->acceptProposedAction(); | |
+} | |
+ | |
+void ChatbarTextEdit::dragMoveEvent(QDragMoveEvent *evt) { | |
+ inFocus(true); | |
+ evt->acceptProposedAction(); | |
+} | |
+ | |
void ChatbarTextEdit::dropEvent(QDropEvent *evt) { | |
inFocus(true); | |
if (sendImagesFromMimeData(evt->mimeData())) { | |
diff --git a/src/mumble/CustomElements.h b/src/mumble/CustomElements.h | |
index 897099bb..13122b64 100644 | |
--- a/src/mumble/CustomElements.h | |
+++ b/src/mumble/CustomElements.h | |
@@ -42,6 +42,8 @@ class ChatbarTextEdit : public QTextEdit { | |
void focusInEvent(QFocusEvent *) Q_DECL_OVERRIDE; | |
void focusOutEvent(QFocusEvent *) Q_DECL_OVERRIDE; | |
void contextMenuEvent(QContextMenuEvent *) Q_DECL_OVERRIDE; | |
+ void dragEnterEvent(QDragEnterEvent *) Q_DECL_OVERRIDE; | |
+ void dragMoveEvent(QDragMoveEvent *) Q_DECL_OVERRIDE; | |
void dropEvent(QDropEvent *) Q_DECL_OVERRIDE; | |
bool event(QEvent *) Q_DECL_OVERRIDE; | |
QSize minimumSizeHint() const Q_DECL_OVERRIDE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment