Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
glacier-home
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NemoMobile
glacier-home
Commits
7ce1e5f7
Commit
7ce1e5f7
authored
Nov 21, 2014
by
Aleksi Suomalainen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #35 from filippz/master
Keep lockscreen in native orientation by applying rotaton to it
parents
9bbe3191
65fbabfa
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
36 deletions
+50
-36
lipstick-glacier-home-qt5.spec
rpm/lipstick-glacier-home-qt5.spec
+1
-1
lipstick-glacier-home-qt5.yaml
rpm/lipstick-glacier-home-qt5.yaml
+1
-1
GlacierRotation.qml
src/qml/GlacierRotation.qml
+28
-24
MainScreen.qml
src/qml/MainScreen.qml
+2
-4
compositor.qml
src/qml/compositor.qml
+18
-6
No files found.
rpm/lipstick-glacier-home-qt5.spec
View file @
7ce1e5f7
...
@@ -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.2
0
Version: 0.2
1
Release: 1
Release: 1
Group: System/GUI/Other
Group: System/GUI/Other
License: BSD
License: BSD
...
...
rpm/lipstick-glacier-home-qt5.yaml
View file @
7ce1e5f7
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.2
0
Version
:
0.2
1
Release
:
1
Release
:
1
Group
:
System/GUI/Other
Group
:
System/GUI/Other
License
:
BSD
License
:
BSD
...
...
src/qml/GlacierRotation.qml
View file @
7ce1e5f7
...
@@ -35,41 +35,45 @@ import org.nemomobile.lipstick 0.1
...
@@ -35,41 +35,45 @@ import org.nemomobile.lipstick 0.1
Item
{
Item
{
QtObject
{
property
int
_nativeRotation
:
Screen
.
angleBetween
(
nativeOrientation
,
Screen
.
primaryOrientation
)
id
:
privateProperties
property
bool
_nativeIsPortrait
:
((
_nativeRotation
===
0
)
||
(
_nativeRotation
===
180
))
property
int
nativeRotation
:
Screen
.
angleBetween
(
nativeOrientation
,
Screen
.
primaryOrientation
)
property
bool
nativeIsPortrait
:
((
nativeRotation
===
0
)
||
(
nativeRotation
===
180
))
}
property
Item
rotationParent
property
Item
rotationParent
property
variant
unrotatedItems
:
[]
function
rotationDiff
(
a
,
b
)
{
var
r
=
_nativeRotation
-
rotationParent
.
rotation
if
(
r
<
360
)
r
+=
360
return
r
}
function
rotateRotationParent
(
o
)
{
function
rotateRotationParent
(
o
)
{
rotateObject
(
rotationParent
,
o
)
rotateObject
(
rotationParent
,
o
)
for
(
var
i
=
0
;
i
<
unrotatedItems
.
length
;
i
++
)
{
rotateObjectToAngle
(
unrotatedItems
[
i
],
rotationDiff
(
_nativeRotation
,
rotationParent
.
rotation
))
}
}
}
function
rotateObject
(
obj
,
o
)
{
function
rotateObject
(
obj
,
o
)
{
var
r
=
Screen
.
angleBetween
(
o
,
Screen
.
primaryOrientation
)
var
r
=
Screen
.
angleBetween
(
o
,
Screen
.
primaryOrientation
)
if
(
obj
.
rotation
!==
r
)
{
if
(
obj
.
rotation
!==
r
)
rotateObjectToAngle
(
obj
,
r
)
var
isPortrait
=
((
r
===
0
)
||
(
r
===
180
))
var
correction
=
0
var
isNative
=
((
privateProperties
.
nativeIsPortrait
||
isPortrait
)
&&
!
(
privateProperties
.
nativeIsPortrait
&&
isPortrait
))
//xor
var
diff
=
Math
.
abs
(
r
-
obj
.
rotation
)
//xor
if
((
isNative
||
!
privateProperties
.
nativeIsPortrait
)
&&
!
(
isNative
&&
!
privateProperties
.
nativeIsPortrait
))
{
correction
=
obj
.
width
/
2
-
obj
.
height
/
2
if
(
diff
===
180
)
correction
=
-
correction
}
}
function
rotateObjectToAngle
(
obj
,
r
)
{
obj
.
width
=
Screen
.
width
;
obj
.
height
=
Screen
.
height
;
obj
.
x
=
0
;
obj
.
y
=
0
obj
.
rotation
=
r
obj
.
rotation
=
r
if
((
diff
===
90
)
||
(
diff
===
270
))
{
var
res
=
obj
.
mapToItem
((
obj
===
rotationParent
)
?
rotationParent
.
parent
:
rotationParent
,
0
,
0
,
obj
.
width
,
obj
.
height
)
var
w
=
obj
.
width
if
(
obj
!==
rotationParent
)
{
obj
.
width
=
obj
.
height
if
(
_nativeIsPortrait
)
{
obj
.
height
=
w
var
i
=
res
.
x
res
.
x
=
res
.
y
res
.
y
=
i
}
}
obj
.
x
=
correction
var
res2
=
rotationParent
.
mapToItem
(
rotationParent
.
parent
,
0
,
0
,
res
.
width
,
res
.
height
)
obj
.
y
=
-
correction
res
.
width
=
res2
.
width
;
res
.
height
=
res2
.
height
}
}
obj
.
x
=
res
.
x
;
obj
.
y
=
res
.
y
;
obj
.
width
=
res
.
width
;
obj
.
height
=
res
.
height
}
}
}
}
src/qml/MainScreen.qml
View file @
7ce1e5f7
...
@@ -73,6 +73,7 @@ Page {
...
@@ -73,6 +73,7 @@ Page {
GlacierRotation
{
GlacierRotation
{
id
:
glacierRotation
id
:
glacierRotation
rotationParent
:
desktop
.
parent
rotationParent
:
desktop
.
parent
unrotatedItems
:
[
lockScreen
]
}
}
orientation
:
Lipstick
.
compositor
.
screenOrientation
orientation
:
Lipstick
.
compositor
.
screenOrientation
...
@@ -94,13 +95,10 @@ Page {
...
@@ -94,13 +95,10 @@ Page {
Connections
{
Connections
{
target
:
LipstickSettings
target
:
LipstickSettings
onLockscreenVisibleChanged
:
{
onLockscreenVisibleChanged
:
{
if
(
lockscreenVisible
())
{
if
(
!
lockscreenVisible
())
glacierRotation
.
rotateRotationParent
(
nativeOrientation
)
}
else
{
glacierRotation
.
rotateRotationParent
(
desktop
.
orientation
)
glacierRotation
.
rotateRotationParent
(
desktop
.
orientation
)
}
}
}
}
}
function
lockscreenVisible
()
{
function
lockscreenVisible
()
{
return
LipstickSettings
.
lockscreenVisible
===
true
return
LipstickSettings
.
lockscreenVisible
===
true
...
...
src/qml/compositor.qml
View file @
7ce1e5f7
...
@@ -131,6 +131,8 @@ Compositor {
...
@@ -131,6 +131,8 @@ Compositor {
property
real
swipeThreshold
:
0.15
property
real
swipeThreshold
:
0.15
property
real
lockThreshold
:
0.25
property
real
lockThreshold
:
0.25
property
int
lockscreenX
property
int
lockscreenY
onGestureStarted
:
{
onGestureStarted
:
{
swipeAnimation
.
stop
()
swipeAnimation
.
stop
()
...
@@ -139,6 +141,8 @@ Compositor {
...
@@ -139,6 +141,8 @@ Compositor {
if
(
root
.
appActive
)
{
if
(
root
.
appActive
)
{
state
=
"
swipe
"
state
=
"
swipe
"
}
else
if
(
root
.
homeActive
)
{
}
else
if
(
root
.
homeActive
)
{
lockscreenX
=
Desktop
.
instance
.
lockscreen
.
x
lockscreenY
=
Desktop
.
instance
.
lockscreen
.
y
state
=
"
lock
"
state
=
"
lock
"
}
}
}
}
...
@@ -199,14 +203,22 @@ Compositor {
...
@@ -199,14 +203,22 @@ Compositor {
}
}
PropertyChanges
{
PropertyChanges
{
target
:
Desktop
.
instance
.
lockscreen
target
:
Desktop
.
instance
.
lockscreen
x
:
gestureArea
.
horizontal
?
(
Desktop
.
instance
.
lockscreenVisible
()?(
gestureArea
.
value
)
:
x
:
gestureArea
.
lockscreenX
+
((
gestureArea
.
horizontal
)
?
(
Desktop
.
instance
.
lockscreenVisible
()?(
gestureArea
.
value
)
:
(
gestureArea
.
gesture
==
"
right
"
?
(
gestureArea
.
gesture
==
"
right
"
?
-
Desktop
.
instance
.
lockscreen
.
width
+
Math
.
abs
(
gestureArea
.
value
)
:
((
Desktop
.
instance
.
lockscreen
.
width
===
topmostWindow
.
width
)
?
Desktop
.
instance
.
lockscreen
.
width
+
gestureArea
.
value
)
)
:
0
-
Desktop
.
instance
.
lockscreen
.
width
:
y
:
gestureArea
.
horizontal
?
0
:
(
Desktop
.
instance
.
lockscreenVisible
()?(
gestureArea
.
value
):
-
Desktop
.
instance
.
lockscreen
.
height
)
+
Math
.
abs
(
gestureArea
.
value
)
:
((
Desktop
.
instance
.
lockscreen
.
width
===
topmostWindow
.
width
)
?
Desktop
.
instance
.
lockscreen
.
width
:
Desktop
.
instance
.
lockscreen
.
height
)
+
gestureArea
.
value
)
)
:
0
)
y
:
gestureArea
.
lockscreenY
+
((
gestureArea
.
horizontal
)
?
0
:
(
Desktop
.
instance
.
lockscreenVisible
()?(
gestureArea
.
value
)
:
(
gestureArea
.
gesture
==
"
down
"
?
(
gestureArea
.
gesture
==
"
down
"
?
-
Desktop
.
instance
.
lockscreen
.
height
+
Math
.
abs
(
gestureArea
.
value
)
:
((
Desktop
.
instance
.
lockscreen
.
width
===
topmostWindow
.
width
)
?
Desktop
.
instance
.
lockscreen
.
height
+
gestureArea
.
value
)
)
-
Desktop
.
instance
.
lockscreen
.
height
:
-
Desktop
.
instance
.
lockscreen
.
width
)
+
Math
.
abs
(
gestureArea
.
value
)
:
((
Desktop
.
instance
.
lockscreen
.
width
===
topmostWindow
.
width
)
?
Desktop
.
instance
.
lockscreen
.
height
:
Desktop
.
instance
.
lockscreen
.
width
)
+
gestureArea
.
value
)
)
)
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment