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
a12bf787
Commit
a12bf787
authored
Oct 16, 2017
by
eekkelund
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Compositor] Fix gesture area
parent
7039a6ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
11 deletions
+69
-11
compositor_new.qml
src/qml/compositor_new.qml
+69
-11
No files found.
src/qml/compositor_new.qml
View file @
a12bf787
...
...
@@ -28,6 +28,7 @@ import "scripts/desktop.js" as Desktop
Item
{
id
:
root
anchors.fill
:
parent
property
bool
isShaderUsed
:
false
property
bool
isAlarmWindow
:
false
property
alias
wrapperMystic
:
mysticWrapper
...
...
@@ -100,7 +101,7 @@ Item {
cancelAnimation
.
stop
()
lockAnimation
.
stop
()
if
(
comp
.
appActive
)
{
gestureOnGoing
=
true
comp
.
gestureOnGoing
=
true
state
=
"
swipe
"
}
else
if
(
comp
.
homeActive
)
{
lockscreenX
=
Desktop
.
instance
.
lockscreen
.
x
...
...
@@ -132,20 +133,18 @@ Item {
if
(
!
Desktop
.
instance
.
lockscreenVisible
())
{
Desktop
.
instance
.
setLockScreen
(
true
)
if
(
gesture
==
"
down
"
)
{
setDisplayOff
()
comp
.
setDisplayOff
()
}
}
// Unlocks if no security code required
else
if
(
DeviceLock
.
state
!==
DeviceLock
.
Locked
&&
Desktop
.
instance
.
lockscreenVisible
())
{
Desktop
.
instance
.
setLockScreen
(
false
)
}
}
else
{
Desktop
.
instance
.
setLockScreen
(
false
)
}
}
else
{
cancelAnimation
.
start
()
}
gestureOnGoing
=
false
}
comp
.
gestureOnGoing
=
false
}
// States are for the animations that follow your finger during swipes
states
:
[
...
...
@@ -175,21 +174,78 @@ Item {
x
:
gestureArea
.
lockscreenX
+
((
gestureArea
.
horizontal
)
?
(
Desktop
.
instance
.
lockscreenVisible
()?(
gestureArea
.
value
)
:
(
gestureArea
.
gesture
==
"
right
"
?
((
Desktop
.
instance
.
lockscreen
.
width
===
topmostWindow
.
width
)
?
((
Desktop
.
instance
.
lockscreen
.
width
===
comp
.
topmostWindow
.
width
)
?
-
Desktop
.
instance
.
lockscreen
.
width
:
-
Desktop
.
instance
.
lockscreen
.
height
)
+
Math
.
abs
(
gestureArea
.
value
)
:
((
Desktop
.
instance
.
lockscreen
.
width
===
topmostWindow
.
width
)
?
((
Desktop
.
instance
.
lockscreen
.
width
===
comp
.
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
"
?
((
Desktop
.
instance
.
lockscreen
.
width
===
topmostWindow
.
width
)
?
((
Desktop
.
instance
.
lockscreen
.
width
===
comp
.
topmostWindow
.
width
)
?
-
Desktop
.
instance
.
lockscreen
.
height
:
-
Desktop
.
instance
.
lockscreen
.
width
)
+
Math
.
abs
(
gestureArea
.
value
)
:
((
Desktop
.
instance
.
lockscreen
.
width
===
topmostWindow
.
width
)
?
((
Desktop
.
instance
.
lockscreen
.
width
===
comp
.
topmostWindow
.
width
)
?
Desktop
.
instance
.
lockscreen
.
height
:
Desktop
.
instance
.
lockscreen
.
width
)
+
gestureArea
.
value
)
)
)
}
},
// pullCodepad is when you are pulling codepad into view to enter security code
State
{
name
:
"
pullCodepad
"
when
:
Desktop
.
instance
.
codepadVisible
PropertyChanges
{
target
:
Desktop
.
instance
codepadVisible
:
true
}
PropertyChanges
{
target
:
gestureArea
delayReset
:
true
}
PropertyChanges
{
target
:
Desktop
.
instance
.
codepad
// Confusing logic and math to get the codepad follow your finger
x
:
gestureArea
.
lockscreenX
+
(
gestureArea
.
value
<
0
?
Desktop
.
instance
.
lockscreen
.
width
:
-
Desktop
.
instance
.
lockscreen
.
width
)
+
((
gestureArea
.
horizontal
)
?
(
Desktop
.
instance
.
lockscreenVisible
()?(
gestureArea
.
value
)
:
(
gestureArea
.
gesture
==
"
right
"
?
((
Desktop
.
instance
.
lockscreen
.
width
===
comp
.
topmostWindow
.
width
)
?
-
Desktop
.
instance
.
lockscreen
.
width
:
-
Desktop
.
instance
.
lockscreen
.
height
)
+
Math
.
abs
(
gestureArea
.
value
)
:
((
Desktop
.
instance
.
lockscreen
.
width
===
comp
.
topmostWindow
.
width
)
?
Desktop
.
instance
.
lockscreen
.
width
:
Desktop
.
instance
.
lockscreen
.
height
)
+
gestureArea
.
value
)
)
:
0
)
// Bringing up the codepad opacity from 0 to 1
opacity
:
gestureArea
.
horizontal
?
(
gestureArea
.
value
<
0
?
(
gestureArea
.
value
/
-
Desktop
.
instance
.
lockscreen
.
width
)
:
gestureArea
.
value
/
Desktop
.
instance
.
lockscreen
.
width
)
:
0
}
},
// pushCodepad is when you are pushing the codepad away without entering a security code
State
{
name
:
"
pushCodepad
"
when
:
Desktop
.
instance
.
lockscreenVisible
()
&&
DeviceLock
.
state
===
DeviceLock
.
Locked
&&
Desktop
.
instance
.
codepadVisible
PropertyChanges
{
target
:
gestureArea
delayReset
:
true
}
PropertyChanges
{
target
:
Desktop
.
instance
.
codepad
// Confusing logic for the codepad to follow your swipe
x
:
gestureArea
.
lockscreenX
+
((
gestureArea
.
horizontal
)
?
(
Desktop
.
instance
.
lockscreenVisible
()?(
gestureArea
.
value
)
:
(
gestureArea
.
gesture
==
"
right
"
?
((
Desktop
.
instance
.
lockscreen
.
width
===
comp
.
topmostWindow
.
width
)
?
-
Desktop
.
instance
.
lockscreen
.
width
:
-
Desktop
.
instance
.
lockscreen
.
height
)
+
Math
.
abs
(
gestureArea
.
value
)
:
((
Desktop
.
instance
.
lockscreen
.
width
===
comp
.
topmostWindow
.
width
)
?
Desktop
.
instance
.
lockscreen
.
width
:
Desktop
.
instance
.
lockscreen
.
height
)
+
gestureArea
.
value
)
)
:
0
)
// Hiding the codepad with opacity fading from 1 to 0
opacity
:
1
-
(
gestureArea
.
horizontal
?
(
gestureArea
.
value
<
0
?
(
gestureArea
.
value
/
-
Desktop
.
instance
.
lockscreen
.
width
)
:
gestureArea
.
value
/
Desktop
.
instance
.
lockscreen
.
width
)
:
0
)
}
}
]
...
...
@@ -248,7 +304,7 @@ Item {
}
ScriptAction
{
script
:
setCurrentWindow
(
comp
.
homeWindow
)
script
:
comp
.
setCurrentWindow
(
comp
.
homeWindow
)
}
PropertyAction
{
...
...
@@ -283,6 +339,8 @@ Item {
// Set to the item of the current topmost window
property
Item
topmostWindow
property
bool
gestureOnGoing
// True if the home window is the topmost window
homeActive
:
topmostWindow
==
comp
.
homeWindow
property
bool
appActive
:
!
homeActive
...
...
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