Skip to content

Commit

Permalink
fix: missing hovered state for quickpanel
Browse files Browse the repository at this point in the history
  • Loading branch information
18202781743 authored and deepin-bot[bot] committed Aug 30, 2024
1 parent 638c6f4 commit 40f62f8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
10 changes: 10 additions & 0 deletions panels/dock/tray/ShellSurfaceItemProxy.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Item {
signal surfaceDestroyed()
property bool autoClose: false
property bool inputEventsEnabled: true
property bool hovered: hoverHandler.hovered
property bool pressed: tapHandler.pressed

width: impl.width
height: impl.height
Expand All @@ -23,6 +25,14 @@ Item {
id: impl
shellSurface: root.shellSurface
inputEventsEnabled: root.inputEventsEnabled

HoverHandler {
id: hoverHandler
}
TapHandler {
id: tapHandler
}

onVisibleChanged: function () {
if (autoClose && !visible) {
// surface is valid but client's shellSurface maybe invalid.
Expand Down
7 changes: 1 addition & 6 deletions panels/dock/tray/quickpanel/PanelTrayItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,7 @@ Control {
implicitWidth: surfaceLayer.width
implicitHeight: surfaceLayer.height
property alias shellSurface: surfaceLayer.shellSurface
property alias hovered: hoverHandler.hovered

HoverHandler {
id: hoverHandler
parent: surfaceLayer
}
property alias hovered: surfaceLayer.hovered

ShellSurfaceItemProxy {
id: surfaceLayer
Expand Down
13 changes: 2 additions & 11 deletions panels/dock/tray/quickpanel/PluginItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ Control {
}
}

HoverHandler {
id: hoverHandler
parent: surfaceLayer
}
TapHandler {
id: tapHandler
parent: surfaceLayer
}

ShellSurfaceItemProxy {
id: surfaceLayer
anchors.centerIn: parent
Expand Down Expand Up @@ -80,8 +71,8 @@ Control {
id: backgroundControl

// Control's hovered is false when hover ShellSurfaceItem.
ColorSelector.hovered: hoverHandler.hovered
ColorSelector.pressed: tapHandler.pressed
ColorSelector.hovered: surfaceLayer.hovered
ColorSelector.pressed: surfaceLayer.pressed
property Palette backgroundColor: Palette {
normal {
common: ("transparent")
Expand Down

0 comments on commit 40f62f8

Please sign in to comment.