I have made the following changes intended for : CE:UX:MTF / lipstick-colorful-home
Please review and accept or decline. BOSS has already run some checks on this request. See the "Messages from BOSS" section below. https://build.pub.meego.com//request/show/7345 Thank You, vesuri [This message was auto-generated] --- Request # 7345: Messages from BOSS: State: review at 2012-11-08T16:00:14 by bossbot Reviews: accepted by bossbot : Prechecks succeeded. new for CE-maintainers : Please replace this text with a review and approve/reject the review (not the SR). BOSS will take care of the rest Changes: submit: home:vesuri:branches:CE:UX:MTF / lipstick-colorful-home -> CE:UX:MTF / lipstick-colorful-home changes files: -------------- --- lipstick-colorful-home.changes +++ lipstick-colorful-home.changes @@ -0,0 +1,3 @@ +* Thu Nov 08 2012 Vesa Halttunen <[email protected]> - 0.0.10 +- Fixes NEMO#548: Homescreen needs support for showing new-style notifications + old: ---- lipstick-colorful-home-0.0.9.tar.bz2 new: ---- lipstick-colorful-home-0.0.10.tar.bz2 spec files: ----------- --- lipstick-colorful-home.spec +++ lipstick-colorful-home.spec @@ -9,7 +9,7 @@ # << macros Summary: A nice homescreen -Version: 0.0.9 +Version: 0.0.10 Release: 1 Group: System/GUI/Other License: BSD other changes: -------------- ++++++ lipstick-colorful-home-0.0.9.tar.bz2 -> lipstick-colorful-home-0.0.10.tar.bz2 --- .gitignore +++ .gitignore @@ -1,12 +0,0 @@ -# Compiled Object files -*.slo -*.lo -*.o - -# Compiled Dynamic libraries -*.so - -# Compiled Static libraries -*.lai -*.la -*.a --- src/qml/NotificationPreview.qml +++ src/qml/NotificationPreview.qml @@ -0,0 +1,189 @@ + +// This file is part of colorful-home, a nice user experience for touchscreens. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// Copyright (C) 2012 Jolla Ltd. +// Contact: Vesa Halttunen <[email protected]> + +import QtQuick 1.1 +import org.nemomobile.lipstick 0.1 + +Item { + id: notificationWindow + property alias summary: summary.text + property alias body: body.text + property alias icon: icon.source + width: initialSize.width + height: initialSize.height + + MouseArea { + id: notificationArea + property bool isPortrait: true + property int notificationHeight: 102 + property int notificationMargin: 14 + property int notificationIconSize: 60 + anchors.top: parent.top + anchors.left: parent.left + width: isPortrait ? notificationWindow.height : notificationWindow.width + height: notificationArea.notificationHeight + transform: Rotation { + origin.x: notificationArea.isPortrait ? notificationWindow.height / 2 : 0; + origin.y: notificationArea.isPortrait ? notificationWindow.height / 2 : 0; + angle: notificationArea.isPortrait ? -90 : 0 + } + + onClicked: if (notificationPreviewPresenter.notification != null) notificationPreviewPresenter.notification.actionInvoked("clicked") + + Rectangle { + id: notificationPreview + anchors { + fill: parent + margins: 10 + } + color: "black" + radius: 5 + border { + color: "gray" + width: 2 + } + + opacity: 0 + + states: [ + State { + name: "show" + PropertyChanges { + target: notificationPreview + opacity: 1 + } + StateChangeScript { + name: "notificationShown" + script: { + var topLeft = notificationPreview.mapToItem(notificationWindow, 0, 0) + var bottomRight = notificationPreview.mapToItem(notificationWindow, notificationPreview.width, notificationPreview.height) + notificationPreviewPresenter.setNotificationPreviewRect(topLeft.x, topLeft.y, bottomRight.x, bottomRight.y) + notificationTimer.start() + } + } + }, + State { + name: "hide" + PropertyChanges { + target: notificationPreview + opacity: 0 + } + StateChangeScript { + name: "notificationHidden" + script: { + notificationTimer.stop() + notificationPreviewPresenter.showNextNotification() + } + } + } + ] + + transitions: [ + Transition { + to: "show" + SequentialAnimation { + NumberAnimation { property: "opacity"; duration: 200 } + ScriptAction { scriptName: "notificationShown" } + } + }, + Transition { + to: "hide" + SequentialAnimation { + NumberAnimation { property: "opacity"; duration: 200 } + ScriptAction { scriptName: "notificationHidden" } + } + } + ] + + Timer { + id: notificationTimer + interval: 3000 + repeat: false + onTriggered: notificationPreview.state = "hide" + } + + Image { + id: icon + anchors { + top: parent.top + left: parent.left + topMargin: notificationArea.notificationMargin - 3 + leftMargin: notificationArea.notificationMargin + } + width: notificationArea.notificationIconSize + height: width + source: { + var icon = "" + if (notificationPreviewPresenter.notification != null) { + icon = notificationPreviewPresenter.notification.previewIcon ? notificationPreviewPresenter.notification.previewIcon : notificationPreviewPresenter.notification.icon + if (icon) { + icon = ((icon.indexOf("/") == 0 ? "file://" : "image://theme/") + icon) + } + } + icon + } + } + + Text { + id: summary + anchors { + top: parent.top + left: icon.right + right: parent.right + topMargin: notificationArea.notificationMargin + leftMargin: notificationArea.notificationMargin + 26 + rightMargin: notificationArea.notificationMargin + } + font { + pixelSize: 22 + } + text: notificationPreviewPresenter.notification != null ? notificationPreviewPresenter.notification.previewSummary : "" + color: "white" + clip: true + elide: Text.ElideRight + } + + Text { + id: body + anchors { + top: summary.bottom + left: summary.left + right: summary.right + } + font { + pixelSize: 22 + } + text: notificationPreviewPresenter.notification != null ? notificationPreviewPresenter.notification.previewBody : "" + color: "white" + clip: true + elide: Text.ElideRight + } + + Connections { + target: notificationPreviewPresenter; + onNotificationChanged: notificationPreview.state = (notificationPreviewPresenter.notification != null) ? "show" : "hide" + } + } + } +} --- src/resources-qml.qrc +++ src/resources-qml.qrc @@ -12,5 +12,6 @@ <file>qml/pages/Search.qml</file> <file>qml/pages/Cloud.qml</file> <file>qml/pages/Favorites.qml</file> + <file>qml/NotificationPreview.qml</file> </qresource> </RCC> --- src/src.pro +++ src/src.pro @@ -34,4 +34,5 @@ qml/pages/AppLauncher/LauncherItem.qml \ qml/pages/Search.qml \ qml/pages/Cloud.qml \ - qml/pages/Favorites.qml + qml/pages/Favorites.qml \ + qml/NotificationPreview.qml ++++++ lipstick-colorful-home.yaml --- lipstick-colorful-home.yaml +++ lipstick-colorful-home.yaml @@ -1,6 +1,6 @@ Name: lipstick-colorful-home Summary: A nice homescreen -Version: 0.0.9 +Version: 0.0.10 Release: 1 Group: System/GUI/Other License: BSD
