use standard background when needed

This commit is contained in:
Marco Martin 2015-06-19 18:14:25 -07:00
parent 37535f97ba
commit ae4a2c7837
2 changed files with 15 additions and 0 deletions

View file

@ -22,6 +22,7 @@ import QtQuick 2.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.plasmoid 2.0
Item { Item {
id: root id: root
@ -29,6 +30,8 @@ Item {
Layout.minimumHeight: notificationView.contentsHeight Layout.minimumHeight: notificationView.contentsHeight
Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground
function addNotification(source, data, actions) { function addNotification(source, data, actions) {
// Do not show duplicated notifications // Do not show duplicated notifications
// Remove notifications that are sent again (odd, but true) // Remove notifications that are sent again (odd, but true)

View file

@ -131,6 +131,18 @@ Item {
checkLastSpacer(); checkLastSpacer();
} }
} }
onAppletChanged: {
if (applet.backgroundHints == PlasmaCore.Types.StandardBackground) {
applet.anchors.margins = background.margins.top;
}
}
PlasmaCore.FrameSvgItem {
id: background
z: -1
anchors.fill: parent
imagePath: "widgets/background"
visible: applet.backgroundHints == PlasmaCore.Types.StandardBackground
}
Layout.minimumWidth: root.width Layout.minimumWidth: root.width
Layout.minimumHeight: Math.max(applet.Layout.minimumHeight, (root.height-applicationsView.headerItem.margin) / 2) Layout.minimumHeight: Math.max(applet.Layout.minimumHeight, (root.height-applicationsView.headerItem.margin) / 2)