Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: windowed mode folder animation incorrect start point #380

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion qml/windowed/FreeSortListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ Item {
let idStr = model.desktopId
let strFolderId = Number(idStr.replace("internal/folders/", ""))
let strFolderName = model.display.startsWith("internal/category/") ? getCategoryName(model.display.substring(18)) : model.display
folderClicked(strFolderId, strFolderName, mapToItem(listView, 0, 0))
let offset = height / 2
folderClicked(strFolderId, strFolderName, mapToItem(listView, offset, offset))
} else {
launchApp(desktopId)
}
Expand Down
22 changes: 12 additions & 10 deletions qml/windowed/WindowedFrame.qml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ InputEventItem {
folderNameFont: LauncherController.adjustFontWeight(DTK.fontManager.t6, Font.Bold)
centerPosition: Qt.point(curPointX, curPointY)

readonly property int animationDuration: 200
property int startPointX: 0
property int startPointY: 0
readonly property point endPoint: Qt.point(parent.width / 2, parent.height / 2)
Expand All @@ -193,21 +194,21 @@ InputEventItem {
enter: Transition {
ParallelAnimation {
NumberAnimation {
duration: 200
duration: folderGridViewPopup.animationDuration
properties: "scale"
easing.type: Easing.OutQuad
from: 0.2
from: 0.1
to: 1
}
NumberAnimation {
duration: 200
duration: folderGridViewPopup.animationDuration
properties: "curPointX"
easing.type: Easing.OutQuad
from: folderGridViewPopup.startPointX
to: folderGridViewPopup.endPoint.x
}
NumberAnimation {
duration: 200
duration: folderGridViewPopup.animationDuration
properties: "curPointY"
easing.type: Easing.OutQuad
from: folderGridViewPopup.startPointY
Expand All @@ -219,21 +220,21 @@ InputEventItem {
exit: Transition {
ParallelAnimation {
NumberAnimation {
duration: 200
duration: folderGridViewPopup.animationDuration
properties: "scale"
easing.type: Easing.InQuad
from: 1
to: 0.2
to: 0.1
}
NumberAnimation {
duration: 200
duration: folderGridViewPopup.animationDuration
properties: "curPointX"
easing.type: Easing.InQuad
to: folderGridViewPopup.startPointX
from: folderGridViewPopup.endPoint.x
}
NumberAnimation {
duration: 200
duration: folderGridViewPopup.animationDuration
properties: "curPointY"
easing.type: Easing.InQuad
to: folderGridViewPopup.startPointY
Expand Down Expand Up @@ -300,8 +301,9 @@ InputEventItem {
Connections {
target: appList
function onFreeSortViewFolderClicked(folderId, folderName, triggerPosition) {
folderGridViewPopup.startPointX = rowLineControl.x + rowLineControl.width / 2
folderGridViewPopup.startPointY = triggerPosition.y
let point = mapFromItem(appList, triggerPosition)
folderGridViewPopup.startPointX = point.x
folderGridViewPopup.startPointY = point.y
folderGridViewPopup.currentFolderId = folderId
folderGridViewPopup.folderName = folderName
folderGridViewPopup.open()
Expand Down
Loading