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
3b2dc8d2
Commit
3b2dc8d2
authored
Nov 11, 2014
by
Aleksi Suomalainen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[rotation] Rotate homescreen by device orientation (by filippz).
parent
471a66cd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
3 deletions
+39
-3
main.cpp
src/main.cpp
+22
-0
nemovars.conf
src/nemovars.conf
+1
-0
MainScreen.qml
src/qml/MainScreen.qml
+12
-1
src.pro
src/src.pro
+4
-2
No files found.
src/main.cpp
View file @
3b2dc8d2
...
...
@@ -28,6 +28,7 @@
#include <QQmlEngine>
#include <QQmlContext>
#include "glacierwindowmodel.h"
#include <QScreen>
int
main
(
int
argc
,
char
**
argv
)
{
...
...
@@ -36,6 +37,27 @@ int main(int argc, char **argv)
QGuiApplication
::
setFont
(
QFont
(
"Open Sans"
));
app
.
setCompositorPath
(
"/usr/share/lipstick-glacier-home-qt5/qml/compositor.qml"
);
Qt
::
ScreenOrientation
nativeOrientation
=
app
.
primaryScreen
()
->
nativeOrientation
();
QByteArray
v
=
qgetenv
(
"GLACIER_NATIVEORIENTATION"
);
if
(
!
v
.
isEmpty
())
{
switch
(
v
.
toInt
())
{
case
1
:
nativeOrientation
=
Qt
::
PortraitOrientation
;
break
;
case
2
:
nativeOrientation
=
Qt
::
LandscapeOrientation
;
break
;
case
4
:
nativeOrientation
=
Qt
::
InvertedPortraitOrientation
;
break
;
case
8
:
nativeOrientation
=
Qt
::
InvertedLandscapeOrientation
;
break
;
default:
nativeOrientation
=
app
.
primaryScreen
()
->
nativeOrientation
();
}
}
app
.
engine
()
->
rootContext
()
->
setContextProperty
(
"nativeOrientation"
,
v
);
qmlRegisterType
<
GlacierWindowModel
>
(
"org.nemomobile.glacier"
,
1
,
0
,
"GlacierWindowModel"
);
app
.
setQmlPath
(
"/usr/share/lipstick-glacier-home-qt5/qml/MainScreen.qml"
);
// Give these to the environment inside the lipstick homescreen
...
...
src/nemovars.conf
View file @
3b2dc8d2
QT_QUICK_CONTROLS_STYLE
=
Nemo
GLACIER_NATIVEORIENTATION
=
1
src/qml/MainScreen.qml
View file @
3b2dc8d2
...
...
@@ -36,10 +36,11 @@ import QtQuick.Controls.Styles.Nemo 1.0
import
QtQuick
.
Window
2.1
import
org
.
nemomobile
.
time
1.0
import
org
.
nemomobile
.
configuration
1.0
import
org
.
nemomobile
.
lipstick
0.1
import
"
scripts/desktop.js
"
as
Desktop
import
"
scripts/rotation.js
"
as
Rotation
Page
{
// This is used in the favorites page and in the lock screen
WallClock
{
id
:
wallClock
...
...
@@ -56,6 +57,7 @@ Page {
property
alias
lockscreen
:
lockScreen
property
alias
switcher
:
switcher
// Implements back key navigation
Keys.onReleased
:
{
if
(
event
.
key
===
Qt
.
Key_Back
)
{
if
(
pageStack
.
depth
>
1
)
{
...
...
@@ -69,6 +71,15 @@ Page {
id
:
statusbar
}
orientation
:
Lipstick
.
compositor
.
screenOrientation
onOrientationChanged
:
{
Rotation
.
rotateObject
(
desktop
.
parent
,
Screen
.
angleBetween
(
orientation
,
Screen
.
primaryOrientation
),
Screen
.
angleBetween
(
nativeOrientation
,
Screen
.
primaryOrientation
))
}
onParentChanged
:
{
Rotation
.
rotateObject
(
desktop
.
parent
,
Screen
.
angleBetween
(
nativeOrientation
,
Screen
.
primaryOrientation
),
Screen
.
angleBetween
(
nativeOrientation
,
Screen
.
primaryOrientation
))
}
Component
.
onCompleted
:
{
Desktop
.
instance
=
desktop
}
...
...
src/src.pro
View file @
3b2dc8d2
...
...
@@ -43,7 +43,8 @@ qmlcompositor.files = qml/compositor/WindowWrapperMystic.qml \
qml
/
compositor
/
ScreenGestureArea
.
qml
scripts
.
path
=
/
usr
/
share
/
lipstick
-
glacier
-
home
-
qt5
/
qml
/
scripts
scripts
.
files
=
qml
/
scripts
/
desktop
.
js
scripts
.
files
=
qml
/
scripts
/
desktop
.
js
\
qml
/
scripts
/
rotation
.
js
system
.
path
=
/
usr
/
share
/
lipstick
-
glacier
-
home
-
qt5
/
qml
/
system
system
.
files
=
qml
/
ShutdownScreen
.
qml
...
...
@@ -104,6 +105,7 @@ OTHER_FILES += qml/*.qml \
qml/VolumeControl.qml \
qml/BatteryPanel.qml \
qml/CommonPanel.qml \
qml/ShutdownScreen.qml
qml/ShutdownScreen.qml \
qml/scripts/rotation.js
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