Commit d475d3c0 authored by Aleksi Suomalainen's avatar Aleksi Suomalainen

Merge pull request #26 from locusf/master

Notifications screen, application title in covers and LauncherFolderModel, also USB mode selection window.
parents 1dfe7223 61738e5b
......@@ -9,7 +9,7 @@ Name: lipstick-glacier-home-qt5
# << macros
Summary: A nice homescreen for Glacier experience
Version: 0.10
Version: 0.12
Release: 1
Group: System/GUI/Other
License: BSD
......@@ -25,6 +25,7 @@ Requires: qt5-qtdeclarative-import-window2
Requires: qt5-qtquickcontrols-nemo
Requires: nemo-qml-plugin-contextkit-qt5
Requires: connman-qt5
Requires: libqofono-qt5
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(lipstick-qt5) >= 0.12.0
......@@ -73,5 +74,6 @@ ln -s ../lipstick.service %{buildroot}%{_libdir}/systemd/user/user-session.targe
%config /etc/xdg/autostart/*.desktop
%{_libdir}/systemd/user/user-session.target.wants/lipstick.service
%{_datadir}/lipstick-glacier-home-qt5/nemovars.conf
%{_datadir}/lipstick-glacier-home-qt5/qml
# >> files
# << files
Name: lipstick-glacier-home-qt5
Summary: A nice homescreen for Glacier experience
Version: 0.10
Version: 0.12
Release: 1
Group: System/GUI/Other
License: BSD
......@@ -17,6 +17,8 @@ Requires:
- qt5-qtdeclarative-import-window2 # TODO: components dep?
- qt5-qtquickcontrols-nemo
- nemo-qml-plugin-contextkit-qt5
- connman-qt5
- libqofono-qt5
PkgConfigBR:
- Qt5Core
- Qt5Quick
......@@ -32,3 +34,4 @@ Files:
- "%config /etc/xdg/autostart/*.desktop"
- "%{_libdir}/systemd/user/user-session.target.wants/lipstick.service"
- "%{_datadir}/lipstick-glacier-home-qt5/nemovars.conf"
- "%{_datadir}/lipstick-glacier-home-qt5/qml"
......@@ -24,22 +24,20 @@
#include <homeapplication.h>
#include <QFont>
#include <homewindow.h>
#include <lipstickqmlpath.h>
#include <QQmlEngine>
#include <QQmlContext>
#include "glacierwindowmodel.h"
int main(int argc, char **argv)
{
QmlPath::append("/usr/share/lipstick-glacier-home-qt5/qml");
HomeApplication app(argc, argv, QString());
QGuiApplication::setFont(QFont("Open Sans"));
setenv("EGL_PLATFORM", "wayland", 1);
setenv("QT_QPA_PLATFORM", "wayland", 1);
setenv("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1", 1);
app.setCompositorPath("qrc:/qml/compositor.qml");
app.setCompositorPath("/usr/share/lipstick-glacier-home-qt5/qml/compositor.qml");
qmlRegisterType<GlacierWindowModel>("org.nemomobile.glacier", 1, 0 ,"GlacierWindowModel");
app.setQmlPath("qrc:/qml/MainScreen.qml");
app.setQmlPath("/usr/share/lipstick-glacier-home-qt5/qml/MainScreen.qml");
app.mainWindowInstance()->showFullScreen();
return app.exec();
}
......
......@@ -84,7 +84,7 @@ GridView {
}
}
model: LauncherModel { id: launcherModel }
model: LauncherFolderModel { id: launcherModel }
delegate: LauncherItemDelegate {
id: launcherItem
......
......@@ -22,50 +22,76 @@
// Copyright (c) 2011, Tom Swindell <t.swindell@rubyx.co.uk>
// Copyright (c) 2012, Timur Kristóf <venemo@fedoraproject.org>
import QtQuick 2.0
import QtQuick 2.1
import org.nemomobile.lipstick 0.1
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
// Feeds page:
// the place for an event feed.
Item {
// Day of week
Label {
id: displayDayOfWeek
text: Qt.formatDateTime(wallClock.time, "dddd")
color: "white"
anchors {
top: parent.top
left: parent.left
topMargin: 30
leftMargin: 20
}
}
Column {
spacing: 40
// Day of week
Row {
id: daterow
height: 120
Label {
id: displayDayOfWeek
text: Qt.formatDateTime(wallClock.time, "dddd") + ", "
color: "white"
font.pointSize: 12
font.bold: true
anchors {
top: parent.top
left: parent.left
topMargin: 30
leftMargin: 20
}
}
// Current date
Label {
id: displayCurrentDate
text: Qt.formatDate(wallClock.time, Qt.SystemLocaleShortDate)
color: "#888888"
anchors {
top: displayDayOfWeek.bottom
left: parent.left
topMargin: 5
leftMargin: 20
// Current date
Label {
id: displayCurrentDate
text: Qt.formatDate(wallClock.time, "d MMMM yyyy")
font.pointSize: 12
anchors {
left: displayDayOfWeek.right
top: parent.top
topMargin: 30
}
}
}
}
Column {
anchors.top: daterow.bottom
spacing: 40
Repeater {
model: NotificationListModel {
id: notifmodel
}
delegate: Row {
spacing: 16
height: 40
Image {
source: {
if (modelData.appIcon)
return "image://theme/" + modelData.appIcon
else
return ""
}
}
// Separator thingy
Rectangle {
height: 2
color: "#888888"
anchors {
top: displayCurrentDate.bottom
left: parent.left
right: parent.right
topMargin: 5
leftMargin: 20
rightMargin: 20
Label {
id: appSummary
text: modelData.summary
font.pointSize: 10
}
Label {
text: modelData.body
font.pointSize: 8
}
}
}
}
}
}
......@@ -157,7 +157,7 @@ Item {
Spinner {
id: spinner
anchors.centerIn: parent
enabled: model.object.isLaunching
enabled: (model.object.type === 0) ? model.object.isLaunching : false
}
}
......
......@@ -2,7 +2,7 @@ import QtQuick 2.0
Image {
id: lockScreen
source: "images/graphics-wallpaper-home.jpg"
source: "qrc:/qml/images/graphics-wallpaper-home.jpg"
visible: LipstickSettings.lockscreenVisible
LockscreenClock {
......
......@@ -50,7 +50,7 @@ Page {
ConfigurationValue {
id: wallpaperSource
key: desktop.isPortrait ? "/desktop/meego/background/portrait/picture_filename" : "/desktop/meego/background/landscape/picture_filename"
defaultValue: "images/graphics-wallpaper-home.jpg"
defaultValue: "qrc:/qml/images/graphics-wallpaper-home.jpg"
}
id: desktop
property alias lockscreen: lockScreen
......@@ -112,7 +112,7 @@ Page {
}
Image {
id:wallpaper
source: "images/wallpaper-portrait-bubbles.png"
source: "qrc:/qml/images/wallpaper-portrait-bubbles.png"
anchors.fill: parent
z: -100
}
......
......@@ -171,7 +171,7 @@ Item {
}
width: notificationArea.notificationIconSize
height: width
source: "images/notification-circle.png"
source: "qrc:/qml/images/notification-circle.png"
}
Text {
......
......@@ -196,19 +196,19 @@ Item {
StatusbarItem {
source: {
if(batteryChargePercentage.value > 85) {
return "images/battery6.png"
return "qrc:/qml/images/battery6.png"
} else if (batteryChargePercentage.value <= 5) {
return "images/battery0.png"
return "qrc:/qml/images/battery0.png"
} else if (batteryChargePercentage.value <= 10) {
return "images/battery1.png"
return "qrc:/qml/images/battery1.png"
} else if (batteryChargePercentage.value <= 25) {
return "images/battery2.png"
return "qrc:/qml/images/battery2.png"
} else if (batteryChargePercentage.value <= 40) {
return "images/battery3.png"
return "qrc:/qml/images/battery3.png"
} else if (batteryChargePercentage.value <= 65) {
return "images/battery4.png"
return "qrc:/qml/images/battery4.png"
} else if (batteryChargePercentage.value <= 80) {
return "images/battery5.png"
return "qrc:/qml/images/battery5.png"
}
}
}
......
......@@ -24,6 +24,8 @@
import QtQuick 2.0
import org.nemomobile.lipstick 0.1
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
MouseArea {
id: switcherItemRoot
......@@ -81,6 +83,15 @@ MouseArea {
script: switcherItemRoot.close()
}
}
Label {
anchors {
top: parent.bottom
horizontalCenter: parent.horizontalCenter
topMargin: -30
}
font.pointSize: 8
text: Lipstick.compositor.windowForId(model.window).title
}
CloseButton {
id: closeButton
......
import QtQuick 2.0
import org.nemomobile.lipstick 0.1
Item {
property bool isPortrait: (orientationAngleContextProperty.value == 90 || orientationAngleContextProperty.value == 270)
id: usbWindow
width: initialSize.width
height: initialSize.height
/*
TODO
ContextProperty {
id: orientationAngleContextProperty
key: "/Screen/CurrentWindow/OrientationAngle"
}
*/
QtObject {
id: orientationAngleContextProperty
property int value: 0
}
Item {
property bool shouldBeVisible
id: usbDialog
width: usbWindow.isPortrait ? usbWindow.height : usbWindow.width
height: usbWindow.isPortrait ? usbWindow.width : usbWindow.height
transform: Rotation {
origin.x: { switch(orientationAngleContextProperty.value) {
case 270:
return usbWindow.height / 2
case 180:
case 90:
return usbWindow.width / 2
default:
return 0
} }
origin.y: { switch(orientationAngleContextProperty.value) {
case 270:
case 180:
return usbWindow.height / 2
case 90:
return usbWindow.width / 2
default:
return 0
} }
angle: (orientationAngleContextProperty.value === undefined || orientationAngleContextProperty.value == 0) ? 0 : -360 + orientationAngleContextProperty.value
}
opacity: shouldBeVisible ? 1 : 0
Rectangle {
anchors.fill: parent
color: "black"
opacity: 0.8
border.color: "white"
}
MouseArea {
id: usbDialogBackground
anchors.fill: parent
onClicked: { usbModeSelector.setUSBMode(4); usbDialog.shouldBeVisible = false }
Rectangle {
id: chargingOnly
anchors {
top: parent.top
left: parent.left
right: parent.right
topMargin: parent.height / 4
}
height: 102
color: "black"
radius: 5
border {
color: "gray"
width: 2
}
Text {
anchors {
fill: parent
}
text: "Current mode: Charging only"
color: "white"
font.pixelSize: 30
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Text {
id: button1
anchors {
top: chargingOnly.bottom
topMargin: 40
left: parent.left
right: parent.right
}
text: "MTP Mode"
color: "white"
font.pixelSize: 30
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
MouseArea {
anchors.fill: parent
onClicked: { usbModeSelector.setUSBMode(11); usbDialog.shouldBeVisible = false }
}
}
Text {
id: button2
anchors {
top: button1.bottom
topMargin: 40
left: parent.left
right: parent.right
}
text: "Mass Storage Mode"
color: "white"
font.pixelSize: 30
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
MouseArea {
anchors.fill: parent
onClicked: { usbModeSelector.setUSBMode(3); usbDialog.shouldBeVisible = false }
}
}
Text {
id: button3
anchors {
top: button2.bottom
topMargin: 40
left: parent.left
right: parent.right
}
text: "Developer Mode"
color: "white"
font.pixelSize: 30
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
MouseArea {
anchors.fill: parent
onClicked: { usbModeSelector.setUSBMode(10); usbDialog.shouldBeVisible = false }
}
}
}
Connections {
target: usbModeSelector
onWindowVisibleChanged: if (usbModeSelector.windowVisible) usbDialog.shouldBeVisible = true
}
Behavior on opacity {
NumberAnimation {
duration: 250
onRunningChanged: if (!running && usbDialog.opacity == 0) usbModeSelector.windowVisible = false
}
}
}
}
/****************************************************************************************
**
** Copyright (C) 2014 Aleksi Suomalainen <suomalainen.aleksi@gmail.com>
** All rights reserved.
**
** You may use this file under the terms of BSD license as follows:
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** * Neither the name of the author nor the
** names of its contributors may be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
****************************************************************************************/
import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
import org.nemomobile.lipstick 0.1
ProgressBar {
id: volumeSlider
width: parent.width
minimumValue: 0
maximumValue: volumeControl.maximumVolume
property bool shouldbevisible
opacity: volumeSlider.shouldbevisible ? 1 : 0
Behavior on opacity {
NumberAnimation {
duration: 300
onRunningChanged: if (!running && volumeSlider.opacity == 0) volumeControl.windowVisible = false
}
}
Timer {
id: voltimer
interval: 2000
onTriggered: volumeSlider.shouldbevisible = false
}
Connections {
target: volumeControl
onVolumeChanged: {
volumeSlider.value = volumeControl.volume
if (volumeControl.windowVisible) {
voltimer.restart()
}
}
onWindowVisibleChanged: {
if (volumeControl.windowVisible) {
volumeSlider.shouldbevisible = true
voltimer.restart()
}
}
}
}
......@@ -286,7 +286,8 @@ Compositor {
onWindowAdded: {
if (debug) console.log("Compositor: Window added \"" + window.title + "\"")
var isHomeWindow = window.isInProcess && root.homeWindow == null && window.title == "Home"
var isHomeWindow = window.isInProcess && root.homeWindow == null && window.title === "Home"
var isDialogWindow = window.category === "dialog"
var isNotificationWindow = window.category == "notification"
var isOverlayWindow = window.category == "overlay"
var parent = null
......@@ -315,6 +316,8 @@ Compositor {
setCurrentWindow(homeWindow)
} else if (isNotificationWindow || isOverlayWindow) {
} else if (isDialogWindow){
setCurrentWindow(window)
} else {
w = mysticWrapper.createObject(parent, {window: window})
window.userData = w
......
<RCC>
<qresource prefix="/">
<file>qml/MainScreen.qml</file>
<file>qml/compositor/ScreenGestureArea.qml</file>
<file>qml/compositor/WindowWrapperAlpha.qml</file>
<file>qml/compositor/WindowWrapperBase.qml</file>
<file>qml/AppLauncher.qml</file>
<file>qml/AppSwitcher.qml</file>
<file>qml/compositor.qml</file>
<file>qml/LauncherItemDelegate.qml</file>
<file>qml/Lockscreen.qml</file>
<file>qml/LockscreenClock.qml</file>
<file>qml/Pager.qml</file>
<file>qml/ToolBarLayoutExample.qml</file>
<file>qml/SwitcherItem.qml</file>
<file>qml/CloseButton.qml</file>
<file>qml/images/button_default.png</file>
<file>qml/images/button_pressed.png</file>
<file>qml/images/navigation_next_item.png</file>
......@@ -30,17 +16,8 @@
<file>qml/images/battery4.png</file>
<file>qml/images/battery5.png</file>
<file>qml/images/battery6.png</file>
<file>qml/compositor/WindowWrapperMystic.qml</file>
<file>qml/theme/icon-m-framework-close-thumbnail.png</file>
<file>qml/NotificationPreview.qml</file>
<file>qml/images/notification-circle.png</file>
<file>qml/scripts/desktop.js</file>
<file>qml/FeedsPage.qml</file>
<file>qml/Statusbar.qml</file>
<file>qml/images/wallpaper-portrait-bubbles.png</file>
<file>qml/StatusbarItem.qml</file>
<file>qml/WifiPanel.qml</file>
<file>qml/SimPanel.qml</file>
<file>qml/NumButton.qml</file>
</qresource>
</RCC>
......@@ -11,7 +11,38 @@ target.path = /usr/bin
styles.path = /usr/share/lipstick-glacier-home-qt5
styles.files = nemovars.conf
INSTALLS += styles
qml.path = /usr/share/lipstick-glacier-home-qt5/qml
qml.files = qml/MainScreen.qml \
qml/compositor.qml \
qml/LauncherItemDelegate.qml \
qml/Lockscreen.qml \
qml/LockscreenClock.qml \
qml/AppSwitcher.qml \
qml/AppLauncher.qml \
qml/ToolBarLayoutExample.qml \
qml/SwitcherItem.qml \
qml/CloseButton.qml \
qml/NotificationPreview.qml \
qml/FeedsPage.qml \
qml/Statusbar.qml \
qml/StatusbarItem.qml \
qml/WifiPanel.qml \
qml/SimPanel.qml \
qml/NumButton.qml \
qml/USBModeSelector.qml \
qml/Pager.qml \
qml/VolumeControl.qml
qmlcompositor.path = /usr/share/lipstick-glacier-home-qt5/qml/compositor
qmlcompositor.files = qml/compositor/WindowWrapperMystic.qml \
qml/compositor/WindowWrapperBase.qml \
qml/compositor/WindowWrapperAlpha.qml \
qml/compositor/ScreenGestureArea.qml
scripts.path = /usr/share/lipstick-glacier-home-qt5/qml/scripts
scripts.files = qml/scripts/desktop.js
INSTALLS += styles qml qmlcompositor scripts
CONFIG += qt link_pkgconfig
QT += quick compositor
......@@ -51,6 +82,8 @@ OTHER_FILES += qml/*.qml \
qml/WifiPanel.qml \
nemovars.conf \
qml/SimPanel.qml \
qml/NumButton.qml
qml/NumButton.qml \
qml/USBModeSelector.qml \
qml/VolumeControl.qml
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