mirror of
https://github.com/KDE/kasts.git
synced 2025-01-28 16:19:56 +01:00
Fix wonky behaviour of FooterBar when resizing and PlayerControls are open
This commit is contained in:
parent
02e92f9a8f
commit
9ebc6ecb7e
@ -1,4 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
|
* SPDX-FileCopyrightText: 2020 Devin Lin <espidev@gmail.com>
|
||||||
* SPDX-FileCopyrightText: 2021 Bart De Vries <bart@mogwai.be>
|
* SPDX-FileCopyrightText: 2021 Bart De Vries <bart@mogwai.be>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||||
@ -48,25 +49,40 @@ Flickable {
|
|||||||
toClose.stop();
|
toClose.stop();
|
||||||
propagateComposedEvents = true;
|
propagateComposedEvents = true;
|
||||||
}
|
}
|
||||||
onReleased: footerBar.resetToBounds()
|
onReleased: footerBar.resetToBoundsOnFlick()
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetToBounds() {
|
function resetToBoundsOnFlick() {
|
||||||
if (!atYBeginning && !atYEnd) {
|
if (!atYBeginning || !atYEnd) {
|
||||||
if (footerBar.verticalVelocity > 0) {
|
if (footerBar.verticalVelocity > 0) {
|
||||||
toOpen.restart();
|
toOpen.restart();
|
||||||
} else if (footerBar.verticalVelocity < 0) {
|
} else if (footerBar.verticalVelocity < 0) {
|
||||||
toClose.restart();
|
toClose.restart();
|
||||||
|
} else { // i.e. when verticalVelocity === 0
|
||||||
|
if (contentY > contentHeight / 4) {
|
||||||
|
toOpen.restart();
|
||||||
|
} else {
|
||||||
|
toClose.restart();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resetToBoundsOnResize() {
|
||||||
|
if (contentY > contentHeight / 4) {
|
||||||
|
contentY = contentHeight / 2;
|
||||||
|
} else {
|
||||||
|
contentY = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMovementStarted: {
|
onMovementStarted: {
|
||||||
toOpen.stop();
|
toOpen.stop();
|
||||||
toClose.stop();
|
toClose.stop();
|
||||||
}
|
}
|
||||||
onFlickStarted: resetToBounds()
|
onFlickStarted: resetToBoundsOnFlick()
|
||||||
onMovementEnded: resetToBounds()
|
onMovementEnded: resetToBoundsOnFlick()
|
||||||
|
onHeightChanged: resetToBoundsOnResize()
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: background
|
id: background
|
||||||
|
Loading…
x
Reference in New Issue
Block a user