2023-03-05 02:40:06 +00:00
|
|
|
// SPDX-FileCopyrightText: 2022-2023 Devin Lin <devin@kde.org>
|
2022-06-08 22:09:35 +00:00
|
|
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
|
|
2023-03-05 02:40:06 +00:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Window
|
|
|
|
|
import QtQuick.Layouts
|
2022-06-08 22:09:35 +00:00
|
|
|
|
2023-03-05 02:40:06 +00:00
|
|
|
import org.kde.plasma.plasmoid
|
2022-06-08 22:09:35 +00:00
|
|
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
2023-07-25 01:13:52 +00:00
|
|
|
import org.kde.kirigami 2.20 as Kirigami
|
2022-06-08 22:09:35 +00:00
|
|
|
|
2023-03-05 02:40:06 +00:00
|
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
|
|
|
|
import org.kde.plasma.private.mobileshell.state as MobileShellState
|
2023-03-15 15:20:15 +00:00
|
|
|
import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin
|
2022-06-08 22:09:35 +00:00
|
|
|
|
2025-07-15 02:05:18 +00:00
|
|
|
import plasma.applet.org.kde.plasma.mobile.homescreen.halcyon as Halcyon
|
|
|
|
|
|
2023-06-12 23:58:17 +00:00
|
|
|
ContainmentItem {
|
2022-06-08 22:09:35 +00:00
|
|
|
id: root
|
2024-06-23 22:47:24 +00:00
|
|
|
|
2022-06-08 22:09:35 +00:00
|
|
|
Component.onCompleted: {
|
2025-07-16 05:42:56 +00:00
|
|
|
Plasmoid.settings.load();
|
|
|
|
|
Plasmoid.pinnedModel.load();
|
|
|
|
|
|
2022-06-18 19:42:29 +00:00
|
|
|
Halcyon.ApplicationListModel.loadApplications();
|
2022-06-08 22:09:35 +00:00
|
|
|
forceActiveFocus();
|
|
|
|
|
}
|
2024-06-23 22:47:24 +00:00
|
|
|
|
2023-03-12 20:35:02 +00:00
|
|
|
Plasmoid.onActivated: {
|
2022-09-24 18:19:02 +00:00
|
|
|
// there's a couple of steps:
|
|
|
|
|
// - minimize windows (only if we are in an app)
|
|
|
|
|
// - open app drawer
|
|
|
|
|
// - close app drawer and, if necessary, restore windows
|
2023-03-06 06:38:43 +00:00
|
|
|
|
2023-03-20 01:32:19 +00:00
|
|
|
// Always close action drawer
|
|
|
|
|
if (MobileShellState.ShellDBusClient.isActionDrawerOpen) {
|
|
|
|
|
MobileShellState.ShellDBusClient.closeActionDrawer();
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-23 22:47:24 +00:00
|
|
|
if (!WindowPlugin.WindowUtil.isShowingDesktop && windowMaximizedTracker.showingWindow || search.isOpen) {
|
2023-03-06 06:38:43 +00:00
|
|
|
// Always close the search widget as well
|
2022-09-27 15:25:43 +00:00
|
|
|
if (search.isOpen) {
|
|
|
|
|
search.close();
|
|
|
|
|
}
|
2023-03-12 20:35:02 +00:00
|
|
|
|
2023-06-12 23:58:17 +00:00
|
|
|
halcyonHomeScreen.page = 0;
|
2023-03-12 20:35:02 +00:00
|
|
|
|
2023-03-19 01:48:49 +00:00
|
|
|
WindowPlugin.WindowUtil.isShowingDesktop = true;
|
2023-06-12 23:58:17 +00:00
|
|
|
} else if (halcyonHomeScreen.page == 0) {
|
|
|
|
|
halcyonHomeScreen.page = 1;
|
2022-09-24 18:19:02 +00:00
|
|
|
} else {
|
2023-03-19 01:48:49 +00:00
|
|
|
WindowPlugin.WindowUtil.isShowingDesktop = false;
|
2023-06-12 23:58:17 +00:00
|
|
|
halcyonHomeScreen.page = 0;
|
2022-09-24 18:19:02 +00:00
|
|
|
}
|
|
|
|
|
}
|
2023-06-12 23:58:17 +00:00
|
|
|
|
2024-06-23 22:47:24 +00:00
|
|
|
WindowPlugin.WindowMaximizedTracker {
|
|
|
|
|
id: windowMaximizedTracker
|
|
|
|
|
screenGeometry: Plasmoid.containment.screenGeometry
|
|
|
|
|
}
|
|
|
|
|
|
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: MobileShell.MaskManager {
|
|
|
|
|
height: root.height
|
|
|
|
|
width: root.width
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
property MobileShell.MaskManager frontMaskManager: MobileShell.MaskManager {
|
|
|
|
|
height: root.height
|
|
|
|
|
width: root.width
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// wallpaper blur layer
|
|
|
|
|
MobileShell.BlurEffect {
|
2025-06-25 23:22:58 +00:00
|
|
|
id: wallpaperBlur
|
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
|
|
|
active: Plasmoid.settings.wallpaperBlurEffect > 0
|
2025-06-25 23:22:58 +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
|
|
|
sourceLayer: Plasmoid.wallpaperGraphicsObject
|
|
|
|
|
maskSourceLayer: Plasmoid.settings.wallpaperBlurEffect > 1 ? maskManager.maskLayer : null
|
|
|
|
|
|
|
|
|
|
fullBlur: Math.min(1,
|
|
|
|
|
Math.max(1 - homeScreen.contentOpacity,
|
|
|
|
|
halcyonHomeScreen.settingsOpenFactor,
|
|
|
|
|
root.darkenBackgroundFactor,
|
|
|
|
|
search.openFactor
|
|
|
|
|
)
|
2025-06-25 23:22:58 +00:00
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
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 darkenBackgroundFactor: halcyonHomeScreen.page == 1 ? 1 : 0
|
|
|
|
|
Behavior on darkenBackgroundFactor {
|
|
|
|
|
NumberAnimation { duration: Kirigami.Units.longDuration }
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-12 23:58:17 +00:00
|
|
|
Rectangle {
|
|
|
|
|
id: darkenBackground
|
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
|
|
|
color: Qt.rgba(0, 0, 0, 0.2 + (0.5 * root.darkenBackgroundFactor))
|
2023-06-12 23:58:17 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-02 03:30:55 +00:00
|
|
|
Rectangle {
|
|
|
|
|
id: darkenSettingsBackground
|
|
|
|
|
color: Qt.rgba(0, 0, 0, 0.7)
|
|
|
|
|
opacity: halcyonHomeScreen.settingsOpenFactor
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
Behavior on color {
|
|
|
|
|
ColorAnimation { duration: Kirigami.Units.longDuration }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-12 23:58:17 +00:00
|
|
|
MobileShell.HomeScreen {
|
|
|
|
|
id: homeScreen
|
|
|
|
|
anchors.fill: parent
|
2023-09-20 12:41:40 +00:00
|
|
|
plasmoidItem: root
|
2023-06-12 23:58:17 +00:00
|
|
|
|
|
|
|
|
onResetHomeScreenPosition: {
|
|
|
|
|
halcyonHomeScreen.triggerHomescreen();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onHomeTriggered: {
|
|
|
|
|
search.close();
|
2022-06-08 22:09:35 +00:00
|
|
|
}
|
2023-06-12 23:58:17 +00:00
|
|
|
|
|
|
|
|
// homescreen component
|
|
|
|
|
contentItem: Item {
|
|
|
|
|
HomeScreen {
|
|
|
|
|
id: halcyonHomeScreen
|
|
|
|
|
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
|
|
|
maskManager: root.maskManager
|
2023-06-12 23:58:17 +00:00
|
|
|
|
|
|
|
|
topMargin: homeScreen.topMargin
|
|
|
|
|
bottomMargin: homeScreen.bottomMargin
|
|
|
|
|
leftMargin: homeScreen.leftMargin
|
|
|
|
|
rightMargin: homeScreen.rightMargin
|
|
|
|
|
|
|
|
|
|
searchWidget: search
|
2024-07-15 00:23:00 +00:00
|
|
|
interactive: true
|
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
|
|
|
|
|
|
|
|
onWallpaperSelectorTriggered: wallpaperSelectorLoader.active = true
|
2023-06-12 23:58:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// search component
|
2025-07-10 17:28:54 +00:00
|
|
|
SearchWidget {
|
2023-06-12 23:58:17 +00:00
|
|
|
id: search
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
visible: openFactor > 0
|
|
|
|
|
|
2025-07-10 17:28:54 +00:00
|
|
|
topPadding: homeScreen.topMargin
|
|
|
|
|
bottomPadding: homeScreen.bottomMargin
|
|
|
|
|
leftPadding: homeScreen.leftMargin
|
|
|
|
|
rightPadding: homeScreen.rightMargin
|
2023-06-12 23:58:17 +00:00
|
|
|
|
2025-07-10 17:28:54 +00:00
|
|
|
onReleaseFocusRequested: halcyonHomeScreen.forceActiveFocus()
|
2023-06-12 23:58:17 +00:00
|
|
|
}
|
2022-06-08 22:09:35 +00:00
|
|
|
}
|
|
|
|
|
}
|
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
|
|
|
|
|
|
|
|
// top blur layer for items on top of the base homescreen
|
|
|
|
|
MobileShell.BlurEffect {
|
|
|
|
|
id: homescreenBlur
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
active: Plasmoid.settings.wallpaperBlurEffect > 1 && wallpaperSelectorLoader.active
|
|
|
|
|
visible: active
|
|
|
|
|
fullBlur: 0
|
|
|
|
|
|
|
|
|
|
sourceLayer: homeScreenLayer
|
|
|
|
|
maskSourceLayer: frontMaskManager.maskLayer
|
|
|
|
|
|
|
|
|
|
// stacking both wallpaper and homescreen layers so we can blur them in one pass
|
|
|
|
|
Item {
|
|
|
|
|
id: homeScreenLayer
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
opacity: 0
|
|
|
|
|
|
|
|
|
|
// wallpaper blur
|
|
|
|
|
ShaderEffectSource {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
|
|
textureSize: homescreenBlur.textureSize
|
|
|
|
|
sourceItem: Plasmoid.wallpaperGraphicsObject
|
|
|
|
|
hideSource: false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// homescreen blur
|
|
|
|
|
ShaderEffectSource {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
|
|
textureSize: homescreenBlur.textureSize
|
|
|
|
|
sourceItem: homeScreen
|
|
|
|
|
hideSource: false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// loader for wallpaper selector
|
|
|
|
|
Loader {
|
|
|
|
|
id: wallpaperSelectorLoader
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
asynchronous: true
|
|
|
|
|
active: false
|
|
|
|
|
|
|
|
|
|
onLoaded: {
|
|
|
|
|
wallpaperSelectorLoader.item.open();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sourceComponent: MobileShell.WallpaperSelector {
|
|
|
|
|
maskManager: root.frontMaskManager
|
|
|
|
|
horizontal: root.width > root.height
|
|
|
|
|
edge: horizontal ? Qt.LeftEdge : Qt.BottomEdge
|
|
|
|
|
bottomMargin: horizontal ? 0 : halcyonHomeScreen.bottomMargin
|
|
|
|
|
leftMargin: horizontal ? halcyonHomeScreen.leftMargin : 0
|
|
|
|
|
rightMargin: horizontal ? halcyonHomeScreen.rightMargin : 0
|
|
|
|
|
onClosed: {
|
|
|
|
|
wallpaperSelectorLoader.active = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onWallpaperSettingsRequested: {
|
|
|
|
|
close();
|
|
|
|
|
halcyonHomeScreen.openContainmentSettings();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-03 06:11:51 +00:00
|
|
|
}
|
2022-06-08 22:09:35 +00:00
|
|
|
|
|
|
|
|
|