Commit bf053389 authored by Aleksi Suomalainen's avatar Aleksi Suomalainen

More QML stealing and making the homescreen to work again.

parent c7c88065
...@@ -58,6 +58,9 @@ cp -a %{SOURCE2} %{buildroot}%{_libdir}/systemd/user/ ...@@ -58,6 +58,9 @@ cp -a %{SOURCE2} %{buildroot}%{_libdir}/systemd/user/
# >> install post # >> install post
install -D -m 644 %{SOURCE1} %{buildroot}/etc/xdg/autostart/lipstick.desktop
mkdir -p %{buildroot}%{_libdir}/systemd/user/user-session.target.wants/
ln -s ../lipstick.service %{buildroot}%{_libdir}/systemd/user/user-session.target.wants/lipstick.service
# << install post # << install post
%files %files
......
[LauncherOrder]
usr\share\applications\voicecall-ui.desktop=0
usr\share\applications\qmlcontacts.desktop=1
usr\share\applications\heliumreborn.desktop=2
usr\share\applications\qmlmessages.desktop=3
usr\share\applications\qmlmail.desktop=4
usr\share\applications\qmlcalendar.desktop=5
usr\share\applications\qmlclock.desktop=6
usr\share\applications\meegocamera.desktop=7
usr\share\applications\qmlgallery.desktop=8
usr\share\applications\qmlmediaplayer.desktop=9
usr\share\applications\meego-handset-maps.desktop=10
usr\share\applications\qmlsettings.desktop=11
usr\share\applications\qmlcalc.desktop=12
...@@ -46,7 +46,7 @@ Item { ...@@ -46,7 +46,7 @@ Item {
Flickable { Flickable {
id: flickable id: flickable
contentHeight: gridview.height contentHeight: gridview.height
width: parent.width - UiConstants.DefaultMargin // see comment re right anchor below width: parent.width - 10 // see comment re right anchor below
MouseArea { MouseArea {
height: flickable.contentHeight > flickable.height ? flickable.contentHeight : flickable.height height: flickable.contentHeight > flickable.height ? flickable.contentHeight : flickable.height
...@@ -63,13 +63,13 @@ Item { ...@@ -63,13 +63,13 @@ Item {
bottom: toolBar.top bottom: toolBar.top
left: parent.left left: parent.left
// no right anchor to avoid double margin (complicated math) // no right anchor to avoid double margin (complicated math)
margins: UiConstants.DefaultMargin margins: 10
} }
Grid { Grid {
id: gridview id: gridview
columns: 2 columns: 2
spacing: UiConstants.DefaultMargin spacing: 10
move: Transition { move: Transition {
NumberAnimation { NumberAnimation {
properties: "x,y" properties: "x,y"
......
// 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, Timur Kristóf <venemo@fedoraproject.org>
import QtQuick 2.0
Image {
id: closeButton
signal clicked()
source: 'image://theme/icon-m-framework-close-thumbnail'
MouseArea {
anchors.fill: parent
onClicked: closeButton.clicked()
}
}
...@@ -2,7 +2,7 @@ import QtQuick 2.0 ...@@ -2,7 +2,7 @@ import QtQuick 2.0
Image { Image {
id: lockScreen id: lockScreen
source: wallpaperSource.value source: "images/graphics-wallpaper-home.jpg"
/** /**
* openingState should be a value between 0 and 1, where 0 means * openingState should be a value between 0 and 1, where 0 means
......
...@@ -34,9 +34,23 @@ import QtQuick.Controls 1.0 ...@@ -34,9 +34,23 @@ import QtQuick.Controls 1.0
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 QtQuick.Window 2.1 import QtQuick.Window 2.1
import org.nemomobile.time 1.0
import org.nemomobile.configuration 1.0
ApplicationWindow { ApplicationWindow {
// This is used in the favorites page and in the lock screen
WallClock {
id: wallClock
enabled: true /* XXX: Disable when display is off */
updateFrequency: WallClock.Minute
}
// This is used in the lock screen
ConfigurationValue {
id: wallpaperSource
key: desktop.isPortrait ? "/desktop/meego/background/portrait/picture_filename" : "/desktop/meego/background/landscape/picture_filename"
defaultValue: "images/graphics-wallpaper-home.jpg"
}
id: appWindow id: appWindow
contentOrientation: Screen.orientation contentOrientation: Screen.orientation
...@@ -104,5 +118,58 @@ ApplicationWindow { ...@@ -104,5 +118,58 @@ ApplicationWindow {
} }
} }
} }
tools: ToolBarLayoutExample { title: "Glacier UI" } tools: Item {
id: toolsLayoutItem
anchors.fill: parent
property string title: "Glacier UI"
property StackView pageStack: findStackView(toolsLayoutItem)
//XXX: TEMPORARY CODE, MIGHT CAUSE LAG WHEN PUSHING A PAGE ON THE STACK
function findStackView(startingItem) {
var myStack = startingItem
while (myStack) {
if (myStack.hasOwnProperty("currentItem") && myStack.hasOwnProperty("initialItem"))
return myStack
myStack = myStack.parent
}
return null
}
Rectangle {
id: backButton
width: opacity ? 60 : 0
anchors.left: parent.left
anchors.leftMargin: 20
//check if Stack.view has already been initialized as well
opacity: (pageStack && (pageStack.depth > 1)) ? 1 : 0
anchors.verticalCenter: parent.verticalCenter
antialiasing: true
height: 60
radius: 4
color: backmouse.pressed ? "#222" : "transparent"
Behavior on opacity { NumberAnimation{} }
Image {
anchors.verticalCenter: parent.verticalCenter
source: "images/navigation_previous_item.png"
}
MouseArea {
id: backmouse
anchors.fill: parent
anchors.margins: -10
onClicked: pageStack.pop()
}
}
Label {
font.pixelSize: 42
Behavior on x { NumberAnimation { easing.type: Easing.OutCubic } }
x: backButton.x + backButton.width + 20
anchors.verticalCenter: parent.verticalCenter
text: parent.title
}
}
}
} }
// 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) 2011, Tom Swindell <t.swindell@rubyx.co.uk>
// Copyright (c) 2012, Timur Kristóf <venemo@fedoraproject.org>
import QtQuick 2.0
import org.nemomobile.lipstick 0.1
MouseArea {
id: switcherItemRoot
property bool rotateWindowContent: (screen.frameBufferRotation === 90) ? desktop.isPortrait : !desktop.isPortrait
WindowPixmapItem {
id: windowPixmap
width: rotateWindowContent ? parent.height : parent.width
height: rotateWindowContent ? parent.width : parent.height
windowId: model.window
transform: Rotation {
angle: rotateWindowContent ? 90 : 0
origin.x: windowPixmap.height / 2
origin.y: windowPixmap.height / 2
}
smooth: true
radius: 5
opacity: switcherRoot.closeMode ? .6 : 1
Behavior on opacity { NumberAnimation { duration: 300; easing.type: Easing.OutBack } }
}
function close() {
Lipstick.compositor.closeClientForWindowId(model.window)
}
onClicked: {
if (!switcherRoot.closeMode) {
Lipstick.compositor.windowToFront(model.window);
}
}
onPressAndHold: {
switcherRoot.closeMode = true;
}
SequentialAnimation {
id: closeAnimation
ParallelAnimation {
NumberAnimation {
target: switcherItemRoot
property: "scale"
duration: 200
to: 0.0
}
NumberAnimation {
target: switcherItemRoot
property: "opacity"
duration: 150
to: 0.0
}
}
ScriptAction {
script: switcherItemRoot.close()
}
}
CloseButton {
id: closeButton
Behavior on scale { PropertyAnimation { duration: 300; easing.type: Easing.OutBack } }
scale: switcherRoot.closeMode ? 1 : 0
opacity: scale
enabled: !closeAnimation.running
anchors {
top: parent.top
right: parent.right
topMargin: -10
rightMargin: -10
}
onClicked: closeAnimation.start()
}
}
import QtQuick 2.0
import QtQuick.Controls.Nemo 1.0
Item {
id: toolsLayoutItem
anchors.fill: parent
property string title: ""
property StackView pageStack: findStackView(toolsLayoutItem)
//XXX: TEMPORARY CODE, MIGHT CAUSE LAG WHEN PUSHING A PAGE ON THE STACK
function findStackView(startingItem) {
var myStack = startingItem
while (myStack) {
if (myStack.hasOwnProperty("currentItem") && myStack.hasOwnProperty("initialItem"))
return myStack
myStack = myStack.parent
}
return null
}
Rectangle {
id: backButton
width: opacity ? 60 : 0
anchors.left: parent.left
anchors.leftMargin: 20
//check if Stack.view has already been initialized as well
opacity: (pageStack && (pageStack.depth > 1)) ? 1 : 0
anchors.verticalCenter: parent.verticalCenter
antialiasing: true
height: 60
radius: 4
color: backmouse.pressed ? "#222" : "transparent"
Behavior on opacity { NumberAnimation{} }
Image {
anchors.verticalCenter: parent.verticalCenter
source: "../images/navigation_previous_item.png"
}
MouseArea {
id: backmouse
anchors.fill: parent
anchors.margins: -10
onClicked: pageStack.pop()
}
}
Label {
font.pixelSize: 42
Behavior on x { NumberAnimation { easing.type: Easing.OutCubic } }
x: backButton.x + backButton.width + 20
anchors.verticalCenter: parent.verticalCenter
text: parent.title
}
}
...@@ -11,5 +11,17 @@ ...@@ -11,5 +11,17 @@
<file>qml/Lockscreen.qml</file> <file>qml/Lockscreen.qml</file>
<file>qml/LockscreenClock.qml</file> <file>qml/LockscreenClock.qml</file>
<file>qml/Pager.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>
<file>qml/images/navigation_previous_item.png</file>
<file>qml/images/tab_selected.png</file>
<file>qml/images/tabs_standard.png</file>
<file>qml/images/textinput.png</file>
<file>qml/images/toolbar.png</file>
<file>qml/images/graphics-wallpaper-home.jpg</file>
</qresource> </qresource>
</RCC> </RCC>
...@@ -7,6 +7,10 @@ VERSION = 0.1 ...@@ -7,6 +7,10 @@ VERSION = 0.1
INSTALLS = target INSTALLS = target
target.path = /usr/bin target.path = /usr/bin
config.files = lipstick.conf
config.path = /usr/share/lipstick
INSTALLS += config
CONFIG += qt link_pkgconfig CONFIG += qt link_pkgconfig
QT += quick QT += quick
...@@ -14,12 +18,9 @@ QT += quick ...@@ -14,12 +18,9 @@ QT += quick
HEADERS += HEADERS +=
SOURCES += \ SOURCES += \
main.cpp \
main.cpp main.cpp
RESOURCES += \ RESOURCES += \
resources-qml.qrc \
resources-images.qrc \
resources-qml.qrc resources-qml.qrc
PKGCONFIG += lipstick-qt5 PKGCONFIG += lipstick-qt5
...@@ -31,9 +32,9 @@ OTHER_FILES += qml/*.qml \ ...@@ -31,9 +32,9 @@ OTHER_FILES += qml/*.qml \
qml/Lockscreen.qml \ qml/Lockscreen.qml \
qml/LockscreenClock.qml \ qml/LockscreenClock.qml \
qml/AppSwitcher.qml \ qml/AppSwitcher.qml \
qml/AppLauncher.qml qml/AppLauncher.qml \
qml/ToolBarLayoutExample.qml \
qml/SwitcherItem.qml \
qml/CloseButton.qml
config.files = lipstick.conf
config.path = /usr/share/lipstick
INSTALLS += config
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