1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-15 02:02:08 -04:00

dankbar: fix widget hover effects

This commit is contained in:
bbedward
2025-10-25 11:57:56 -04:00
parent 42f9edf566
commit 7e75c9e510
19 changed files with 6 additions and 23 deletions

View File

@@ -99,7 +99,6 @@ BasePill {
y: -battery.topMargin y: -battery.topMargin
width: battery.width + battery.leftMargin + battery.rightMargin width: battery.width + battery.leftMargin + battery.rightMargin
height: battery.height + battery.topMargin + battery.bottomMargin height: battery.height + battery.topMargin + battery.bottomMargin
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
onPressed: { onPressed: {

View File

@@ -243,7 +243,6 @@ BasePill {
y: -root.topMargin y: -root.topMargin
width: root.width + root.leftMargin + root.rightMargin width: root.width + root.leftMargin + root.rightMargin
height: root.height + root.topMargin + root.bottomMargin height: root.height + root.topMargin + root.bottomMargin
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onPressed: { onPressed: {
if (root.popoutTarget && root.popoutTarget.setTriggerPosition) { if (root.popoutTarget && root.popoutTarget.setTriggerPosition) {

View File

@@ -27,7 +27,6 @@ BasePill {
MouseArea { MouseArea {
z: 1 z: 1
anchors.fill: parent anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onPressed: { onPressed: {
root.colorPickerRequested() root.colorPickerRequested()

View File

@@ -86,7 +86,6 @@ BasePill {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.NoButton acceptedButtons: Qt.NoButton
onWheel: function(wheelEvent) { onWheel: function(wheelEvent) {
let delta = wheelEvent.angleDelta.y let delta = wheelEvent.angleDelta.y
@@ -188,7 +187,6 @@ BasePill {
id: audioWheelArea id: audioWheelArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.NoButton acceptedButtons: Qt.NoButton
onWheel: function(wheelEvent) { onWheel: function(wheelEvent) {
let delta = wheelEvent.angleDelta.y; let delta = wheelEvent.angleDelta.y;
@@ -232,7 +230,6 @@ BasePill {
y: -root.topMargin y: -root.topMargin
width: root.width + root.leftMargin + root.rightMargin width: root.width + root.leftMargin + root.rightMargin
height: root.height + root.topMargin + root.bottomMargin height: root.height + root.topMargin + root.bottomMargin
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
onPressed: { onPressed: {

View File

@@ -122,7 +122,6 @@ BasePill {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
onPressed: { onPressed: {

View File

@@ -122,7 +122,6 @@ BasePill {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
onPressed: { onPressed: {

View File

@@ -10,6 +10,7 @@ BasePill {
property var widgetData: null property var widgetData: null
property string mountPath: (widgetData && widgetData.mountPath !== undefined) ? widgetData.mountPath : "/" property string mountPath: (widgetData && widgetData.mountPath !== undefined) ? widgetData.mountPath : "/"
property bool isHovered: mouseArea.containsMouse
property var selectedMount: { property var selectedMount: {
if (!DgopService.diskMounts || DgopService.diskMounts.length === 0) { if (!DgopService.diskMounts || DgopService.diskMounts.length === 0) {
@@ -193,6 +194,7 @@ BasePill {
} }
MouseArea { MouseArea {
id: mouseArea
z: 1 z: 1
anchors.fill: parent anchors.fill: parent
hoverEnabled: root.isVerticalOrientation hoverEnabled: root.isVerticalOrientation

View File

@@ -17,6 +17,7 @@ BasePill {
readonly property int maxCompactWidth: 288 readonly property int maxCompactWidth: 288
readonly property Toplevel activeWindow: ToplevelManager.activeToplevel readonly property Toplevel activeWindow: ToplevelManager.activeToplevel
property var activeDesktopEntry: null property var activeDesktopEntry: null
property bool isHovered: mouseArea.containsMouse
Component.onCompleted: { Component.onCompleted: {
updateDesktopEntry() updateDesktopEntry()

View File

@@ -186,7 +186,6 @@ BasePill {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
onPressed: { onPressed: {

View File

@@ -26,7 +26,6 @@ BasePill {
MouseArea { MouseArea {
z: 1 z: 1
anchors.fill: parent anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
SessionService.toggleIdleInhibit() SessionService.toggleIdleInhibit()

View File

@@ -66,7 +66,6 @@ BasePill {
MouseArea { MouseArea {
z: 1 z: 1
anchors.fill: parent anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
if (CompositorService.isNiri) { if (CompositorService.isNiri) {

View File

@@ -84,7 +84,6 @@ BasePill {
MouseArea { MouseArea {
id: customMouseArea id: customMouseArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.RightButton acceptedButtons: Qt.RightButton
onPressed: function (mouse){ onPressed: function (mouse){

View File

@@ -256,7 +256,6 @@ BasePill {
id: prevArea id: prevArea
anchors.fill: parent anchors.fill: parent
enabled: root.playerAvailable enabled: root.playerAvailable
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
if (activePlayer) { if (activePlayer) {
@@ -314,7 +313,6 @@ BasePill {
id: nextArea id: nextArea
anchors.fill: parent anchors.fill: parent
enabled: root.playerAvailable enabled: root.playerAvailable
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
if (activePlayer) { if (activePlayer) {

View File

@@ -122,7 +122,6 @@ BasePill {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
onPressed: { onPressed: {

View File

@@ -131,7 +131,6 @@ Item {
anchors.fill: parent anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton acceptedButtons: Qt.LeftButton | Qt.RightButton
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: (mouse) => { onClicked: (mouse) => {
if (!delegateRoot.trayItem) { if (!delegateRoot.trayItem) {
@@ -218,7 +217,6 @@ Item {
anchors.fill: parent anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton acceptedButtons: Qt.LeftButton | Qt.RightButton
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: (mouse) => { onClicked: (mouse) => {
if (!delegateRoot.trayItem) { if (!delegateRoot.trayItem) {
@@ -486,7 +484,6 @@ Item {
MouseArea { MouseArea {
id: backArea id: backArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: menuRoot.goBack() onClicked: menuRoot.goBack()
} }
@@ -522,7 +519,6 @@ Item {
id: itemArea id: itemArea
anchors.fill: parent anchors.fill: parent
enabled: !menuEntry?.isSeparator && (menuEntry?.enabled !== false) enabled: !menuEntry?.isSeparator && (menuEntry?.enabled !== false)
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {

View File

@@ -122,7 +122,6 @@ BasePill {
MouseArea { MouseArea {
z: 1 z: 1
anchors.fill: parent anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onPressed: { onPressed: {
if (popoutTarget && popoutTarget.setTriggerPosition) { if (popoutTarget && popoutTarget.setTriggerPosition) {

View File

@@ -13,6 +13,7 @@ BasePill {
} }
property var popoutTarget: null property var popoutTarget: null
property bool isHovered: clickArea.containsMouse
signal toggleVpnPopup() signal toggleVpnPopup()

View File

@@ -588,7 +588,6 @@ Item {
MouseArea { MouseArea {
id: appMouseArea id: appMouseArea
hoverEnabled: true
anchors.fill: parent anchors.fill: parent
enabled: isActive enabled: isActive
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
@@ -657,7 +656,6 @@ Item {
MouseArea { MouseArea {
id: appMouseArea id: appMouseArea
hoverEnabled: true
anchors.fill: parent anchors.fill: parent
enabled: isActive enabled: isActive
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor

View File

@@ -48,7 +48,8 @@ Item {
return "transparent" return "transparent"
} }
const baseColor = mouseArea.containsMouse ? Theme.widgetBaseHoverColor : Theme.widgetBaseBackgroundColor const isHovered = mouseArea.containsMouse || (root.isHovered ?? false)
const baseColor = isHovered ? Theme.widgetBaseHoverColor : Theme.widgetBaseBackgroundColor
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency) return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency)
} }