mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-13 09:12:08 -04:00
animations/ripple: clean up effect and apply more universally
This commit is contained in:
@@ -61,11 +61,17 @@ Rectangle {
|
||||
radius: (Theme.iconSize + Theme.spacingS * 2) / 2
|
||||
color: iconArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
|
||||
|
||||
DankRipple {
|
||||
id: muteRipple
|
||||
cornerRadius: parent.radius
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: iconArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onPressed: mouse => muteRipple.trigger(mouse.x, mouse.y)
|
||||
onClicked: {
|
||||
if (AudioService.sink && AudioService.sink.audio) {
|
||||
AudioService.sink.audio.muted = !AudioService.sink.audio.muted;
|
||||
@@ -184,6 +190,7 @@ Rectangle {
|
||||
}
|
||||
|
||||
delegate: Rectangle {
|
||||
id: outputDelegate
|
||||
required property var modelData
|
||||
required property int index
|
||||
|
||||
@@ -194,6 +201,11 @@ Rectangle {
|
||||
border.color: modelData === AudioService.sink ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
border.width: 0
|
||||
|
||||
DankRipple {
|
||||
id: deviceRipple
|
||||
cornerRadius: outputDelegate.radius
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@@ -288,9 +300,15 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
DankRipple {
|
||||
id: pinRipple
|
||||
cornerRadius: parent.radius
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onPressed: mouse => pinRipple.trigger(mouse.x, mouse.y)
|
||||
onClicked: {
|
||||
const pins = JSON.parse(JSON.stringify(SettingsData.audioOutputDevicePins || {}));
|
||||
let pinnedList = audioContent.normalizePinList(pins["preferredOutput"]);
|
||||
@@ -320,6 +338,10 @@ Rectangle {
|
||||
anchors.rightMargin: pinOutputRow.width + Theme.spacingS * 4
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onPressed: mouse => {
|
||||
let mapped = deviceMouseArea.mapToItem(outputDelegate, mouse.x, mouse.y);
|
||||
deviceRipple.trigger(mapped.x, mapped.y);
|
||||
}
|
||||
onClicked: {
|
||||
if (modelData) {
|
||||
Pipewire.preferredDefaultAudioSink = modelData;
|
||||
@@ -428,12 +450,18 @@ Rectangle {
|
||||
radius: Theme.cornerRadius
|
||||
color: appIconArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.primary, 0)
|
||||
|
||||
DankRipple {
|
||||
id: appMuteRipple
|
||||
cornerRadius: parent.radius
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: appIconArea
|
||||
anchors.fill: parent
|
||||
visible: modelData !== null
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onPressed: mouse => appMuteRipple.trigger(mouse.x, mouse.y)
|
||||
onClicked: {
|
||||
if (modelData) {
|
||||
SessionData.suppressOSDTemporarily();
|
||||
|
||||
Reference in New Issue
Block a user