mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-07 14:08:29 -04:00
launcher/spotlight: improve height-change animation
port 1.5
This commit is contained in:
@@ -42,7 +42,17 @@ FocusScope {
|
|||||||
return Theme.surfaceContainer;
|
return Theme.surfaceContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
implicitHeight: _searchAreaH + _resultsH
|
implicitHeight: _searchAreaH + resultsContainer.height
|
||||||
|
|
||||||
|
property bool _animateResize: false
|
||||||
|
|
||||||
|
Component.onCompleted: resizeAnimEnableTimer.restart()
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: resizeAnimEnableTimer
|
||||||
|
interval: 100
|
||||||
|
onTriggered: root._animateResize = true
|
||||||
|
}
|
||||||
|
|
||||||
function resetScroll() {
|
function resetScroll() {
|
||||||
resultsList.resetScroll();
|
resultsList.resetScroll();
|
||||||
@@ -239,8 +249,12 @@ FocusScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onContentVisibleChanged() {
|
function onContentVisibleChanged() {
|
||||||
if (!root.parentModal?.contentVisible)
|
if (!root.parentModal?.contentVisible) {
|
||||||
root.closeTransientUi();
|
root.closeTransientUi();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
root._animateResize = false;
|
||||||
|
resizeAnimEnableTimer.restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -420,6 +434,7 @@ FocusScope {
|
|||||||
height: root._resultsH
|
height: root._resultsH
|
||||||
|
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
|
enabled: root._animateResize
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: root._resizeDuration
|
duration: root._resizeDuration
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
|
|||||||
Reference in New Issue
Block a user