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
|
|
|
|
|
|
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.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-12-12 05:33:25 +00:00
|
|
|
readonly property bool homeScreenInteractive: !appletListViewer.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
|
|
|
|
|
|
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
|
2025-09-09 12:52:55 +00:00
|
|
|
uniformCellWidths: true
|
2025-04-25 01:23:48 +00:00
|
|
|
|
2023-10-22 03:59:27 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
|
|
2025-09-09 12:52:55 +00:00
|
|
|
SettingsButton {
|
|
|
|
|
iconName: 'edit-image'
|
|
|
|
|
textLabel: i18n("Wallpapers")
|
2024-01-02 03:30:55 +00:00
|
|
|
onClicked: {
|
2025-10-05 15:32:16 +00:00
|
|
|
root.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
|
|
|
}
|
|
|
|
|
|
2025-09-09 12:52:55 +00:00
|
|
|
SettingsButton {
|
|
|
|
|
iconName: 'settings-configure'
|
|
|
|
|
textLabel: i18n("Settings")
|
2023-10-22 17:20:32 +00:00
|
|
|
onClicked: {
|
2025-10-05 15:32:16 +00:00
|
|
|
root.homeScreen.openConfigure()
|
2023-10-22 17:20:32 +00:00
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
|
2025-09-09 12:52:55 +00:00
|
|
|
SettingsButton {
|
|
|
|
|
iconName: 'widget-alternatives'
|
|
|
|
|
textLabel: i18n("Widgets")
|
2023-11-05 05:14:39 +00:00
|
|
|
onClicked: {
|
2025-12-12 05:33:25 +00:00
|
|
|
appletListViewer.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-12-12 05:33:25 +00:00
|
|
|
AppletListViewer {
|
|
|
|
|
id: appletListViewer
|
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-12-12 05:33:25 +00:00
|
|
|
folio: root.folio
|
|
|
|
|
homeScreen: root.homeScreen
|
2023-11-05 05:14:39 +00:00
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|