diff --git a/components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml b/components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml index cafbf5ef..9cb7542c 100644 --- a/components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml +++ b/components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml @@ -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 diff --git a/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml b/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml index 280d5131..7180798e 100644 --- a/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml +++ b/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml @@ -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 diff --git a/components/mobileshell/qml/widgets/NotificationsWidget.qml b/components/mobileshell/qml/widgets/NotificationsWidget.qml index 09c44817..fc58c42d 100644 --- a/components/mobileshell/qml/widgets/NotificationsWidget.qml +++ b/components/mobileshell/qml/widgets/NotificationsWidget.qml @@ -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); }