mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
actiondrawer: Reduce background opacity if no notifications are shown
This commit is contained in:
parent
7adea6fd3d
commit
484e088508
3 changed files with 16 additions and 2 deletions
|
|
@ -39,7 +39,12 @@ PlasmaCore.ColorScope {
|
|||
// fullscreen background
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Qt.rgba(PlasmaCore.Theme.backgroundColor.r, PlasmaCore.Theme.backgroundColor.g, PlasmaCore.Theme.backgroundColor.b, 0.95)
|
||||
// darken if there are notifications
|
||||
color: Qt.rgba(PlasmaCore.Theme.backgroundColor.r,
|
||||
PlasmaCore.Theme.backgroundColor.g,
|
||||
PlasmaCore.Theme.backgroundColor.b,
|
||||
notificationWidget.hasNotifications ? 0.95 : 0.7)
|
||||
Behavior on color { ColorAnimation { duration: PlasmaCore.Units.longDuration } }
|
||||
opacity: Math.max(0, Math.min(1, actionDrawer.offset / root.minimizedQuickSettingsOffset))
|
||||
}
|
||||
|
||||
|
|
@ -89,6 +94,7 @@ PlasmaCore.ColorScope {
|
|||
}
|
||||
|
||||
Widgets.NotificationsWidget {
|
||||
id: notificationWidget
|
||||
// don't allow notifications widget to get too wide
|
||||
Layout.maximumWidth: PlasmaCore.Units.gridUnit * 25
|
||||
Layout.fillHeight: true
|
||||
|
|
|
|||
|
|
@ -36,7 +36,12 @@ PlasmaCore.ColorScope {
|
|||
// fullscreen background
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Qt.rgba(PlasmaCore.Theme.backgroundColor.r, PlasmaCore.Theme.backgroundColor.g, PlasmaCore.Theme.backgroundColor.b, 0.95)
|
||||
// darken if there are notifications
|
||||
color: Qt.rgba(PlasmaCore.Theme.backgroundColor.r,
|
||||
PlasmaCore.Theme.backgroundColor.g,
|
||||
PlasmaCore.Theme.backgroundColor.b,
|
||||
notificationWidget.hasNotifications ? 0.95 : 0.7)
|
||||
Behavior on color { ColorAnimation { duration: PlasmaCore.Units.longDuration } }
|
||||
opacity: Math.max(0, Math.min(1, actionDrawer.offset / root.minimizedQuickSettingsOffset))
|
||||
}
|
||||
|
||||
|
|
@ -72,6 +77,7 @@ PlasmaCore.ColorScope {
|
|||
}
|
||||
|
||||
Widgets.NotificationsWidget {
|
||||
id: notificationWidget
|
||||
anchors {
|
||||
top: quickSettings.top
|
||||
topMargin: quickSettings.height + translate.y
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ Item {
|
|||
property var historyModel: MobileShell.NotificationProvider.historyModel
|
||||
property var notificationSettings: MobileShell.NotificationProvider.notificationSettings
|
||||
|
||||
readonly property bool hasNotifications: list.count > 0
|
||||
|
||||
function clearHistory() {
|
||||
historyModel.clear(NotificationManager.Notifications.ClearExpired);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue