Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Mobile
Commits
dca8064c
Commit
dca8064c
authored
Feb 11, 2022
by
Devin Lin
🎨
Browse files
actiondrawer: Use passed in notifications model and settings
parent
27015d17
Pipeline
#136261
passed with stages
in 1 minute and 9 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
components/mobileshell/qml/actiondrawer/ActionDrawer.qml
View file @
dca8064c
...
...
@@ -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.
...
...
components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml
View file @
dca8064c
...
...
@@ -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
...
...
components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml
View file @
dca8064c
...
...
@@ -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
...
...
components/mobileshell/qml/dataproviders/NotificationProvider.qml
deleted
100644 → 0
View file @
27015d17
/*
* 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
;
}
}
}
components/mobileshell/qml/qmldir
View file @
dca8064c
...
...
@@ -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
...
...
components/mobileshell/qml/widgets/notifications/NotificationsWidget.qml
View file @
dca8064c
...
...
@@ -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
.
notification
Settings
property
var
historyModel
:
[]
property
var
notificationSettings
:
NotificationManager.
Settings
{}
readonly
property
bool
hasNotifications
:
list
.
count
>
0
...
...
containments/panel/package/contents/ui/main.qml
View file @
dca8064c
...
...
@@ -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
;
}
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment