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 2.15
|
|
|
|
|
import QtQuick.Layouts 1.1
|
|
|
|
|
import QtQuick.Controls 2.3 as Controls
|
|
|
|
|
import Qt5Compat.GraphicalEffects
|
|
|
|
|
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
|
|
|
|
|
|
|
|
import org.kde.kquickcontrolsaddons 2.0
|
|
|
|
|
|
2025-07-16 17:02:18 +00:00
|
|
|
import plasma.applet.org.kde.plasma.mobile.homescreen.folio as Folio
|
2023-10-22 03:59:27 +00:00
|
|
|
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
2023-11-02 11:08:17 +00:00
|
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
Folio.DelegateTouchArea {
|
2024-06-21 04:42:14 +00:00
|
|
|
id: root
|
|
|
|
|
property Folio.HomeScreen folio
|
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
|
|
|
property MobileShell.MaskManager maskManager
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
property string name
|
|
|
|
|
property bool shadow: false
|
|
|
|
|
|
|
|
|
|
property alias contentItem: visualItem.contentItem
|
|
|
|
|
property alias delegateItem: delegateWrapper
|
|
|
|
|
property alias labelOpacity: label.opacity
|
|
|
|
|
|
|
|
|
|
signal afterClickAnimation()
|
|
|
|
|
|
|
|
|
|
// grow/shrink animation
|
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
|
|
|
property real scaleAmount: 1
|
2023-10-22 03:59:27 +00:00
|
|
|
property bool clickRequested: false
|
|
|
|
|
|
2025-07-10 16:54:01 +00:00
|
|
|
function keyboardFocus() {
|
|
|
|
|
delegateWrapper.forceActiveFocus();
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
NumberAnimation on scaleAmount {
|
2023-10-22 03:59:27 +00:00
|
|
|
id: shrinkAnim
|
|
|
|
|
running: false
|
|
|
|
|
duration: ShellSettings.Settings.animationsEnabled ? 80 : 1
|
|
|
|
|
to: ShellSettings.Settings.animationsEnabled ? 0.8 : 1
|
|
|
|
|
onFinished: {
|
2024-06-21 04:42:14 +00:00
|
|
|
if (!root.pressed) {
|
2023-10-22 03:59:27 +00:00
|
|
|
growAnim.restart();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
NumberAnimation on scaleAmount {
|
2023-10-22 03:59:27 +00:00
|
|
|
id: growAnim
|
|
|
|
|
running: false
|
|
|
|
|
duration: ShellSettings.Settings.animationsEnabled ? 80 : 1
|
|
|
|
|
to: 1
|
|
|
|
|
onFinished: {
|
2024-06-21 04:42:14 +00:00
|
|
|
if (root.clickRequested) {
|
|
|
|
|
root.afterClickAnimation();
|
|
|
|
|
root.clickRequested = false;
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
|
onPressedChanged: (pressed) => {
|
|
|
|
|
if (pressed) {
|
|
|
|
|
growAnim.stop();
|
|
|
|
|
shrinkAnim.restart();
|
|
|
|
|
} else if (!pressed && !shrinkAnim.running) {
|
|
|
|
|
growAnim.restart();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// trigger handled by press animation
|
|
|
|
|
onClicked: clickRequested = true;
|
|
|
|
|
|
2025-07-10 16:54:01 +00:00
|
|
|
FocusScope {
|
2023-10-22 03:59:27 +00:00
|
|
|
id: delegateWrapper
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
2025-07-10 16:54:01 +00:00
|
|
|
// Select keyboard navigation
|
|
|
|
|
Keys.onPressed: (event) => {
|
|
|
|
|
switch (event.key) {
|
|
|
|
|
case Qt.Key_Enter:
|
|
|
|
|
case Qt.Key_Return:
|
|
|
|
|
case Qt.Key_Space:
|
|
|
|
|
root.afterClickAnimation();
|
|
|
|
|
event.accepted = true;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KeyboardHighlight {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
visible: delegateWrapper.activeFocus
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-22 03:59:27 +00:00
|
|
|
ColumnLayout {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
spacing: 0
|
|
|
|
|
|
2025-07-10 16:54:01 +00:00
|
|
|
layer.enabled: root.shadow
|
|
|
|
|
layer.effect: DelegateShadow {}
|
|
|
|
|
|
2023-10-22 03:59:27 +00:00
|
|
|
// transform is not on delegateWrapper because when it's zoomed in, it apparently
|
|
|
|
|
// affects the delegate's x and y position, which messes up the starting drag and drop
|
|
|
|
|
// position (for mapFromItem in HomeScreen.qml)
|
|
|
|
|
transform: Scale {
|
2024-06-21 04:42:14 +00:00
|
|
|
origin.x: root.width / 2;
|
|
|
|
|
origin.y: root.height / 2;
|
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
|
|
|
xScale: root.scaleAmount
|
|
|
|
|
yScale: root.scaleAmount
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MobileShell.BaseItem {
|
|
|
|
|
id: visualItem
|
|
|
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
2024-06-21 04:42:14 +00:00
|
|
|
Layout.minimumWidth: folio.FolioSettings.delegateIconSize
|
|
|
|
|
Layout.minimumHeight: folio.FolioSettings.delegateIconSize
|
2023-10-22 03:59:27 +00:00
|
|
|
Layout.preferredHeight: Layout.minimumHeight
|
|
|
|
|
|
|
|
|
|
// darken effect when hovered
|
|
|
|
|
// TODO: removed for now, since hovered property seems to overlap with the touch pressed event
|
|
|
|
|
// layer {
|
2024-06-21 04:42:14 +00:00
|
|
|
// enabled: root.hovered
|
2023-10-22 03:59:27 +00:00
|
|
|
// effect: ColorOverlay {
|
|
|
|
|
// color: Qt.rgba(0, 0, 0, 0.3)
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DelegateLabel {
|
|
|
|
|
id: label
|
|
|
|
|
opacity: text.length > 0
|
|
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
2024-06-21 04:42:14 +00:00
|
|
|
Layout.preferredHeight: folio.HomeScreenState.pageDelegateLabelHeight
|
|
|
|
|
Layout.topMargin: folio.HomeScreenState.pageDelegateLabelSpacing
|
2023-10-22 03:59:27 +00:00
|
|
|
Layout.leftMargin: -parent.anchors.leftMargin + Kirigami.Units.smallSpacing
|
|
|
|
|
Layout.rightMargin: -parent.anchors.rightMargin + Kirigami.Units.smallSpacing
|
|
|
|
|
|
2024-06-21 04:42:14 +00:00
|
|
|
text: root.name
|
2023-10-22 03:59:27 +00:00
|
|
|
color: "white"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|