2023-10-22 03:59:27 +00:00
|
|
|
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
|
|
|
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
|
|
|
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import QtQuick.Controls as Controls
|
|
|
|
|
import QtQuick.Effects
|
|
|
|
|
|
2026-03-07 03:08:07 +00:00
|
|
|
import org.kde.kirigami as Kirigami
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2025-07-16 17:02:18 +00:00
|
|
|
import plasma.applet.org.kde.plasma.mobile.homescreen.folio as Folio
|
2023-11-02 11:08:17 +00:00
|
|
|
import org.kde.plasma.private.mobileshell.state as MobileShellState
|
|
|
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
2024-03-10 03:50:55 +00:00
|
|
|
import org.kde.plasma.plasmoid
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
AbstractDelegate {
|
|
|
|
|
id: root
|
2024-06-21 04:42:14 +00:00
|
|
|
|
2023-10-22 03:59:27 +00:00
|
|
|
shadow: true
|
2025-03-19 15:09:09 +00:00
|
|
|
name: application ? application.name : ""
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2025-03-19 15:09:09 +00:00
|
|
|
// This may be null for short periods of time due to model changes
|
2023-10-22 03:59:27 +00:00
|
|
|
property Folio.FolioApplication application
|
|
|
|
|
|
|
|
|
|
property alias iconItem: icon
|
|
|
|
|
|
|
|
|
|
property bool turnToFolder: false
|
|
|
|
|
property bool turnToFolderAnimEnabled: false
|
2026-05-21 09:13:36 +00:00
|
|
|
readonly property int turnToFolderAnimationDuration: root.turnToFolderAnimEnabled ? MobileShell.Motion.duration(MobileShell.Motion.Standard) : 0
|
|
|
|
|
readonly property color folderFeedbackColor: Qt.rgba(Kirigami.Theme.highlightColor.r, Kirigami.Theme.highlightColor.g, Kirigami.Theme.highlightColor.b, 0.28)
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
function launchApp() {
|
2025-03-19 15:09:09 +00:00
|
|
|
if (!application) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-13 16:30:07 +00:00
|
|
|
if (application.icon !== "" && !root.application.running) {
|
2024-03-10 03:50:55 +00:00
|
|
|
MobileShellState.ShellDBusClient.openAppLaunchAnimationWithPosition(
|
|
|
|
|
Plasmoid.screen,
|
|
|
|
|
application.icon,
|
|
|
|
|
application.name,
|
2024-07-13 16:30:07 +00:00
|
|
|
application.storageId,
|
2024-03-10 03:50:55 +00:00
|
|
|
root.iconItem.Kirigami.ScenePosition.x + root.iconItem.width/2,
|
|
|
|
|
root.iconItem.Kirigami.ScenePosition.y + root.iconItem.height/2,
|
|
|
|
|
Math.min(root.iconItem.width, root.iconItem.height));
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
application.setMinimizedDelegate(root);
|
|
|
|
|
MobileShell.AppLaunch.launchOrActivateApp(application.storageId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onAfterClickAnimation: {
|
|
|
|
|
launchApp();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
contentItem: Item {
|
2024-06-21 04:42:14 +00:00
|
|
|
height: folio.FolioSettings.delegateIconSize
|
|
|
|
|
width: folio.FolioSettings.delegateIconSize
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2025-03-19 15:09:09 +00:00
|
|
|
// Background for folder creation animation
|
2023-10-22 03:59:27 +00:00
|
|
|
Rectangle {
|
|
|
|
|
id: rect
|
2024-07-27 04:02:05 +00:00
|
|
|
radius: Kirigami.Units.cornerRadius
|
2026-05-21 09:13:36 +00:00
|
|
|
color: root.folderFeedbackColor
|
2023-10-22 03:59:27 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
|
|
Folio/Halcyon: Expand Background Blur Effect using a MaskLayer
This merge request expands upon the folio and halcyon background blur effects, making the folio background blur include the backgrounds of folder icons, the favorites bar, and wallpaper selector, and for halcyon, it now includes the folder icons, app library, search, and wallpaper selector. To accomplish this, a mask layer plugin was created to easily attach to these elements. This way, we can use a `OpacityMask` to cut out from the existing blur layer, thus hopefully keeping the performance cost low. And with my limited testing, it does at least seems to run about the same on my oneplus 6t, though it is not really a low end device, so I can not fairly judge the impact for something slower (eg. PinePhone). To be on the safe side, a third option was also added to the folio settings, allowing for the ability to toggle back to the old functionality if needed.




2025-06-27 18:27:30 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
|
if (maskManager) {
|
|
|
|
|
maskManager.assignToMask(this)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-22 03:59:27 +00:00
|
|
|
opacity: root.turnToFolder ? 1 : 0
|
2026-05-21 09:13:36 +00:00
|
|
|
property real scaleAmount: root.turnToFolder ? 1.08 : 1.0
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
Behavior on scaleAmount {
|
|
|
|
|
enabled: root.turnToFolderAnimEnabled
|
2026-05-21 09:13:36 +00:00
|
|
|
MobileShell.MotionNumberAnimation { type: MobileShell.Motion.Standard; duration: root.turnToFolderAnimationDuration }
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
Behavior on opacity {
|
|
|
|
|
enabled: root.turnToFolderAnimEnabled
|
2026-05-21 09:13:36 +00:00
|
|
|
MobileShell.MotionNumberAnimation { type: MobileShell.Motion.Standard; duration: root.turnToFolderAnimationDuration }
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
transform: Scale {
|
|
|
|
|
origin.x: rect.width / 2
|
|
|
|
|
origin.y: rect.height / 2
|
|
|
|
|
xScale: rect.scaleAmount
|
|
|
|
|
yScale: rect.scaleAmount
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-19 15:09:09 +00:00
|
|
|
// Application icon
|
2023-10-22 03:59:27 +00:00
|
|
|
DelegateAppIcon {
|
|
|
|
|
id: icon
|
2024-06-21 04:42:14 +00:00
|
|
|
folio: root.folio
|
2023-10-22 03:59:27 +00:00
|
|
|
anchors.fill: parent
|
2025-03-19 15:09:09 +00:00
|
|
|
source: root.application ? root.application.icon : ""
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2026-05-21 09:13:36 +00:00
|
|
|
property real scaleAmount: root.turnToFolder ? 0.42 : 1.0
|
2023-10-22 03:59:27 +00:00
|
|
|
Behavior on scaleAmount {
|
|
|
|
|
enabled: root.turnToFolderAnimEnabled
|
2026-05-21 09:13:36 +00:00
|
|
|
MobileShell.MotionNumberAnimation { type: MobileShell.Motion.Standard; duration: root.turnToFolderAnimationDuration }
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
transform: Scale {
|
|
|
|
|
origin.x: icon.width / 2
|
|
|
|
|
origin.y: icon.height / 2
|
|
|
|
|
xScale: icon.scaleAmount
|
|
|
|
|
yScale: icon.scaleAmount
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-19 15:09:09 +00:00
|
|
|
// Running indicator
|
2023-10-22 03:59:27 +00:00
|
|
|
Rectangle {
|
|
|
|
|
anchors {
|
|
|
|
|
horizontalCenter: parent.horizontalCenter
|
|
|
|
|
bottom: parent.bottom
|
2023-11-17 05:38:02 +00:00
|
|
|
bottomMargin: -Kirigami.Units.smallSpacing
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
2025-03-19 15:09:09 +00:00
|
|
|
visible: root.application && root.application.running
|
2023-10-22 03:59:27 +00:00
|
|
|
radius: width
|
|
|
|
|
width: Kirigami.Units.smallSpacing
|
|
|
|
|
height: width
|
|
|
|
|
color: Kirigami.Theme.highlightColor
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|