Commit 48e961ef authored by m2ko's avatar m2ko

Add scaling to notification preview

parent 66ebe6dc
...@@ -26,6 +26,7 @@ import QtQuick 2.0 ...@@ -26,6 +26,7 @@ import QtQuick 2.0
import org.nemomobile.lipstick 0.1 import org.nemomobile.lipstick 0.1
import QtQuick.Controls.Nemo 1.0 import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0 import QtQuick.Controls.Styles.Nemo 1.0
import QtGraphicalEffects 1.0
import "../scripts/desktop.js" as Desktop import "../scripts/desktop.js" as Desktop
...@@ -39,27 +40,12 @@ Item { ...@@ -39,27 +40,12 @@ Item {
rotation: Desktop.instance.parent.rotation rotation: Desktop.instance.parent.rotation
x: Desktop.instance.parent.x x: Desktop.instance.parent.x
y: Desktop.instance.parent.y y: Desktop.instance.parent.y
Rectangle {
id: dimmer
height: Math.min(parent.width,parent.height)/14
anchors.top: parent.top
anchors.topMargin: notificationArea.notificationHeight
anchors.left: parent.left
anchors.right: parent.right
gradient: Gradient {
GradientStop { position: 1.0; color: "black" }
GradientStop { position: 0; color: "transparent" }
}
}
MouseArea { MouseArea {
id: notificationArea id: notificationArea
property int notificationHeight: Math.min(parent.width,parent.height)/12 property int notificationHeight: Theme.itemHeightExtraLarge
property int notificationMargin: 14 property int notificationMargin: Theme.itemSpacingExtraSmall
property int notificationIconSize: Math.min(parent.width,parent.height)/12 property int notificationIconSize: Theme.itemHeightMedium
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
width: notificationWindow.width width: notificationWindow.width
...@@ -67,14 +53,18 @@ Item { ...@@ -67,14 +53,18 @@ Item {
onClicked: if (notificationPreviewPresenter.notification != null) notificationPreviewPresenter.notification.actionInvoked("default") onClicked: if (notificationPreviewPresenter.notification != null) notificationPreviewPresenter.notification.actionInvoked("default")
Rectangle { Rectangle {
id: notificationPreview id: notificationPreview
anchors { anchors {
fill: parent fill: parent
} }
color: "transparent"
radius: 10
gradient: Gradient {
GradientStop { position: 1.0; color: "black" }
GradientStop { position: 0; color: "transparent"}
}
opacity: 0 opacity: 0
states: [ states: [
...@@ -149,13 +139,14 @@ Item { ...@@ -149,13 +139,14 @@ Item {
top: parent.top top: parent.top
left: icon.right left: icon.right
right: parent.right right: parent.right
leftMargin: notificationArea.notificationMargin + 26 topMargin: notificationArea.notificationMargin
leftMargin: notificationArea.notificationMargin*2
rightMargin: notificationArea.notificationMargin rightMargin: notificationArea.notificationMargin
bottomMargin: notificationArea.notificationMargin //bottomMargin: notificationArea.notificationMargin
} }
font.pointSize: 12 font.pixelSize: Theme.fontSizeLarge
text: notificationPreviewPresenter.notification != null ? notificationPreviewPresenter.notification.previewSummary : "" text: notificationPreviewPresenter.notification != null ? notificationPreviewPresenter.notification.previewSummary : ""
color: "white" color: "darkgray"
clip: true clip: true
elide: Text.ElideRight elide: Text.ElideRight
} }
...@@ -168,7 +159,7 @@ Item { ...@@ -168,7 +159,7 @@ Item {
right: summary.right right: summary.right
} }
font { font {
pointSize: 10 pixelSize: Theme.fontSizeMedium
bold: true bold: true
} }
text: notificationPreviewPresenter.notification != null ? notificationPreviewPresenter.notification.previewBody : "" text: notificationPreviewPresenter.notification != null ? notificationPreviewPresenter.notification.previewBody : ""
...@@ -176,6 +167,25 @@ Item { ...@@ -176,6 +167,25 @@ Item {
clip: true clip: true
elide: Text.ElideRight elide: Text.ElideRight
} }
//The close button goes here that is in one of the designs
MouseArea {
id: notificationCloser
anchors {
right: parent.right
top: parent.top
}
height: notificationArea.notificationHeight
width: height
//The X icon goes here
/*Image {
id: closeIcon
anchors.centerIn: parent
width: Theme.itemHeightMedium
height: width
source: "/usr/share/lipstick-glacier-home-qt5/qml/images/closeapp.svg"
}*/
}
Connections { Connections {
target: notificationPreviewPresenter; target: notificationPreviewPresenter;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment