Commit 623057c3 authored by Aleksi Suomalainen's avatar Aleksi Suomalainen

Merge pull request #32 from filippz/master

Prevent lockscreen/shutdownscreen from rotating and minor improvements
parents 79a7eb36 f8487c86
......@@ -9,7 +9,7 @@ Name: lipstick-glacier-home-qt5
# << macros
Summary: A nice homescreen for Glacier experience
Version: 0.17
Version: 0.18
Release: 1
Group: System/GUI/Other
License: BSD
......
Name: lipstick-glacier-home-qt5
Summary: A nice homescreen for Glacier experience
Version: 0.17
Version: 0.18
Release: 1
Group: System/GUI/Other
License: BSD
......
......@@ -57,6 +57,8 @@ int main(int argc, char **argv)
nativeOrientation = app.primaryScreen()->nativeOrientation();
}
}
if (nativeOrientation == Qt::PrimaryOrientation)
nativeOrientation = app.primaryScreen()->primaryOrientation();
app.engine()->rootContext()->setContextProperty("nativeOrientation", nativeOrientation);
qmlRegisterType<GlacierWindowModel>("org.nemomobile.glacier", 1, 0 ,"GlacierWindowModel");
app.setQmlPath("/usr/share/lipstick-glacier-home-qt5/qml/MainScreen.qml");
......
......@@ -41,6 +41,12 @@ Item {
property bool nativeIsPortrait: ((nativeRotation === 0) || (nativeRotation === 180))
}
property Item rotationParent
function rotateRotationParent(o) {
rotateObject(rotationParent, o)
}
function rotateObject(obj, o) {
var r = Screen.angleBetween(o, Screen.primaryOrientation)
......
......@@ -72,16 +72,18 @@ Page {
GlacierRotation {
id: glacierRotation
rotationParent: desktop.parent
}
orientation: Lipstick.compositor.screenOrientation
onOrientationChanged: {
glacierRotation.rotateObject(desktop.parent, orientation)
if (!lockscreenVisible())
glacierRotation.rotateRotationParent(orientation)
}
onParentChanged: {
glacierRotation.rotateObject(desktop.parent, nativeOrientation)
glacierRotation.rotateRotationParent(nativeOrientation)
}
Component.onCompleted: {
......@@ -89,6 +91,17 @@ Page {
Lipstick.compositor.screenOrientation = nativeOrientation
}
Connections {
target: LipstickSettings
onLockscreenVisibleChanged: {
if (lockscreenVisible()) {
glacierRotation.rotateRotationParent(nativeOrientation)
} else {
glacierRotation.rotateRotationParent(desktop.orientation)
}
}
}
function lockscreenVisible() {
return LipstickSettings.lockscreenVisible === true
}
......
import QtQuick 2.0
import QtQuick.Window 2.0
import org.nemomobile.lipstick 0.1
import ".."
Rectangle {
id: shutdownWindow
width: Screen.width
height: Screen.height
width: parent.width
height: parent.height
color: "black"
property bool shouldVisible
opacity: shutdownScreen.windowVisible
GlacierRotation {
id: glacierRotation
rotationParent: shutdownWindow.parent
}
Connections {
target: shutdownScreen
onWindowVisibleChanged: {
if (shutdownScreen.windowVisible) {
glacierRotation.rotateRotationParent(nativeOrientation)
}
}
}
Image {
anchors.centerIn: parent
source: shutdownMode ? "" : "image://theme/graphic-shutdown-logo"
......
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