on xenial help sign in
always display close button on hover, opacity to 1.0, Porcelain button bkg
commitfeb862815acc511d6e408de2ce6335b94282e536 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateMon 11 Apr 2016, 13:11 (11 years ago) parent56a7712
2 files changed+9−13
qml/Notifications/Notification.qml+8−11 qml/Notifications/NotificationButton.qml+1−2
qml/Notifications/Notification.qml+8−11
@@ -40,10 +40,8 @@ StyledItem {
4040 property bool fullscreen: false
4141 property int maxHeight
4242 property int margins: units.gu(1)
43− readonly property bool draggable: (type === Notification.SnapDecision && state === "contracted") ||
44− type === Notification.Interactive ||
45− type === Notification.Ephemeral
46− readonly property real defaultOpacity: 0.95
43+
44+ readonly property real defaultOpacity: 1.0
4745 property bool hasMouse
4846 property url background: ""
4947
@@ -101,7 +99,6 @@ StyledItem {
10199 }
102100
103101 Behavior on x {
104− enabled: draggable
105102 UbuntuNumberAnimation { easing.type: Easing.OutBounce }
106103 }
107104
@@ -154,7 +151,7 @@ StyledItem {
154151 }
155152
156153 onXChanged: {
157− if (draggable && Math.abs(notification.x) > 0.75 * notification.width) {
154+ if (Math.abs(notification.x) > 0.75 * notification.width) {
158155 notification.notification.close()
159156 }
160157 }
@@ -195,7 +192,7 @@ StyledItem {
195192 anchors.fill: parent
196193 objectName: "interactiveArea"
197194
198− drag.target: draggable ? notification : undefined
195+ drag.target: notification
199196 drag.axis: Drag.XAxis
200197 drag.minimumX: -notification.width
201198 drag.maximumX: notification.width
@@ -222,7 +219,7 @@ StyledItem {
222219 width: units.gu(2)
223220 height: width
224221 radius: width / 2
225− visible: hasMouse && draggable && (containsMouse || interactiveArea.containsMouse)
222+ visible: hasMouse && (containsMouse || interactiveArea.containsMouse)
226223 iconName: "close"
227224 outline: false
228225 color: theme.palette.normal.negative
@@ -444,7 +441,7 @@ StyledItem {
444441 text: oneOverTwoLoaderTop.actionLabel
445442 outline: notification.hints["x-canonical-private-affirmative-tint"] !== "true"
446443 color: notification.hints["x-canonical-private-affirmative-tint"] === "true" ? theme.palette.normal.positive
447− : theme.palette.normal.background
444+ : theme.palette.normal.foreground
448445 onClicked: notification.notification.invokeAction(oneOverTwoLoaderTop.actionId)
449446 }
450447 }
@@ -474,7 +471,7 @@ StyledItem {
474471 text: oneOverTwoLoaderBottom.actionLabel
475472 outline: notification.hints["x-canonical-private-rejection-tint"] !== "true"
476473 color: index == 1 && notification.hints["x-canonical-private-rejection-tint"] === "true" ? theme.palette.normal.negative
477− : theme.palette.normal.background
474+ : theme.palette.normal.foreground
478475 onClicked: notification.notification.invokeAction(oneOverTwoLoaderBottom.actionId)
479476 }
480477 }
@@ -536,7 +533,7 @@ StyledItem {
536533 outline: (index == 0 && notification.hints["x-canonical-private-affirmative-tint"] !== "true") ||
537534 (index == 1 && notification.hints["x-canonical-private-rejection-tint"] !== "true")
538535 color: {
539− var result = theme.palette.normal.background;
536+ var result = theme.palette.normal.foreground;
540537 if (index == 0 && notification.hints["x-canonical-private-affirmative-tint"] === "true") {
541538 result = theme.palette.normal.positive;
542539 }
qml/Notifications/NotificationButton.qml+1−2
@@ -22,8 +22,6 @@ Rectangle {
2222
2323 height: units.gu(4)
2424 radius: units.dp(4)
25− border.width: outline ? units.dp(1) : 0
26− border.color: outline ? theme.palette.normal.base : "transparent"
2725
2826 // to be read from outside
2927 readonly property bool containsMouse: button.__mouseArea.containsMouse
@@ -38,6 +36,7 @@ Rectangle {
3836 AbstractButton {
3937 id: button
4038 anchors.fill: root
39+ __mouseArea.hoverEnabled: false
4140 onClicked: root.clicked()
4241
4342 Label {