2021-12-22 23:29:00 +00:00
|
|
|
/*
|
|
|
|
|
* SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
2023-05-13 02:07:48 +00:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls as QQC2
|
|
|
|
|
import QtQuick.Layouts
|
2021-12-22 23:29:00 +00:00
|
|
|
|
|
|
|
|
import org.kde.kirigami 2.12 as Kirigami
|
2023-07-09 22:50:33 +00:00
|
|
|
import org.kde.ksvg 1.0 as KSvg
|
2023-11-02 11:08:17 +00:00
|
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
2023-09-05 15:34:49 +00:00
|
|
|
import org.kde.plasma.core as PlasmaCore
|
2021-12-22 23:29:00 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Quick settings panel for landscape view (right sidebar).
|
|
|
|
|
* For the portrait view quicksettings container, see QuickSettingsDrawer.
|
|
|
|
|
*/
|
2023-11-02 11:08:17 +00:00
|
|
|
MobileShell.BaseItem {
|
2021-12-22 23:29:00 +00:00
|
|
|
id: root
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2021-12-22 23:29:00 +00:00
|
|
|
required property var actionDrawer
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2022-12-07 00:01:42 +00:00
|
|
|
required property real fullScreenHeight
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2021-12-22 23:29:00 +00:00
|
|
|
/**
|
|
|
|
|
* Implicit height of the contents of the panel.
|
|
|
|
|
*/
|
|
|
|
|
readonly property real contentImplicitHeight: column.implicitHeight
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2021-12-22 23:29:00 +00:00
|
|
|
// we need extra padding since the background side border is enabled
|
2023-07-25 01:13:52 +00:00
|
|
|
topPadding: Kirigami.Units.smallSpacing * 4
|
|
|
|
|
leftPadding: Kirigami.Units.smallSpacing * 4
|
|
|
|
|
rightPadding: Kirigami.Units.smallSpacing * 4
|
|
|
|
|
bottomPadding: Kirigami.Units.smallSpacing * 4
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2023-07-09 22:50:33 +00:00
|
|
|
background: KSvg.FrameSvgItem {
|
2023-09-27 04:18:39 +00:00
|
|
|
enabledBorders: KSvg.FrameSvgItem.AllBorders
|
2021-12-22 23:29:00 +00:00
|
|
|
imagePath: "widgets/background"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
contentItem: Item {
|
|
|
|
|
id: containerItem
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2021-12-22 23:29:00 +00:00
|
|
|
// use container item so that our column doesn't get stretched if base item is anchored
|
|
|
|
|
ColumnLayout {
|
|
|
|
|
id: column
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.top: parent.top
|
2022-12-07 00:01:42 +00:00
|
|
|
height: root.fullScreenHeight
|
2021-12-22 23:29:00 +00:00
|
|
|
spacing: 0
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2023-11-02 11:08:17 +00:00
|
|
|
MobileShell.StatusBar {
|
2021-12-22 23:29:00 +00:00
|
|
|
id: statusBar
|
|
|
|
|
Layout.alignment: Qt.AlignTop
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.preferredHeight: Kirigami.Units.gridUnit * 1.5
|
|
|
|
|
Layout.maximumHeight: Kirigami.Units.gridUnit * 1.5
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2023-07-25 02:24:10 +00:00
|
|
|
Kirigami.Theme.colorSet: Kirigami.Theme.Window
|
|
|
|
|
Kirigami.Theme.inherit: false
|
|
|
|
|
|
2021-12-22 23:29:00 +00:00
|
|
|
backgroundColor: "transparent"
|
|
|
|
|
showSecondRow: false
|
|
|
|
|
showDropShadow: false
|
|
|
|
|
showTime: false
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2022-04-07 18:11:08 +00:00
|
|
|
// security reasons, system tray also doesn't work on lockscreen
|
|
|
|
|
disableSystemTray: actionDrawer.restrictedPermissions
|
2021-12-22 23:29:00 +00:00
|
|
|
}
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2023-11-02 11:08:17 +00:00
|
|
|
MobileShell.QuickSettings {
|
2022-05-12 13:20:39 +00:00
|
|
|
id: quickSettings
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2022-12-11 02:05:13 +00:00
|
|
|
mode: QuickSettings.ScrollView
|
2022-05-12 13:20:39 +00:00
|
|
|
width: column.width
|
|
|
|
|
implicitHeight: quickSettings.fullHeight
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2021-12-22 23:29:00 +00:00
|
|
|
Layout.alignment: Qt.AlignTop
|
|
|
|
|
Layout.fillWidth: true
|
2023-07-25 01:13:52 +00:00
|
|
|
Layout.maximumHeight: root.fullScreenHeight - root.topPadding - root.bottomPadding - statusBar.height - Kirigami.Units.smallSpacing
|
2021-12-22 23:29:00 +00:00
|
|
|
Layout.maximumWidth: column.width
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2022-05-12 13:20:39 +00:00
|
|
|
actionDrawer: root.actionDrawer
|
|
|
|
|
minimizedViewProgress: 0
|
|
|
|
|
fullViewProgress: 1
|
2021-12-22 23:29:00 +00:00
|
|
|
}
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2021-12-22 23:29:00 +00:00
|
|
|
Item { Layout.fillHeight: true }
|
|
|
|
|
}
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2021-12-22 23:29:00 +00:00
|
|
|
Handle {
|
|
|
|
|
id: handle
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|