mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-04 21:02:06 -04:00
animations/ripple: clean up effect and apply more universally
This commit is contained in:
@@ -30,6 +30,12 @@ Rectangle {
|
||||
return mouseArea.containsMouse ? Theme.primaryHoverLight : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency);
|
||||
}
|
||||
|
||||
DankRipple {
|
||||
id: rippleLayer
|
||||
rippleColor: Theme.surfaceText
|
||||
cornerRadius: root.radius
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: indexBadge
|
||||
anchors.left: parent.left
|
||||
@@ -138,6 +144,10 @@ Rectangle {
|
||||
anchors.rightMargin: 80
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onPressed: mouse => {
|
||||
const pos = mouseArea.mapToItem(root, mouse.x, mouse.y);
|
||||
rippleLayer.trigger(pos.x, pos.y);
|
||||
}
|
||||
onClicked: copyRequested()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,12 @@ Rectangle {
|
||||
radius: Theme.cornerRadius
|
||||
color: isSelected ? Theme.primaryPressed : isHovered ? Theme.primaryHoverLight : "transparent"
|
||||
|
||||
DankRipple {
|
||||
id: rippleLayer
|
||||
rippleColor: Theme.surfaceText
|
||||
cornerRadius: root.radius
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
anchors.margins: Theme.spacingS
|
||||
@@ -99,6 +105,10 @@ Rectangle {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
|
||||
onPressed: mouse => {
|
||||
if (mouse.button === Qt.LeftButton)
|
||||
rippleLayer.trigger(mouse.x, mouse.y);
|
||||
}
|
||||
onClicked: mouse => {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
var scenePos = mapToItem(null, mouse.x, mouse.y);
|
||||
|
||||
@@ -475,6 +475,12 @@ Popup {
|
||||
}
|
||||
}
|
||||
|
||||
DankRipple {
|
||||
id: menuItemRipple
|
||||
rippleColor: Theme.surfaceText
|
||||
cornerRadius: Theme.cornerRadius
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: itemMouseArea
|
||||
anchors.fill: parent
|
||||
@@ -484,6 +490,7 @@ Popup {
|
||||
root.keyboardNavigation = false;
|
||||
root.selectedMenuIndex = menuItemDelegate.itemIndex;
|
||||
}
|
||||
onPressed: mouse => menuItemRipple.trigger(mouse.x, mouse.y)
|
||||
onClicked: {
|
||||
var menuItem = menuItemDelegate.modelData;
|
||||
if (menuItem.action)
|
||||
|
||||
@@ -53,6 +53,12 @@ Rectangle {
|
||||
color: isSelected ? Theme.primaryPressed : isHovered ? Theme.primaryHoverLight : "transparent"
|
||||
radius: Theme.cornerRadius
|
||||
|
||||
DankRipple {
|
||||
id: rippleLayer
|
||||
rippleColor: Theme.surfaceText
|
||||
cornerRadius: root.radius
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: itemArea
|
||||
z: 1
|
||||
@@ -62,6 +68,10 @@ Rectangle {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
|
||||
onPressed: mouse => {
|
||||
if (mouse.button === Qt.LeftButton)
|
||||
rippleLayer.trigger(mouse.x, mouse.y);
|
||||
}
|
||||
onClicked: mouse => {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
var scenePos = mapToItem(null, mouse.x, mouse.y);
|
||||
|
||||
@@ -82,6 +82,12 @@ Rectangle {
|
||||
return ["jpg", "jpeg", "png", "gif", "webp", "svg", "bmp"].indexOf(ext) >= 0;
|
||||
}
|
||||
|
||||
DankRipple {
|
||||
id: rippleLayer
|
||||
rippleColor: Theme.surfaceText
|
||||
cornerRadius: root.radius
|
||||
}
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
@@ -193,6 +199,10 @@ Rectangle {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
|
||||
onPressed: mouse => {
|
||||
if (mouse.button === Qt.LeftButton)
|
||||
rippleLayer.trigger(mouse.x, mouse.y);
|
||||
}
|
||||
onClicked: mouse => {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
var scenePos = mapToItem(null, mouse.x, mouse.y);
|
||||
|
||||
@@ -239,7 +239,6 @@ Rectangle {
|
||||
"icon": "computer",
|
||||
"collapsedByDefault": true,
|
||||
"children": [
|
||||
|
||||
{
|
||||
"id": "audio",
|
||||
"text": I18n.tr("Audio"),
|
||||
@@ -702,6 +701,12 @@ Rectangle {
|
||||
return "transparent";
|
||||
}
|
||||
|
||||
DankRipple {
|
||||
id: resultRipple
|
||||
rippleColor: root.searchSelectedIndex === resultDelegate.index ? Theme.buttonText : Theme.surfaceText
|
||||
cornerRadius: resultDelegate.radius
|
||||
}
|
||||
|
||||
Row {
|
||||
id: resultContent
|
||||
anchors.left: parent.left
|
||||
@@ -749,6 +754,7 @@ Rectangle {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onPressed: mouse => resultRipple.trigger(mouse.x, mouse.y)
|
||||
onClicked: root.selectSearchResult(resultDelegate.modelData)
|
||||
}
|
||||
|
||||
@@ -825,6 +831,12 @@ Rectangle {
|
||||
return "transparent";
|
||||
}
|
||||
|
||||
DankRipple {
|
||||
id: categoryRipple
|
||||
rippleColor: categoryRow.isActive ? Theme.buttonText : Theme.surfaceText
|
||||
cornerRadius: categoryRow.radius
|
||||
}
|
||||
|
||||
Row {
|
||||
id: categoryRowContent
|
||||
anchors.left: parent.left
|
||||
@@ -864,6 +876,7 @@ Rectangle {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onPressed: mouse => categoryRipple.trigger(mouse.x, mouse.y)
|
||||
onClicked: {
|
||||
root.keyboardHighlightIndex = -1;
|
||||
if (categoryDelegate.modelData.children) {
|
||||
@@ -915,6 +928,12 @@ Rectangle {
|
||||
return "transparent";
|
||||
}
|
||||
|
||||
DankRipple {
|
||||
id: childRipple
|
||||
rippleColor: childDelegate.isActive ? Theme.buttonText : Theme.surfaceText
|
||||
cornerRadius: childDelegate.radius
|
||||
}
|
||||
|
||||
Row {
|
||||
id: childRowContent
|
||||
anchors.left: parent.left
|
||||
@@ -943,6 +962,7 @@ Rectangle {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onPressed: mouse => childRipple.trigger(mouse.x, mouse.y)
|
||||
onClicked: {
|
||||
root.keyboardHighlightIndex = -1;
|
||||
root.tabChangeRequested(childDelegate.modelData.tabIndex);
|
||||
|
||||
Reference in New Issue
Block a user