mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-06 05:28:29 -04:00
listview: workaround delegates overlapping and make spotlight launcher
have a stable anchor port 1.5
This commit is contained in:
@@ -32,21 +32,12 @@ Singleton {
|
|||||||
PauseAnimation {
|
PauseAnimation {
|
||||||
duration: Math.max(0, Math.min(addTransition.ViewTransition.index - (addTransition.ViewTransition.targetIndexes[0] ?? 0), root._staggerCap)) * root._staggerMs
|
duration: Math.max(0, Math.min(addTransition.ViewTransition.index - (addTransition.ViewTransition.targetIndexes[0] ?? 0), root._staggerCap)) * root._staggerMs
|
||||||
}
|
}
|
||||||
ParallelAnimation {
|
DankAnim {
|
||||||
DankAnim {
|
property: "opacity"
|
||||||
property: "opacity"
|
from: 0
|
||||||
from: 0
|
to: 1
|
||||||
to: 1
|
duration: Theme.expressiveDurations.fast
|
||||||
duration: Theme.expressiveDurations.fast
|
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
||||||
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
|
||||||
}
|
|
||||||
DankAnim {
|
|
||||||
property: "y"
|
|
||||||
from: addTransition.ViewTransition.destination.y + Theme.spacingS
|
|
||||||
to: addTransition.ViewTransition.destination.y
|
|
||||||
duration: Theme.expressiveDurations.fast
|
|
||||||
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -217,20 +217,6 @@ Item {
|
|||||||
pressDelay: 0
|
pressDelay: 0
|
||||||
flickableDirection: Flickable.VerticalFlick
|
flickableDirection: Flickable.VerticalFlick
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "snap"
|
|
||||||
when: Theme.snapListModelChanges
|
|
||||||
PropertyChanges {
|
|
||||||
target: clipboardListView
|
|
||||||
add: null
|
|
||||||
remove: null
|
|
||||||
displaced: null
|
|
||||||
move: null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
function ensureVisible(index) {
|
function ensureVisible(index) {
|
||||||
if (index < 0 || index >= count) {
|
if (index < 0 || index >= count) {
|
||||||
return;
|
return;
|
||||||
@@ -293,20 +279,6 @@ Item {
|
|||||||
pressDelay: 0
|
pressDelay: 0
|
||||||
flickableDirection: Flickable.VerticalFlick
|
flickableDirection: Flickable.VerticalFlick
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "snap"
|
|
||||||
when: Theme.snapListModelChanges
|
|
||||||
PropertyChanges {
|
|
||||||
target: savedListView
|
|
||||||
add: null
|
|
||||||
remove: null
|
|
||||||
displaced: null
|
|
||||||
move: null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
function ensureVisible(index) {
|
function ensureVisible(index) {
|
||||||
if (index < 0 || index >= count) {
|
if (index < 0 || index >= count) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -362,11 +362,12 @@ Item {
|
|||||||
WlrLayershell.exclusiveZone: -1
|
WlrLayershell.exclusiveZone: -1
|
||||||
WlrLayershell.keyboardFocus: KeyboardFocus.keyboardFocus(keyboardActive, null)
|
WlrLayershell.keyboardFocus: KeyboardFocus.keyboardFocus(keyboardActive, null)
|
||||||
|
|
||||||
|
// Anchored top+bottom: dynamic layer-surface resizes misbehave on some compositors
|
||||||
anchors {
|
anchors {
|
||||||
top: true
|
top: true
|
||||||
left: true
|
left: true
|
||||||
right: root.useSingleWindow
|
right: root.useSingleWindow
|
||||||
bottom: root.useSingleWindow
|
bottom: true
|
||||||
}
|
}
|
||||||
|
|
||||||
WlrLayershell.margins {
|
WlrLayershell.margins {
|
||||||
@@ -377,7 +378,6 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
implicitWidth: root.useSingleWindow ? 0 : root.windowWidth
|
implicitWidth: root.useSingleWindow ? 0 : root.windowWidth
|
||||||
implicitHeight: root.useSingleWindow ? 0 : root.windowHeight
|
|
||||||
|
|
||||||
mask: Region {
|
mask: Region {
|
||||||
item: inputMask
|
item: inputMask
|
||||||
|
|||||||
@@ -301,20 +301,6 @@ Item {
|
|||||||
clip: true
|
clip: true
|
||||||
spacing: Theme.spacingXXS
|
spacing: Theme.spacingXXS
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "snap"
|
|
||||||
when: Theme.snapListModelChanges
|
|
||||||
PropertyChanges {
|
|
||||||
target: processListView
|
|
||||||
add: null
|
|
||||||
remove: null
|
|
||||||
displaced: null
|
|
||||||
move: null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
model: ScriptModel {
|
model: ScriptModel {
|
||||||
values: root.cachedProcesses
|
values: root.cachedProcesses
|
||||||
objectProp: "pid"
|
objectProp: "pid"
|
||||||
|
|||||||
@@ -28,6 +28,70 @@ ListView {
|
|||||||
displaced: ListViewTransitions.displaced
|
displaced: ListViewTransitions.displaced
|
||||||
move: ListViewTransitions.move
|
move: ListViewTransitions.move
|
||||||
|
|
||||||
|
// QQmlDelegateModel can release a delegate back to its cache without hiding it,
|
||||||
|
// leaving a stale row painted over live ones. Hide anything the view no longer claims.
|
||||||
|
Connections {
|
||||||
|
target: listView.model?.objectName !== undefined ? listView.model : null
|
||||||
|
ignoreUnknownSignals: true
|
||||||
|
function onRowsInserted() {
|
||||||
|
orphanSweep.arm();
|
||||||
|
}
|
||||||
|
function onRowsRemoved() {
|
||||||
|
orphanSweep.arm();
|
||||||
|
}
|
||||||
|
function onRowsMoved() {
|
||||||
|
orphanSweep.arm();
|
||||||
|
}
|
||||||
|
function onModelReset() {
|
||||||
|
orphanSweep.arm();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FrameAnimation {
|
||||||
|
id: orphanSweep
|
||||||
|
|
||||||
|
property int frames: 0
|
||||||
|
|
||||||
|
function arm() {
|
||||||
|
frames = 0;
|
||||||
|
running = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
onTriggered: {
|
||||||
|
const kids = listView.contentItem.children;
|
||||||
|
const rows = [];
|
||||||
|
for (let i = 0; i < kids.length; i++) {
|
||||||
|
const c = kids[i];
|
||||||
|
if (!c || c.index === undefined)
|
||||||
|
continue;
|
||||||
|
const claimed = listView.itemAtIndex(c.index) === c;
|
||||||
|
if (claimed && !c.visible) {
|
||||||
|
c.visible = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (c.visible)
|
||||||
|
rows.push({
|
||||||
|
item: c,
|
||||||
|
claimed: claimed
|
||||||
|
});
|
||||||
|
}
|
||||||
|
for (let a = 0; a < rows.length; a++) {
|
||||||
|
if (rows[a].claimed)
|
||||||
|
continue;
|
||||||
|
for (let b = 0; b < rows.length; b++) {
|
||||||
|
if (a === b || !rows[b].claimed)
|
||||||
|
continue;
|
||||||
|
if (Math.abs(rows[a].item.y - rows[b].item.y) < rows[b].item.height / 2) {
|
||||||
|
rows[a].item.visible = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (++frames >= 3)
|
||||||
|
running = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMovementStarted: {
|
onMovementStarted: {
|
||||||
isUserScrolling = true;
|
isUserScrolling = true;
|
||||||
vbar._scrollBarActive = true;
|
vbar._scrollBarActive = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user