From 34e86cb6e9ec5fd0a30b1ce4fa985bd785b927e6 Mon Sep 17 00:00:00 2001
From: pei-jiankang <peijiankang@kylinos.cn>
Date: Thu, 31 Mar 2022 15:40:49 +0800
Subject: [PATCH] modify the button problem of ukui-panel

---
 plugin-statusnotifier/statusnotifierbutton.cpp | 6 ++++++
 plugin-statusnotifier/statusnotifierbutton.h   | 1 +
 2 files changed, 7 insertions(+)

diff --git a/plugin-statusnotifier/statusnotifierbutton.cpp b/plugin-statusnotifier/statusnotifierbutton.cpp
index 473ee0c..7fd5968 100644
--- a/plugin-statusnotifier/statusnotifierbutton.cpp
+++ b/plugin-statusnotifier/statusnotifierbutton.cpp
@@ -359,6 +359,12 @@ void StatusNotifierButton::dragMoveEvent(QDragMoveEvent * e)
 
 }
 
+void StatusNotifierButton::dragLeaveEvent(QDragLeaveEvent *e)
+{
+    update();  //拖拽离开wigget时，需要updata
+    e->accept();
+}
+
 void StatusNotifierButton::dragEnterEvent(QDragEnterEvent *e)
 {
     e->acceptProposedAction();
diff --git a/plugin-statusnotifier/statusnotifierbutton.h b/plugin-statusnotifier/statusnotifierbutton.h
index b4d5b33..ee8433c 100644
--- a/plugin-statusnotifier/statusnotifierbutton.h
+++ b/plugin-statusnotifier/statusnotifierbutton.h
@@ -105,6 +105,7 @@ protected:
     void mouseReleaseEvent(QMouseEvent *event);
     void wheelEvent(QWheelEvent *event);
     void dragEnterEvent(QDragEnterEvent *e);
+    void dragLeaveEvent(QDragLeaveEvent *e);
     void dragMoveEvent(QDragMoveEvent * e);
     void mouseMoveEvent(QMouseEvent *e);
     void mousePressEvent(QMouseEvent *e);
-- 
2.33.0

