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.Window
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import QtQuick.Controls as QQC2
|
|
|
|
|
|
|
|
|
|
import org.kde.kirigami 2.20 as Kirigami
|
|
|
|
|
|
|
|
|
|
import org.kde.plasma.components 3.0 as PC3
|
2023-11-02 11:08:17 +00:00
|
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
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 '../delegate'
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
id: root
|
2024-06-21 04:42:14 +00:00
|
|
|
property Folio.HomeScreen folio
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
property var homeScreen
|
|
|
|
|
property real settingsModeHomeScreenScale
|
|
|
|
|
|
2025-07-03 19:00:52 +00:00
|
|
|
readonly property bool homeScreenInteractive: !appletListViewerLoader.active
|
2023-11-05 05:14:39 +00:00
|
|
|
|
2025-04-25 01:23:48 +00:00
|
|
|
property real bottomMargin: 0
|
|
|
|
|
property real leftMargin: 0
|
|
|
|
|
property real rightMargin: 0
|
|
|
|
|
|
2024-07-26 20:34:12 +00:00
|
|
|
Connections {
|
|
|
|
|
target: folio.HomeScreenState
|
|
|
|
|
|
|
|
|
|
// Close applet viewer when settings view closes
|
|
|
|
|
function onViewStateChanged() {
|
|
|
|
|
if (folio.HomeScreenState.viewState !== Folio.HomeScreenState.SettingsView) {
|
2025-07-03 19:00:52 +00:00
|
|
|
appletListViewerLoader.requestClose();
|
2024-07-26 20:34:12 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-22 03:59:27 +00:00
|
|
|
MouseArea {
|
|
|
|
|
id: closeSettings
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
2024-06-21 04:42:14 +00:00
|
|
|
folio.HomeScreenState.closeSettingsView();
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
id: settingsBar
|
|
|
|
|
|
|
|
|
|
Kirigami.Theme.inherit: false
|
|
|
|
|
Kirigami.Theme.colorSet: Kirigami.Theme.Complementary
|
|
|
|
|
|
2025-04-25 01:23:48 +00:00
|
|
|
anchors.bottomMargin: folio.HomeScreenState.favouritesBarLocation === Folio.HomeScreenState.Bottom ? Kirigami.Units.largeSpacing + Math.round(root.bottomMargin / 2) : 0
|
|
|
|
|
anchors.rightMargin: folio.HomeScreenState.favouritesBarLocation === Folio.HomeScreenState.Right ? Kirigami.Units.largeSpacing + Math.round(root.rightMargin / 2) : 0
|
|
|
|
|
anchors.leftMargin: folio.HomeScreenState.favouritesBarLocation === Folio.HomeScreenState.Left ? Kirigami.Units.largeSpacing + Math.round(root.leftMargin / 2) : 0
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2025-04-25 01:23:48 +00:00
|
|
|
GridLayout {
|
2023-10-22 03:59:27 +00:00
|
|
|
id: settingsOptions
|
2025-04-25 01:23:48 +00:00
|
|
|
flow: folio.HomeScreenState.favouritesBarLocation === Folio.HomeScreenState.Bottom ? GridLayout.LeftToRight : GridLayout.TopToBottom
|
|
|
|
|
|
2023-10-22 03:59:27 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
|
|
2023-10-23 15:40:26 +00:00
|
|
|
PC3.ToolButton {
|
2023-11-14 04:26:45 +00:00
|
|
|
opacity: 0.9
|
2023-10-22 03:59:27 +00:00
|
|
|
implicitHeight: Kirigami.Units.gridUnit * 4
|
|
|
|
|
implicitWidth: Kirigami.Units.gridUnit * 5
|
2023-11-14 04:26:45 +00:00
|
|
|
|
|
|
|
|
contentItem: ColumnLayout {
|
|
|
|
|
spacing: Kirigami.Units.largeSpacing
|
|
|
|
|
|
|
|
|
|
Kirigami.Icon {
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
|
|
|
|
implicitWidth: Kirigami.Units.iconSizes.smallMedium
|
|
|
|
|
implicitHeight: Kirigami.Units.iconSizes.smallMedium
|
|
|
|
|
source: 'edit-image'
|
|
|
|
|
}
|
2024-06-21 04:42:14 +00:00
|
|
|
|
2023-11-14 04:26:45 +00:00
|
|
|
QQC2.Label {
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
|
|
|
|
text: i18n('Wallpapers')
|
|
|
|
|
font.bold: true
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-01-02 03:30:55 +00:00
|
|
|
|
|
|
|
|
onClicked: {
|
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
|
|
|
homeScreen.wallpaperSelectorTriggered();
|
2024-06-21 04:42:14 +00:00
|
|
|
folio.HomeScreenState.closeSettingsView();
|
2024-01-02 03:30:55 +00:00
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
|
2023-10-23 15:40:26 +00:00
|
|
|
PC3.ToolButton {
|
2023-11-14 04:26:45 +00:00
|
|
|
opacity: 0.9
|
2023-10-22 03:59:27 +00:00
|
|
|
implicitHeight: Kirigami.Units.gridUnit * 4
|
|
|
|
|
implicitWidth: Kirigami.Units.gridUnit * 5
|
|
|
|
|
|
2023-11-14 04:26:45 +00:00
|
|
|
contentItem: ColumnLayout {
|
|
|
|
|
spacing: Kirigami.Units.largeSpacing
|
|
|
|
|
|
|
|
|
|
Kirigami.Icon {
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
|
|
|
|
implicitWidth: Kirigami.Units.iconSizes.smallMedium
|
|
|
|
|
implicitHeight: Kirigami.Units.iconSizes.smallMedium
|
|
|
|
|
source: 'settings-configure'
|
|
|
|
|
}
|
2024-06-21 04:42:14 +00:00
|
|
|
|
2023-11-14 04:26:45 +00:00
|
|
|
QQC2.Label {
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
|
|
|
|
text: i18n('Settings')
|
|
|
|
|
font.bold: true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-22 17:20:32 +00:00
|
|
|
onClicked: {
|
|
|
|
|
// ensure that if the window is already opened, it gets raised to the top
|
|
|
|
|
settingsWindow.hide();
|
|
|
|
|
settingsWindow.showMaximized();
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
|
2023-10-23 15:40:26 +00:00
|
|
|
PC3.ToolButton {
|
2023-11-14 04:26:45 +00:00
|
|
|
opacity: 0.9
|
2023-10-22 03:59:27 +00:00
|
|
|
implicitHeight: Kirigami.Units.gridUnit * 4
|
|
|
|
|
implicitWidth: Kirigami.Units.gridUnit * 5
|
2023-11-05 05:14:39 +00:00
|
|
|
|
2023-11-14 04:26:45 +00:00
|
|
|
contentItem: ColumnLayout {
|
|
|
|
|
spacing: Kirigami.Units.largeSpacing
|
|
|
|
|
|
|
|
|
|
Kirigami.Icon {
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
|
|
|
|
implicitWidth: Kirigami.Units.iconSizes.smallMedium
|
|
|
|
|
implicitHeight: Kirigami.Units.iconSizes.smallMedium
|
|
|
|
|
source: 'widget-alternatives'
|
|
|
|
|
}
|
2024-06-21 04:42:14 +00:00
|
|
|
|
2023-11-14 04:26:45 +00:00
|
|
|
QQC2.Label {
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
|
|
|
|
text: i18n('Widgets')
|
|
|
|
|
font.bold: true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-05 05:14:39 +00:00
|
|
|
onClicked: {
|
2025-07-03 19:00:52 +00:00
|
|
|
appletListViewerLoader.active = true;
|
2023-11-05 05:14:39 +00:00
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-25 01:23:48 +00:00
|
|
|
states: [
|
|
|
|
|
State {
|
|
|
|
|
name: "bottom"
|
|
|
|
|
when: folio.HomeScreenState.favouritesBarLocation === Folio.HomeScreenState.Bottom
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: settingsBar
|
|
|
|
|
height: root.height * (1 - root.settingsModeHomeScreenScale)
|
|
|
|
|
}
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: settingsBar
|
|
|
|
|
anchors.top: undefined
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
}
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: closeSettings
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.bottom: settingsBar.top
|
|
|
|
|
}
|
|
|
|
|
}, State {
|
|
|
|
|
name: "left"
|
|
|
|
|
when: folio.HomeScreenState.favouritesBarLocation === Folio.HomeScreenState.Left
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: settingsBar
|
|
|
|
|
width: root.width * (1 - root.settingsModeHomeScreenScale)
|
|
|
|
|
}
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: settingsBar
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: undefined
|
|
|
|
|
}
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: closeSettings
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.left: settingsBar.right
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
}
|
|
|
|
|
}, State {
|
|
|
|
|
name: "right"
|
|
|
|
|
when: folio.HomeScreenState.favouritesBarLocation === Folio.HomeScreenState.Right
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: settingsBar
|
|
|
|
|
width: root.width * (1 - root.settingsModeHomeScreenScale)
|
|
|
|
|
}
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: settingsBar
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.left: undefined
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
}
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: closeSettings
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: settingsBar.left
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
2025-07-03 19:00:52 +00:00
|
|
|
Loader {
|
|
|
|
|
id: appletListViewerLoader
|
|
|
|
|
asynchronous: true
|
|
|
|
|
active: false
|
2023-11-05 05:14:39 +00:00
|
|
|
|
2025-07-03 19:00:52 +00:00
|
|
|
signal requestClose()
|
|
|
|
|
onRequestClose: item?.requestClose()
|
2023-11-05 05:14:39 +00:00
|
|
|
|
2025-07-03 19:00:52 +00:00
|
|
|
width: parent.width
|
|
|
|
|
height: parent.height
|
2023-11-05 05:14:39 +00:00
|
|
|
|
2025-07-03 19:00:52 +00:00
|
|
|
opacity: status == Loader.Ready ? 1 : 0
|
2023-11-05 05:14:39 +00:00
|
|
|
// move the settings out of the way if it is not visible
|
|
|
|
|
// NOTE: we do this instead of setting visible to false, because
|
|
|
|
|
// it doesn't mess with widget drag and drop
|
2025-07-03 19:00:52 +00:00
|
|
|
y: (opacity > 0) ? 0 : parent.height
|
2023-11-05 05:14:39 +00:00
|
|
|
|
|
|
|
|
Behavior on opacity {
|
|
|
|
|
NumberAnimation { duration: Kirigami.Units.shortDuration }
|
|
|
|
|
}
|
2025-07-16 17:02:18 +00:00
|
|
|
|
2025-07-03 19:00:52 +00:00
|
|
|
sourceComponent: AppletListViewer {
|
|
|
|
|
id: appletListViewer
|
|
|
|
|
folio: root.folio
|
|
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: parent.height
|
|
|
|
|
|
|
|
|
|
onRequestClose: parent.active = false
|
|
|
|
|
|
|
|
|
|
homeScreen: root.homeScreen
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PC3.BusyIndicator {
|
|
|
|
|
id: appletListLoadingIndicator
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
visible: appletListViewerLoader.status === Loader.Loading
|
|
|
|
|
|
|
|
|
|
implicitHeight: Kirigami.Units.iconSizes.huge
|
|
|
|
|
implicitWidth: Kirigami.Units.iconSizes.huge
|
|
|
|
|
|
|
|
|
|
Kirigami.Theme.inherit: false
|
|
|
|
|
Kirigami.Theme.colorSet: Kirigami.Theme.Complementary
|
2023-11-05 05:14:39 +00:00
|
|
|
}
|
|
|
|
|
|
2023-10-22 03:59:27 +00:00
|
|
|
SettingsWindow {
|
|
|
|
|
id: settingsWindow
|
2024-06-21 04:42:14 +00:00
|
|
|
folio: root.folio
|
2023-10-22 03:59:27 +00:00
|
|
|
visible: false
|
|
|
|
|
|
|
|
|
|
onRequestConfigureMenu: {
|
|
|
|
|
homeScreen.openConfigure()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|