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
|
2023-10-22 03:59:27 +00:00
|
|
|
import org.kde.private.mobile.homescreen.folio 1.0 as Folio
|
|
|
|
|
|
|
|
|
|
import '../delegate'
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
property var homeScreen
|
|
|
|
|
property real settingsModeHomeScreenScale
|
|
|
|
|
|
2023-11-05 05:14:39 +00:00
|
|
|
readonly property bool homeScreenInteractive: !appletListViewer.open
|
|
|
|
|
|
2023-10-22 03:59:27 +00:00
|
|
|
MouseArea {
|
|
|
|
|
id: closeSettings
|
|
|
|
|
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.bottom: settingsBar.top
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
Folio.HomeScreenState.closeSettingsView();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
id: settingsBar
|
|
|
|
|
|
|
|
|
|
Kirigami.Theme.inherit: false
|
|
|
|
|
Kirigami.Theme.colorSet: Kirigami.Theme.Complementary
|
|
|
|
|
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.bottom: parent.bottom
|
2023-11-14 04:26:45 +00:00
|
|
|
anchors.bottomMargin: Kirigami.Units.largeSpacing
|
2023-10-22 03:59:27 +00:00
|
|
|
height: root.height * (1 - settingsModeHomeScreenScale)
|
|
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
|
id: settingsOptions
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
spacing: Kirigami.Units.largeSpacing
|
|
|
|
|
|
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'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QQC2.Label {
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
|
|
|
|
text: i18n('Wallpapers')
|
|
|
|
|
font.bold: true
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-01-02 03:30:55 +00:00
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
wallpaperSelectorLoader.active = true;
|
|
|
|
|
Folio.HomeScreenState.closeSettingsView();
|
|
|
|
|
}
|
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'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QQC2.Label {
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
|
|
|
|
text: i18n('Widgets')
|
|
|
|
|
font.bold: true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-05 05:14:39 +00:00
|
|
|
onClicked: {
|
|
|
|
|
appletListViewer.open = true;
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-05 05:14:39 +00:00
|
|
|
AppletListViewer {
|
|
|
|
|
id: appletListViewer
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: parent.height
|
|
|
|
|
|
|
|
|
|
property bool open: false
|
|
|
|
|
onRequestClose: open = false
|
|
|
|
|
|
|
|
|
|
opacity: open ? 1 : 0
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
y: (opacity === 0) ? appletListViewer.height : 0
|
|
|
|
|
|
|
|
|
|
homeScreen: root.homeScreen
|
|
|
|
|
|
|
|
|
|
Behavior on opacity {
|
|
|
|
|
NumberAnimation { duration: Kirigami.Units.shortDuration }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-22 03:59:27 +00:00
|
|
|
SettingsWindow {
|
|
|
|
|
id: settingsWindow
|
|
|
|
|
visible: false
|
|
|
|
|
|
|
|
|
|
onRequestConfigureMenu: {
|
|
|
|
|
homeScreen.openConfigure()
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-01-02 03:30:55 +00:00
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
|
id: wallpaperSelectorLoader
|
|
|
|
|
asynchronous: true
|
|
|
|
|
active: false
|
|
|
|
|
|
|
|
|
|
onLoaded: {
|
|
|
|
|
wallpaperSelectorLoader.item.open();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sourceComponent: MobileShell.WallpaperSelector {
|
|
|
|
|
horizontal: root.width > root.height
|
|
|
|
|
edge: horizontal ? Qt.LeftEdge : Qt.BottomEdge
|
|
|
|
|
bottomMargin: root.homeScreen.bottomMargin
|
|
|
|
|
leftMargin: root.homeScreen.leftMargin
|
|
|
|
|
rightMargin: root.homeScreen.rightMargin
|
|
|
|
|
onClosed: {
|
|
|
|
|
wallpaperSelectorLoader.active = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|