on xenial help sign in
always display close button on hover, opacity to 1.0, Porcelain button bkg
feb8628Lukáš Tinkl
qml/Notifications/Notification.qml+8−11
@@ -40,10 +40,8 @@ StyledItem {
40 property bool fullscreen: false
40 property bool fullscreen: false
41 property int maxHeight
41 property int maxHeight
42 property int margins: units.gu(1)
42 property int margins: units.gu(1)
43− readonly property bool draggable: (type === Notification.SnapDecision && state === "contracted") ||
43+
44− type === Notification.Interactive ||
45− type === Notification.Ephemeral
46− readonly property real defaultOpacity: 0.95
44+ readonly property real defaultOpacity: 1.0
47 property bool hasMouse
45 property bool hasMouse
48 property url background: ""
46 property url background: ""
49
47
@@ -101,7 +99,6 @@ StyledItem {
101 }
99 }
102
100
103 Behavior on x {
101 Behavior on x {
104− enabled: draggable
105 UbuntuNumberAnimation { easing.type: Easing.OutBounce }
102 UbuntuNumberAnimation { easing.type: Easing.OutBounce }
106 }
103 }
107
104
@@ -154,7 +151,7 @@ StyledItem {
154 }
151 }
155
152
156 onXChanged: {
153 onXChanged: {
157− if (draggable && Math.abs(notification.x) > 0.75 * notification.width) {
154+ if (Math.abs(notification.x) > 0.75 * notification.width) {
158 notification.notification.close()
155 notification.notification.close()
159 }
156 }
160 }
157 }
@@ -195,7 +192,7 @@ StyledItem {
195 anchors.fill: parent
192 anchors.fill: parent
196 objectName: "interactiveArea"
193 objectName: "interactiveArea"
197
194
198− drag.target: draggable ? notification : undefined
195+ drag.target: notification
199 drag.axis: Drag.XAxis
196 drag.axis: Drag.XAxis
200 drag.minimumX: -notification.width
197 drag.minimumX: -notification.width
201 drag.maximumX: notification.width
198 drag.maximumX: notification.width
@@ -222,7 +219,7 @@ StyledItem {
222 width: units.gu(2)
219 width: units.gu(2)
223 height: width
220 height: width
224 radius: width / 2
221 radius: width / 2
225− visible: hasMouse && draggable && (containsMouse || interactiveArea.containsMouse)
222+ visible: hasMouse && (containsMouse || interactiveArea.containsMouse)
226 iconName: "close"
223 iconName: "close"
227 outline: false
224 outline: false
228 color: theme.palette.normal.negative
225 color: theme.palette.normal.negative
@@ -444,7 +441,7 @@ StyledItem {
444 text: oneOverTwoLoaderTop.actionLabel
441 text: oneOverTwoLoaderTop.actionLabel
445 outline: notification.hints["x-canonical-private-affirmative-tint"] !== "true"
442 outline: notification.hints["x-canonical-private-affirmative-tint"] !== "true"
446 color: notification.hints["x-canonical-private-affirmative-tint"] === "true" ? theme.palette.normal.positive
443 color: notification.hints["x-canonical-private-affirmative-tint"] === "true" ? theme.palette.normal.positive
447− : theme.palette.normal.background
444+ : theme.palette.normal.foreground
448 onClicked: notification.notification.invokeAction(oneOverTwoLoaderTop.actionId)
445 onClicked: notification.notification.invokeAction(oneOverTwoLoaderTop.actionId)
449 }
446 }
450 }
447 }
@@ -474,7 +471,7 @@ StyledItem {
474 text: oneOverTwoLoaderBottom.actionLabel
471 text: oneOverTwoLoaderBottom.actionLabel
475 outline: notification.hints["x-canonical-private-rejection-tint"] !== "true"
472 outline: notification.hints["x-canonical-private-rejection-tint"] !== "true"
476 color: index == 1 && notification.hints["x-canonical-private-rejection-tint"] === "true" ? theme.palette.normal.negative
473 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
478 onClicked: notification.notification.invokeAction(oneOverTwoLoaderBottom.actionId)
475 onClicked: notification.notification.invokeAction(oneOverTwoLoaderBottom.actionId)
479 }
476 }
480 }
477 }
@@ -536,7 +533,7 @@ StyledItem {
536 outline: (index == 0 && notification.hints["x-canonical-private-affirmative-tint"] !== "true") ||
533 outline: (index == 0 && notification.hints["x-canonical-private-affirmative-tint"] !== "true") ||
537 (index == 1 && notification.hints["x-canonical-private-rejection-tint"] !== "true")
534 (index == 1 && notification.hints["x-canonical-private-rejection-tint"] !== "true")
538 color: {
535 color: {
539− var result = theme.palette.normal.background;
536+ var result = theme.palette.normal.foreground;
540 if (index == 0 && notification.hints["x-canonical-private-affirmative-tint"] === "true") {
537 if (index == 0 && notification.hints["x-canonical-private-affirmative-tint"] === "true") {
541 result = theme.palette.normal.positive;
538 result = theme.palette.normal.positive;
542 }
539 }
qml/Notifications/NotificationButton.qml+1−2
@@ -22,8 +22,6 @@ Rectangle {
22
22
23 height: units.gu(4)
23 height: units.gu(4)
24 radius: units.dp(4)
24 radius: units.dp(4)
25− border.width: outline ? units.dp(1) : 0
26− border.color: outline ? theme.palette.normal.base : "transparent"
27
25
28 // to be read from outside
26 // to be read from outside
29 readonly property bool containsMouse: button.__mouseArea.containsMouse
27 readonly property bool containsMouse: button.__mouseArea.containsMouse
@@ -38,6 +36,7 @@ Rectangle {
38 AbstractButton {
36 AbstractButton {
39 id: button
37 id: button
40 anchors.fill: root
38 anchors.fill: root
39+ __mouseArea.hoverEnabled: false
41 onClicked: root.clicked()
40 onClicked: root.clicked()
42
41
43 Label {
42 Label {