mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
actiondrawer: Use passed in notifications model and settings
This commit is contained in:
parent
27015d1749
commit
dca8064ca2
7 changed files with 45 additions and 43 deletions
|
|
@ -25,6 +25,16 @@ import "../components" as Components
|
|||
|
||||
NanoShell.FullScreenOverlay {
|
||||
id: window
|
||||
|
||||
/**
|
||||
* The model for the notification widget.
|
||||
*/
|
||||
property var notificationModel
|
||||
|
||||
/**
|
||||
* The notification settings object to be used in the notification widget.
|
||||
*/
|
||||
property var notificationSettings
|
||||
|
||||
/**
|
||||
* The amount of pixels moved by touch/mouse in the process of opening/closing the panel.
|
||||
|
|
|
|||
|
|
@ -94,6 +94,9 @@ PlasmaCore.ColorScope {
|
|||
|
||||
MobileShell.NotificationsWidget {
|
||||
id: notificationWidget
|
||||
historyModel: root.actionDrawer.notificationModel
|
||||
notificationSettings: root.actionDrawer.notificationSettings
|
||||
|
||||
// don't allow notifications widget to get too wide
|
||||
Layout.maximumWidth: PlasmaCore.Units.gridUnit * 25
|
||||
Layout.fillHeight: true
|
||||
|
|
|
|||
|
|
@ -78,6 +78,9 @@ PlasmaCore.ColorScope {
|
|||
|
||||
MobileShell.NotificationsWidget {
|
||||
id: notificationWidget
|
||||
historyModel: root.actionDrawer.notificationModel
|
||||
notificationSettings: root.actionDrawer.notificationSettings
|
||||
|
||||
anchors {
|
||||
top: quickSettings.top
|
||||
topMargin: quickSettings.height + translate.y
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
||||
* SPDX-FileCopyrightText: 2018-2019 Kai Uwe Broulik <kde@privat.broulik.de>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
||||
*/
|
||||
|
||||
import QtQuick 2.2
|
||||
|
||||
import org.kde.notificationmanager 1.0 as NotificationManager
|
||||
|
||||
pragma Singleton
|
||||
|
||||
QtObject {
|
||||
|
||||
property var notificationSettings: NotificationManager.Settings {}
|
||||
|
||||
property var historyModel: NotificationManager.Notifications {
|
||||
showExpired: true
|
||||
showDismissed: true
|
||||
showJobs: notificationSettings.jobsInNotifications
|
||||
sortMode: NotificationManager.Notifications.SortByTypeAndUrgency
|
||||
groupMode: NotificationManager.Notifications.GroupApplicationsFlat
|
||||
groupLimit: 2
|
||||
expandUnread: true
|
||||
blacklistedDesktopEntries: notificationSettings.historyBlacklistedApplications
|
||||
blacklistedNotifyRcNames: notificationSettings.historyBlacklistedServices
|
||||
urgencies: {
|
||||
var urgencies = NotificationManager.Notifications.CriticalUrgency
|
||||
| NotificationManager.Notifications.NormalUrgency;
|
||||
if (notificationSettings.lowPriorityHistory) {
|
||||
urgencies |= NotificationManager.Notifications.LowUrgency;
|
||||
}
|
||||
return urgencies;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -18,7 +18,6 @@ VelocityCalculator 1.0 components/VelocityCalculator.qml
|
|||
# /dataproviders
|
||||
singleton BatteryProvider 1.0 dataproviders/BatteryProvider.qml
|
||||
singleton BluetoothProvider 1.0 dataproviders/BluetoothProvider.qml
|
||||
singleton NotificationProvider 1.0 dataproviders/NotificationProvider.qml
|
||||
singleton SignalStrengthProvider 1.0 dataproviders/SignalStrengthProvider.qml
|
||||
singleton VolumeProvider 1.0 dataproviders/VolumeProvider.qml
|
||||
singleton WifiProvider 1.0 dataproviders/WifiProvider.qml
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ import org.kde.notificationmanager 1.0 as NotificationManager
|
|||
Item {
|
||||
id: root
|
||||
|
||||
property var historyModel: MobileShell.NotificationProvider.historyModel
|
||||
property var notificationSettings: MobileShell.NotificationProvider.notificationSettings
|
||||
property var historyModel: []
|
||||
property var notificationSettings: NotificationManager.Settings {}
|
||||
|
||||
readonly property bool hasNotifications: list.count > 0
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ import org.kde.plasma.components 3.0 as PlasmaComponents
|
|||
import org.kde.plasma.private.nanoshell 2.0 as NanoShell
|
||||
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
|
||||
|
||||
import org.kde.notificationmanager 1.0 as NotificationManager
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
|
|
@ -59,7 +61,7 @@ Item {
|
|||
//END API implementation
|
||||
|
||||
Component.onCompleted: {
|
||||
// we want to bind global shortcuts here
|
||||
// we want to bind global volume shortcuts here
|
||||
MobileShell.VolumeProvider.bindShortcuts = true;
|
||||
}
|
||||
|
||||
|
|
@ -67,6 +69,7 @@ Item {
|
|||
MobileShell.StatusBar {
|
||||
id: topPanel
|
||||
anchors.fill: parent
|
||||
|
||||
showDropShadow: !root.showingApp
|
||||
colorGroup: root.showingApp ? PlasmaCore.Theme.HeaderColorGroup : PlasmaCore.Theme.ComplementaryColorGroup
|
||||
backgroundColor: !root.showingApp ? "transparent" : root.backgroundColor
|
||||
|
|
@ -78,7 +81,30 @@ Item {
|
|||
anchors.fill: parent
|
||||
}
|
||||
|
||||
// swipe-down drawer component
|
||||
MobileShell.ActionDrawer {
|
||||
id: drawer
|
||||
|
||||
notificationSettings: NotificationManager.Settings {}
|
||||
|
||||
notificationModel: NotificationManager.Notifications {
|
||||
showExpired: true
|
||||
showDismissed: true
|
||||
showJobs: drawer.notificationSettings.jobsInNotifications
|
||||
sortMode: NotificationManager.Notifications.SortByTypeAndUrgency
|
||||
groupMode: NotificationManager.Notifications.GroupApplicationsFlat
|
||||
groupLimit: 2
|
||||
expandUnread: true
|
||||
blacklistedDesktopEntries: drawer.notificationSettings.historyBlacklistedApplications
|
||||
blacklistedNotifyRcNames: drawer.notificationSettings.historyBlacklistedServices
|
||||
urgencies: {
|
||||
var urgencies = NotificationManager.Notifications.CriticalUrgency
|
||||
| NotificationManager.Notifications.NormalUrgency;
|
||||
if (drawer.notificationSettings.lowPriorityHistory) {
|
||||
urgencies |= NotificationManager.Notifications.LowUrgency;
|
||||
}
|
||||
return urgencies;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue