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