1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-13 01:02:18 -04:00

launcher v2: de-dupe cached entries by ID

This commit is contained in:
bbedward
2026-02-10 12:59:53 -05:00
parent f8af8fc171
commit 46a2f6f0d8
2 changed files with 29 additions and 3 deletions

View File

@@ -351,6 +351,11 @@ BasePill {
elide: Text.ElideRight elide: Text.ElideRight
maximumLineCount: 1 maximumLineCount: 1
} }
DankRipple {
id: itemRipple
cornerRadius: Theme.cornerRadius
}
} }
MouseArea { MouseArea {
@@ -359,7 +364,10 @@ BasePill {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
onPressed: mouse => root.triggerRipple(this, mouse.x, mouse.y) onPressed: mouse => {
const pos = mapToItem(visualContent, mouse.x, mouse.y);
itemRipple.trigger(pos.x, pos.y);
}
onClicked: mouse => { onClicked: mouse => {
if (mouse.button === Qt.LeftButton) { if (mouse.button === Qt.LeftButton) {
if (isGrouped && windowCount > 1) { if (isGrouped && windowCount > 1) {
@@ -597,6 +605,11 @@ BasePill {
elide: Text.ElideRight elide: Text.ElideRight
maximumLineCount: 1 maximumLineCount: 1
} }
DankRipple {
id: itemRipple
cornerRadius: Theme.cornerRadius
}
} }
MouseArea { MouseArea {
@@ -605,7 +618,10 @@ BasePill {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton acceptedButtons: Qt.LeftButton | Qt.RightButton
onPressed: mouse => root.triggerRipple(this, mouse.x, mouse.y) onPressed: mouse => {
const pos = mapToItem(visualContent, mouse.x, mouse.y);
itemRipple.trigger(pos.x, pos.y);
}
onClicked: mouse => { onClicked: mouse => {
if (mouse.button === Qt.LeftButton) { if (mouse.button === Qt.LeftButton) {
if (isGrouped && windowCount > 1) { if (isGrouped && windowCount > 1) {

View File

@@ -111,7 +111,17 @@ Singleton {
function getVisibleApplications() { function getVisibleApplications() {
if (_cachedVisibleApps === null) { if (_cachedVisibleApps === null) {
_cachedVisibleApps = applications.filter(app => !isAppHidden(app)); const seen = new Set();
_cachedVisibleApps = applications.filter(app => {
if (isAppHidden(app))
return false;
const id = app.id;
if (id && seen.has(id))
return false;
if (id)
seen.add(id);
return true;
});
} }
return _cachedVisibleApps.map(app => applyAppOverride(app)); return _cachedVisibleApps.map(app => applyAppOverride(app));
} }