fewer items

This commit is contained in:
Aaron Seigo 2014-09-29 20:25:17 +02:00
parent c22bb7cc33
commit 17cb59d966

View file

@ -20,13 +20,15 @@
import QtQuick 2.0 import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
Rectangle { MouseArea {
id: root id: root
color: "#00000000"
height: units.gridUnit * 2 height: units.gridUnit * 2
width: parent.width width: parent.width
anchors.bottomMargin: 10 anchors.bottomMargin: 10
drag.axis: Drag.XAxis
drag.target: root
property bool expanded: false property bool expanded: false
property var textGradient: Gradient { property var textGradient: Gradient {
@ -51,23 +53,19 @@ Rectangle {
} }
} }
MouseArea { onReleased: {
anchors.fill: root if (drag.active) {
drag.axis: Drag.XAxis if (x > width / 4 || x < width / -4) {
drag.target: root notificationsModel.remove(index);
onReleased: {
if (drag.active) {
if (parent.x > width / 4 || parent.x < width / -4) {
notificationsModel.remove(index);
} else {
parent.x = 0;
}
} else { } else {
parent.expanded = !parent.expanded; x = 0;
} }
} else {
expanded = !expanded;
} }
} }
PlasmaCore.IconItem { PlasmaCore.IconItem {
id: icon id: icon
width: units.iconSizes.medium width: units.iconSizes.medium
@ -135,4 +133,20 @@ Rectangle {
} }
} }
Rectangle {
id: extraArea
width: parent.width
height: parent.width
anchors {
left: summaryArea.right
top: parent.top
}
gradient: root.textGradient
Rectangle {
anchors.fill: parent
color: textGradientOverlay
}
}
} }