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
|
2023-10-22 17:17:09 +00:00
|
|
|
import QtQuick.Dialogs
|
2023-10-22 03:59:27 +00:00
|
|
|
import QtQuick.Controls as QQC2
|
|
|
|
|
|
|
|
|
|
import org.kde.kirigami 2.20 as Kirigami
|
|
|
|
|
|
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.kirigamiaddons.formcard 1.0 as FormCard
|
|
|
|
|
|
|
|
|
|
import '../delegate'
|
|
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
Window {
|
2023-10-22 03:59:27 +00:00
|
|
|
id: root
|
2024-06-21 04:42:14 +00:00
|
|
|
property Folio.HomeScreen folio
|
|
|
|
|
|
2023-10-22 03:59:27 +00:00
|
|
|
flags: Qt.FramelessWindowHint
|
2023-11-05 17:46:17 +00:00
|
|
|
color: 'transparent'
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
onVisibleChanged: {
|
|
|
|
|
if (visible) {
|
|
|
|
|
opacityAnim.to = 1;
|
|
|
|
|
opacityAnim.restart();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onClosing: (close) => {
|
|
|
|
|
if (applicationItem.opacity !== 0) {
|
|
|
|
|
close.accepted = false;
|
|
|
|
|
opacityAnim.to = 0;
|
|
|
|
|
opacityAnim.restart();
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
signal requestConfigureMenu()
|
|
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
Kirigami.ApplicationItem {
|
|
|
|
|
id: applicationItem
|
|
|
|
|
anchors.fill: parent
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
opacity: 0
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
NumberAnimation on opacity {
|
|
|
|
|
id: opacityAnim
|
|
|
|
|
duration: 200
|
|
|
|
|
easing.type: Easing.OutCubic
|
|
|
|
|
onFinished: {
|
|
|
|
|
if (applicationItem.opacity === 0) {
|
|
|
|
|
root.close();
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
scale: 0.7 + 0.3 * applicationItem.opacity
|
|
|
|
|
|
|
|
|
|
pageStack.globalToolBar.style: Kirigami.ApplicationHeaderStyle.ToolBar
|
|
|
|
|
pageStack.globalToolBar.showNavigationButtons: Kirigami.ApplicationHeaderStyle.NoNavigationButtons;
|
|
|
|
|
|
|
|
|
|
pageStack.initialPage: Kirigami.ScrollablePage {
|
|
|
|
|
id: page
|
|
|
|
|
opacity: applicationItem.opacity
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
titleDelegate: RowLayout {
|
|
|
|
|
QQC2.ToolButton {
|
|
|
|
|
Layout.leftMargin: -Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing
|
|
|
|
|
icon.name: "arrow-left"
|
|
|
|
|
onClicked: root.close()
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
Kirigami.Heading {
|
|
|
|
|
level: 1
|
|
|
|
|
text: page.title
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
title: i18n("Homescreen Settings")
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
topPadding: 0
|
|
|
|
|
bottomPadding: 0
|
|
|
|
|
leftPadding: 0
|
|
|
|
|
rightPadding: 0
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
ColumnLayout {
|
|
|
|
|
FormCard.FormHeader {
|
|
|
|
|
title: i18n("Icons")
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FormCard.FormCard {
|
|
|
|
|
Kirigami.Theme.inherit: false
|
|
|
|
|
Kirigami.Theme.colorSet: Kirigami.Theme.Complementary
|
|
|
|
|
|
|
|
|
|
Item {
|
2024-06-21 04:42:14 +00:00
|
|
|
Layout.preferredHeight: folio.HomeScreenState.pageCellHeight
|
2023-11-05 17:46:17 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
|
|
AbstractDelegate {
|
2024-06-21 04:42:14 +00:00
|
|
|
folio: root.folio
|
2023-11-05 17:46:17 +00:00
|
|
|
anchors.centerIn: parent
|
2024-06-21 04:42:14 +00:00
|
|
|
implicitHeight: folio.HomeScreenState.pageCellHeight
|
|
|
|
|
implicitWidth: folio.HomeScreenState.pageCellWidth
|
2025-08-10 18:52:25 +00:00
|
|
|
name: i18n("Application")
|
2023-11-05 17:46:17 +00:00
|
|
|
|
|
|
|
|
contentItem: DelegateAppIcon {
|
2024-07-31 01:07:43 +00:00
|
|
|
height: root.folio.FolioSettings.delegateIconSize
|
|
|
|
|
width: root.folio.FolioSettings.delegateIconSize
|
2023-11-05 17:46:17 +00:00
|
|
|
source: 'applications-system'
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FormCard.FormCard {
|
|
|
|
|
id: iconsCard
|
2024-06-21 04:42:14 +00:00
|
|
|
readonly property bool isVerticalOrientation: folio.HomeScreenState.pageOrientation === Folio.HomeScreenState.RegularPosition ||
|
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
|
|
|
folio.HomeScreenState.pageOrientation === Folio.HomeScreenState.RotateUpsideDown
|
2023-11-05 17:46:17 +00:00
|
|
|
|
|
|
|
|
readonly property string numOfRowsText: i18n("Number of rows")
|
|
|
|
|
readonly property string numOfColumnsText: i18n("Number of columns")
|
|
|
|
|
|
|
|
|
|
FormCard.FormSpinBoxDelegate {
|
|
|
|
|
id: iconSizeSpinBox
|
|
|
|
|
label: i18n("Size of icons on homescreen")
|
|
|
|
|
from: 16
|
|
|
|
|
to: 128
|
2024-06-21 04:42:14 +00:00
|
|
|
value: folio.FolioSettings.delegateIconSize
|
2023-11-05 17:46:17 +00:00
|
|
|
onValueChanged: {
|
2024-06-21 04:42:14 +00:00
|
|
|
if (value !== folio.FolioSettings.delegateIconSize) {
|
|
|
|
|
folio.FolioSettings.delegateIconSize = value;
|
2023-11-05 17:46:17 +00:00
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FormCard.FormSpinBoxDelegate {
|
|
|
|
|
id: rowsSpinBox
|
|
|
|
|
label: iconsCard.isVerticalOrientation ? iconsCard.numOfRowsText : iconsCard.numOfColumnsText
|
|
|
|
|
from: 3
|
|
|
|
|
to: 10
|
2024-06-21 04:42:14 +00:00
|
|
|
value: folio.FolioSettings.homeScreenRows
|
2023-11-05 17:46:17 +00:00
|
|
|
onValueChanged: {
|
2024-06-21 04:42:14 +00:00
|
|
|
if (value !== folio.FolioSettings.homeScreenRows) {
|
|
|
|
|
folio.FolioSettings.homeScreenRows = value;
|
2023-11-05 17:46:17 +00:00
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FormCard.FormSpinBoxDelegate {
|
|
|
|
|
id: columnsSpinBox
|
|
|
|
|
label: iconsCard.isVerticalOrientation ? iconsCard.numOfColumnsText : iconsCard.numOfRowsText
|
|
|
|
|
from: 3
|
|
|
|
|
to: 10
|
2024-06-21 04:42:14 +00:00
|
|
|
value: folio.FolioSettings.homeScreenColumns
|
2023-11-05 17:46:17 +00:00
|
|
|
onValueChanged: {
|
2024-06-21 04:42:14 +00:00
|
|
|
if (value !== folio.FolioSettings.homeScreenColumns) {
|
|
|
|
|
folio.FolioSettings.homeScreenColumns = value;
|
2023-11-05 17:46:17 +00:00
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FormCard.FormSectionText {
|
|
|
|
|
text: i18n("The rows and columns will swap depending on the screen rotation.")
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FormCard.FormHeader {
|
|
|
|
|
title: i18n("Homescreen")
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FormCard.FormCard {
|
|
|
|
|
FormCard.FormSwitchDelegate {
|
|
|
|
|
id: showLabelsOnHomeScreen
|
|
|
|
|
text: i18n("Show labels on homescreen")
|
2024-06-21 04:42:14 +00:00
|
|
|
checked: folio.FolioSettings.showPagesAppLabels
|
2023-11-05 17:46:17 +00:00
|
|
|
onCheckedChanged: {
|
2024-06-21 04:42:14 +00:00
|
|
|
if (checked != folio.FolioSettings.showPagesAppLabels) {
|
|
|
|
|
folio.FolioSettings.showPagesAppLabels = checked;
|
2023-11-05 17:46:17 +00:00
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FormCard.FormDelegateSeparator { above: showLabelsOnHomeScreen; below: showLabelsInFavourites }
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FormCard.FormSwitchDelegate {
|
|
|
|
|
id: showLabelsInFavourites
|
|
|
|
|
text: i18n("Show labels in favorites bar")
|
2024-06-21 04:42:14 +00:00
|
|
|
checked: folio.FolioSettings.showFavouritesAppLabels
|
2023-11-05 17:46:17 +00:00
|
|
|
onCheckedChanged: {
|
2024-06-21 04:42:14 +00:00
|
|
|
if (checked != folio.FolioSettings.showFavouritesAppLabels) {
|
|
|
|
|
folio.FolioSettings.showFavouritesAppLabels = checked;
|
2023-11-05 17:46:17 +00:00
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
2023-10-22 19:34:02 +00:00
|
|
|
|
2025-04-21 14:01:54 +00:00
|
|
|
FormCard.FormDelegateSeparator { above: showLabelsInFavourites; below: lockLayout }
|
|
|
|
|
|
|
|
|
|
FormCard.FormSwitchDelegate {
|
|
|
|
|
id: lockLayout
|
|
|
|
|
text: i18n("Lock layout")
|
|
|
|
|
checked: folio.FolioSettings.lockLayout
|
|
|
|
|
onCheckedChanged: {
|
|
|
|
|
if (checked != folio.FolioSettings.lockLayout) {
|
|
|
|
|
folio.FolioSettings.lockLayout = checked;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FormCard.FormDelegateSeparator { above: lockLayout; below: pageTransitionCombobox }
|
2023-11-05 17:46:17 +00:00
|
|
|
|
|
|
|
|
FormCard.FormComboBoxDelegate {
|
|
|
|
|
id: pageTransitionCombobox
|
|
|
|
|
text: i18n("Page transition effect")
|
|
|
|
|
|
2024-06-21 04:42:14 +00:00
|
|
|
currentIndex: indexOfValue(folio.FolioSettings.pageTransitionEffect)
|
2023-11-05 17:46:17 +00:00
|
|
|
model: ListModel {
|
|
|
|
|
// we can't use i18n with ListElement
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
append({"name": i18n("Slide"), "value": Folio.FolioSettings.SlideTransition});
|
|
|
|
|
append({"name": i18n("Cube"), "value": Folio.FolioSettings.CubeTransition});
|
|
|
|
|
append({"name": i18n("Fade"), "value": Folio.FolioSettings.FadeTransition});
|
|
|
|
|
append({"name": i18n("Stack"), "value": Folio.FolioSettings.StackTransition});
|
|
|
|
|
append({"name": i18n("Rotation"), "value": Folio.FolioSettings.RotationTransition});
|
|
|
|
|
|
|
|
|
|
// indexOfValue doesn't bind to model changes unfortunately, set currentIndex manually here
|
2024-06-21 04:42:14 +00:00
|
|
|
pageTransitionCombobox.currentIndex = pageTransitionCombobox.indexOfValue(folio.FolioSettings.pageTransitionEffect)
|
2023-11-05 17:46:17 +00:00
|
|
|
}
|
2023-10-22 19:34:02 +00:00
|
|
|
}
|
|
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
textRole: "name"
|
|
|
|
|
valueRole: "value"
|
2023-10-22 19:34:02 +00:00
|
|
|
|
2024-06-21 04:42:14 +00:00
|
|
|
onCurrentValueChanged: folio.FolioSettings.pageTransitionEffect = currentValue
|
2023-11-05 17:46:17 +00:00
|
|
|
}
|
2025-06-25 20:39:36 +00:00
|
|
|
|
2025-06-27 04:14:26 +00:00
|
|
|
FormCard.FormDelegateSeparator { above: pageTransitionCombobox; below: doubleTapToLockSwitch }
|
2025-06-25 20:39:36 +00:00
|
|
|
|
|
|
|
|
FormCard.FormSwitchDelegate {
|
2025-06-27 04:14:26 +00:00
|
|
|
id: doubleTapToLockSwitch
|
2025-06-25 20:39:36 +00:00
|
|
|
text: i18n("Double tap to lock device")
|
2025-06-27 04:14:26 +00:00
|
|
|
checked: folio.FolioSettings.doubleTapToLock
|
2025-06-25 20:39:36 +00:00
|
|
|
onCheckedChanged: {
|
2025-06-27 04:14:26 +00:00
|
|
|
if (checked != folio.FolioSettings.doubleTapToLock) {
|
|
|
|
|
folio.FolioSettings.doubleTapToLock = checked;
|
2025-06-25 20:39:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-10-22 19:34:02 +00:00
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FormCard.FormHeader {
|
|
|
|
|
title: i18n("Favorites Bar")
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FormCard.FormCard {
|
|
|
|
|
FormCard.FormSwitchDelegate {
|
2025-08-10 18:52:25 +00:00
|
|
|
text: i18n("Show background")
|
2024-06-21 04:42:14 +00:00
|
|
|
checked: folio.FolioSettings.showFavouritesBarBackground
|
2023-11-05 17:46:17 +00:00
|
|
|
onCheckedChanged: {
|
2024-06-21 04:42:14 +00:00
|
|
|
if (checked !== folio.FolioSettings.showFavouritesBarBackground) {
|
|
|
|
|
folio.FolioSettings.showFavouritesBarBackground = checked;
|
2023-11-05 17:46:17 +00:00
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-08 17:10:55 +00:00
|
|
|
FormCard.FormHeader {
|
|
|
|
|
title: i18nc("@title:group settings group", "Wallpaper")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FormCard.FormCard {
|
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
|
|
|
FormCard.FormComboBoxDelegate {
|
|
|
|
|
id: wallpaperBlurCombobox
|
|
|
|
|
text: i18n("Wallpaper blur effect")
|
|
|
|
|
|
|
|
|
|
model: [
|
|
|
|
|
{"name": i18nc("Wallpaper blur effect", "None"), "value": 0},
|
|
|
|
|
{"name": i18nc("Wallpaper blur effect", "Simple"), "value": 1},
|
|
|
|
|
{"name": i18nc("Wallpaper blur effect", "Full"), "value": 2}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
textRole: "name"
|
|
|
|
|
valueRole: "value"
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
currentIndex = indexOfValue(folio.FolioSettings.wallpaperBlurEffect);
|
|
|
|
|
dialog.parent = root;
|
2024-02-08 17:10:55 +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
|
|
|
onCurrentValueChanged: folio.FolioSettings.wallpaperBlurEffect = currentValue
|
2024-02-08 17:10:55 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FormCard.FormHeader {
|
|
|
|
|
title: i18n("General")
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FormCard.FormCard {
|
|
|
|
|
Layout.bottomMargin: Kirigami.Units.gridUnit
|
|
|
|
|
FormCard.FormButtonDelegate {
|
|
|
|
|
id: containmentSettings
|
2024-02-08 17:10:55 +00:00
|
|
|
text: i18nc("@action:button", "Switch between homescreens and more wallpaper options")
|
2023-11-05 17:46:17 +00:00
|
|
|
icon.name: 'settings-configure'
|
|
|
|
|
onClicked: root.requestConfigureMenu()
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FormCard.FormDelegateSeparator { above: containmentSettings; below: exportSettings }
|
|
|
|
|
|
|
|
|
|
FormCard.FormButtonDelegate {
|
|
|
|
|
id: exportSettings
|
2025-08-10 18:52:25 +00:00
|
|
|
text: i18n("Export layout")
|
2023-11-05 17:46:17 +00:00
|
|
|
icon.name: 'document-export'
|
|
|
|
|
onClicked: exportFileDialog.open()
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FormCard.FormDelegateSeparator { above: exportSettings; below: importSettings }
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FormCard.FormButtonDelegate {
|
|
|
|
|
id: importSettings
|
2025-08-10 18:52:25 +00:00
|
|
|
text: i18n("Import layout")
|
2023-11-05 17:46:17 +00:00
|
|
|
icon.name: 'document-import'
|
|
|
|
|
onClicked: importFileDialog.open()
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
2023-10-22 17:17:09 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FileDialog {
|
|
|
|
|
id: exportFileDialog
|
|
|
|
|
title: i18n("Export layout to")
|
|
|
|
|
fileMode: FileDialog.SaveFile
|
|
|
|
|
defaultSuffix: 'json'
|
|
|
|
|
nameFilters: ["JSON files (*.json)"]
|
|
|
|
|
onAccepted: {
|
|
|
|
|
console.log('saving layout to ' + selectedFile);
|
|
|
|
|
if (selectedFile) {
|
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
|
|
|
let status = folio.FolioSettings.saveLayoutToFile(selectedFile); if (status) {
|
2023-11-05 17:46:17 +00:00
|
|
|
exportedSuccessfullyPrompt.open();
|
|
|
|
|
} else {
|
|
|
|
|
exportFailedPrompt.open();
|
|
|
|
|
}
|
2023-10-22 17:17:09 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
FileDialog {
|
|
|
|
|
id: importFileDialog
|
2023-12-15 07:04:25 +00:00
|
|
|
title: i18n("Import layout from")
|
2023-11-05 17:46:17 +00:00
|
|
|
fileMode: FileDialog.OpenFile
|
|
|
|
|
nameFilters: ["JSON files (*.json)"]
|
|
|
|
|
onAccepted: {
|
|
|
|
|
console.log('about to load layout from ' + selectedFile);
|
|
|
|
|
confirmImportPrompt.open();
|
|
|
|
|
}
|
2023-10-22 17:17:09 +00:00
|
|
|
}
|
|
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
Kirigami.PromptDialog {
|
|
|
|
|
id: exportFailedPrompt
|
|
|
|
|
title: i18n("Export Status")
|
|
|
|
|
subtitle: i18n("Failed to export to %1", String(exportFileDialog.selectedFile).substring('file://'.length))
|
|
|
|
|
standardButtons: Kirigami.Dialog.Close
|
|
|
|
|
}
|
2023-10-22 17:17:09 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
Kirigami.PromptDialog {
|
|
|
|
|
id: exportedSuccessfullyPrompt
|
|
|
|
|
title: i18n("Export Status")
|
|
|
|
|
subtitle: i18n("Homescreen layout exported successfully to %1", String(exportFileDialog.selectedFile).substring('file://'.length))
|
|
|
|
|
standardButtons: Kirigami.Dialog.Close
|
|
|
|
|
}
|
2023-10-22 17:17:09 +00:00
|
|
|
|
2023-11-05 17:46:17 +00:00
|
|
|
Kirigami.PromptDialog {
|
|
|
|
|
id: confirmImportPrompt
|
|
|
|
|
title: i18n("Confirm Import")
|
|
|
|
|
subtitle: i18n("This will overwrite your existing homescreen layout!")
|
|
|
|
|
standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel
|
2024-06-21 04:42:14 +00:00
|
|
|
onAccepted: folio.FolioSettings.loadLayoutFromFile(importFileDialog.selectedFile);
|
2023-11-05 17:46:17 +00:00
|
|
|
}
|
2023-10-22 17:17:09 +00:00
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|