2015-03-13 21:16:19 +00:00
|
|
|
/*
|
2021-12-22 23:29:00 +00:00
|
|
|
* SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
2021-03-01 20:03:25 +00:00
|
|
|
* SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
|
2015-03-13 21:16:19 +00:00
|
|
|
*
|
2021-03-01 20:03:25 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2015-03-13 21:16:19 +00:00
|
|
|
*/
|
|
|
|
|
|
2019-10-22 10:52:53 +00:00
|
|
|
import QtQuick 2.12
|
2017-09-14 19:03:56 +00:00
|
|
|
import QtQuick.Layouts 1.3
|
2019-10-08 15:15:17 +00:00
|
|
|
import QtQml.Models 2.12
|
2015-03-13 21:16:19 +00:00
|
|
|
|
2021-04-09 20:59:05 +00:00
|
|
|
import org.kde.kirigami 2.12 as Kirigami
|
|
|
|
|
|
2015-03-13 21:16:19 +00:00
|
|
|
import org.kde.plasma.plasmoid 2.0
|
|
|
|
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
2019-10-08 15:15:17 +00:00
|
|
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
2015-03-13 21:16:19 +00:00
|
|
|
|
2020-06-26 21:18:04 +00:00
|
|
|
import org.kde.plasma.private.nanoshell 2.0 as NanoShell
|
2020-07-22 15:17:10 +00:00
|
|
|
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
|
|
|
|
|
2022-02-11 22:50:17 +00:00
|
|
|
import org.kde.notificationmanager 1.0 as NotificationManager
|
|
|
|
|
|
2020-02-05 19:25:52 +00:00
|
|
|
Item {
|
2015-03-13 21:16:19 +00:00
|
|
|
id: root
|
2021-12-22 23:29:00 +00:00
|
|
|
|
2022-04-07 01:18:47 +00:00
|
|
|
readonly property bool showingApp: !MobileShell.WindowUtil.allWindowsMinimizedExcludingShell
|
2021-12-29 05:08:32 +00:00
|
|
|
readonly property color backgroundColor: topPanel.colorScopeColor
|
2021-12-22 23:29:00 +00:00
|
|
|
|
|
|
|
|
Plasmoid.backgroundHints: showingApp ? PlasmaCore.Types.StandardBackground : PlasmaCore.Types.NoBackground
|
|
|
|
|
|
2015-03-13 21:16:19 +00:00
|
|
|
width: 480
|
2021-10-12 13:50:36 +00:00
|
|
|
height: PlasmaCore.Units.gridUnit
|
|
|
|
|
|
2021-10-29 01:54:52 +00:00
|
|
|
//BEGIN API implementation
|
|
|
|
|
|
2021-10-12 13:50:36 +00:00
|
|
|
Binding {
|
|
|
|
|
target: MobileShell.TopPanelControls
|
|
|
|
|
property: "panelHeight"
|
|
|
|
|
value: root.height
|
|
|
|
|
}
|
|
|
|
|
Binding {
|
|
|
|
|
target: MobileShell.TopPanelControls
|
2021-10-29 01:54:52 +00:00
|
|
|
property: "inSwipe"
|
2022-04-07 18:11:08 +00:00
|
|
|
value: drawer.actionDrawer.dragging
|
2021-10-12 13:50:36 +00:00
|
|
|
}
|
2022-03-13 21:47:42 +00:00
|
|
|
Binding {
|
|
|
|
|
target: MobileShell.TopPanelControls
|
|
|
|
|
property: "actionDrawerVisible"
|
|
|
|
|
value: drawer.visible
|
|
|
|
|
}
|
2021-10-29 01:54:52 +00:00
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
|
target: MobileShell.TopPanelControls
|
|
|
|
|
|
|
|
|
|
function onStartSwipe() {
|
2021-12-22 23:29:00 +00:00
|
|
|
swipeArea.startSwipe();
|
2021-10-29 01:54:52 +00:00
|
|
|
}
|
|
|
|
|
function onEndSwipe() {
|
2021-12-22 23:29:00 +00:00
|
|
|
swipeArea.endSwipe();
|
2021-10-29 01:54:52 +00:00
|
|
|
}
|
|
|
|
|
function onRequestRelativeScroll(offsetY) {
|
2021-12-22 23:29:00 +00:00
|
|
|
swipeArea.updateOffset(offsetY);
|
2021-10-29 01:54:52 +00:00
|
|
|
}
|
2022-03-13 21:47:42 +00:00
|
|
|
function onCloseActionDrawer() {
|
2022-04-07 18:11:08 +00:00
|
|
|
drawer.actionDrawer.close();
|
2022-03-13 21:47:42 +00:00
|
|
|
}
|
|
|
|
|
function onOpenActionDrawer() {
|
2022-04-07 18:11:08 +00:00
|
|
|
drawer.actionDrawer.open();
|
2022-03-13 21:47:42 +00:00
|
|
|
}
|
2021-10-29 01:54:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//END API implementation
|
2021-12-22 23:29:00 +00:00
|
|
|
|
2015-03-13 21:16:19 +00:00
|
|
|
Component.onCompleted: {
|
2022-02-11 22:50:17 +00:00
|
|
|
// we want to bind global volume shortcuts here
|
2021-12-22 23:29:00 +00:00
|
|
|
MobileShell.VolumeProvider.bindShortcuts = true;
|
2021-04-09 20:59:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// top panel component
|
2021-12-22 23:29:00 +00:00
|
|
|
MobileShell.StatusBar {
|
2021-04-09 20:59:05 +00:00
|
|
|
id: topPanel
|
|
|
|
|
anchors.fill: parent
|
2022-02-11 22:50:17 +00:00
|
|
|
|
2021-12-22 23:29:00 +00:00
|
|
|
showDropShadow: !root.showingApp
|
|
|
|
|
colorGroup: root.showingApp ? PlasmaCore.Theme.HeaderColorGroup : PlasmaCore.Theme.ComplementaryColorGroup
|
|
|
|
|
backgroundColor: !root.showingApp ? "transparent" : root.backgroundColor
|
2015-05-12 16:59:55 +00:00
|
|
|
}
|
2020-08-29 22:17:56 +00:00
|
|
|
|
2021-12-22 23:29:00 +00:00
|
|
|
MobileShell.ActionDrawerOpenSurface {
|
|
|
|
|
id: swipeArea
|
2022-04-07 18:11:08 +00:00
|
|
|
actionDrawer: drawer.actionDrawer
|
2021-10-29 01:54:52 +00:00
|
|
|
anchors.fill: parent
|
2015-05-12 16:59:55 +00:00
|
|
|
}
|
2021-12-22 23:29:00 +00:00
|
|
|
|
2022-02-11 22:50:17 +00:00
|
|
|
// swipe-down drawer component
|
2022-04-07 18:11:08 +00:00
|
|
|
MobileShell.ActionDrawerWindow {
|
2021-12-22 23:29:00 +00:00
|
|
|
id: drawer
|
2022-02-11 22:50:17 +00:00
|
|
|
|
2022-04-07 18:11:08 +00:00
|
|
|
actionDrawer.notificationSettings: NotificationManager.Settings {}
|
2022-02-11 22:50:17 +00:00
|
|
|
|
2022-04-07 18:11:08 +00:00
|
|
|
actionDrawer.notificationModel: NotificationManager.Notifications {
|
2022-02-11 22:50:17 +00:00
|
|
|
showExpired: true
|
|
|
|
|
showDismissed: true
|
2022-04-07 18:11:08 +00:00
|
|
|
showJobs: drawer.actionDrawer.notificationSettings.jobsInNotifications
|
2022-02-11 22:50:17 +00:00
|
|
|
sortMode: NotificationManager.Notifications.SortByTypeAndUrgency
|
|
|
|
|
groupMode: NotificationManager.Notifications.GroupApplicationsFlat
|
|
|
|
|
groupLimit: 2
|
|
|
|
|
expandUnread: true
|
2022-04-07 18:11:08 +00:00
|
|
|
blacklistedDesktopEntries: drawer.actionDrawer.notificationSettings.historyBlacklistedApplications
|
|
|
|
|
blacklistedNotifyRcNames: drawer.actionDrawer.notificationSettings.historyBlacklistedServices
|
2022-02-11 22:50:17 +00:00
|
|
|
urgencies: {
|
|
|
|
|
var urgencies = NotificationManager.Notifications.CriticalUrgency
|
|
|
|
|
| NotificationManager.Notifications.NormalUrgency;
|
2022-04-07 18:11:08 +00:00
|
|
|
if (drawer.actionDrawer.notificationSettings.lowPriorityHistory) {
|
2022-02-11 22:50:17 +00:00
|
|
|
urgencies |= NotificationManager.Notifications.LowUrgency;
|
|
|
|
|
}
|
|
|
|
|
return urgencies;
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-05-12 16:59:55 +00:00
|
|
|
}
|
2015-03-13 21:16:19 +00:00
|
|
|
}
|