File tree Expand file tree Collapse file tree 3 files changed +30
-27
lines changed
Expand file tree Collapse file tree 3 files changed +30
-27
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,13 @@ import QtQuick.Controls
88import org.deepin.ds.dock 1.0
99import org.deepin.dtk
1010
11- Item {
11+ MouseArea {
1212 id: control
1313 property bool isActive
1414 property real radius: 4
1515
16+ // can accept mouse event,prevent further event delivery
17+ acceptedButtons: Qt .LeftButton | Qt .RightButton
1618 implicitWidth: 24
1719 implicitHeight: 24
1820 property Palette backgroundColor: Palette {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ AppletItemButton {
2525
2626 padding: itemPadding
2727
28- D .ColorSelector .hovered : (isDropHover && DDT .TraySortOrderModel .actionsAlwaysVisible ) || hoverHandler . hovered || stashedPopup .popupVisible
28+ D .ColorSelector .hovered : (isDropHover && DDT .TraySortOrderModel .actionsAlwaysVisible ) || hovered || stashedPopup .popupVisible
2929
3030 property var itemGlobalPoint: {
3131 var a = root
@@ -95,11 +95,11 @@ AppletItemButton {
9595
9696 onClicked: {
9797 if (stashedPopup .popupVisible ) {
98- stashedPopup .close ();
98+ stashedPopup .close ()
9999 } else {
100- stashedPopup .open ();
100+ stashedPopup .open ()
101101 }
102- toolTip .close ();
102+ toolTip .close ()
103103 }
104104
105105 PanelToolTip {
@@ -117,18 +117,21 @@ AppletItemButton {
117117 toolTip .open ()
118118 }
119119 }
120- HoverHandler {
121- id : hoverHandler
122- onHoveredChanged : {
123- if (hovered) {
124- toolTipShowTimer . start ()
125- } else {
126- if (toolTipShowTimer . running ) {
127- toolTipShowTimer .stop ()
128- }
129-
130- toolTip . close ()
120+
121+ onHoveredChanged : {
122+ if ( stashedPopup . popupVisible ) {
123+ return
124+ }
125+
126+ if (hovered ) {
127+ toolTipShowTimer .start ()
128+ } else {
129+ if ( toolTipShowTimer . running ) {
130+ toolTipShowTimer . stop ()
131131 }
132+
133+ toolTip .close ()
132134 }
133135 }
136+
134137}
Original file line number Diff line number Diff line change @@ -64,19 +64,17 @@ AppletItemButton {
6464 toolTip .open ()
6565 }
6666 }
67- HoverHandler {
68- id: hoverHandler
69- enabled: root .inputEventsEnabled
70- onHoveredChanged: {
71- if (hovered) {
72- toolTipShowTimer .start ()
73- } else {
74- if (toolTipShowTimer .running ) {
75- toolTipShowTimer .stop ()
76- }
7767
78- toolTip .close ()
68+
69+ onHoveredChanged: {
70+ if (hovered) {
71+ toolTipShowTimer .start ()
72+ } else {
73+ if (toolTipShowTimer .running ) {
74+ toolTipShowTimer .stop ()
7975 }
76+
77+ toolTip .close ()
8078 }
8179 }
8280}
You can’t perform that action at this time.
0 commit comments