Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
plasma-phone-components
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
KDE
plasma-phone-components
Commits
edfcb31f
Commit
edfcb31f
authored
Nov 28, 2014
by
Marco Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prototype task switcher
still needs some refinements using the state machine
parent
0bb4240b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
141 additions
and
31 deletions
+141
-31
compositor/contents/ClientWindowWrapper.qml
compositor/contents/ClientWindowWrapper.qml
+32
-0
compositor/contents/Compositor.qml
compositor/contents/Compositor.qml
+107
-29
compositor/contents/WindowManagement.js
compositor/contents/WindowManagement.js
+1
-2
compositor/contents/WindowWrapper.qml
compositor/contents/WindowWrapper.qml
+1
-0
No files found.
compositor/contents/ClientWindowWrapper.qml
View file @
edfcb31f
...
...
@@ -18,7 +18,39 @@
*/
import
QtQuick
2.0
import
org
.
kde
.
plasma
.
core
2.0
as
PlasmaCore
WindowWrapper
{
id
:
window
objectName
:
"
clientWindow
"
onXChanged
:
{
if
(
compositorRoot
.
currentWindow
==
window
)
{
compositorRoot
.
layers
.
windows
.
contentX
=
x
;
}
}
MouseArea
{
z
:
99
anchors.fill
:
parent
enabled
:
compositorRoot
.
layers
.
windows
.
switchMode
onClicked
:
{
compositorRoot
.
currentWindow
=
window
}
PlasmaCore.IconItem
{
anchors
{
right
:
parent
.
right
bottom
:
parent
.
bottom
}
visible
:
compositorRoot
.
layers
.
windows
.
switchMode
colorGroup
:
PlasmaCore
.
Theme
.
ComplementaryColorGroup
width
:
units
.
iconSizes
.
smallMedium
height
:
width
source
:
"
window-close
"
MouseArea
{
anchors.fill
:
parent
onClicked
:
window
.
close
()
}
}
}
}
compositor/contents/Compositor.qml
View file @
edfcb31f
...
...
@@ -19,6 +19,7 @@
import
QtQuick
2.0
import
QtQuick
.
Layouts
1.0
import
QtQml
.
Models
2.1
import
org
.
kde
.
plasma
.
core
2.0
as
PlasmaCore
import
"
WindowManagement.js
"
as
WindowManagement
...
...
@@ -31,6 +32,14 @@ Rectangle {
readonly
property
real
bottomBarHeight
:
units
.
iconSizes
.
large
property
var
currentWindow
:
null
onCurrentWindowChanged
:
{
if
(
!
currentWindow
)
{
return
;
}
compositorRoot
.
showHome
=
false
;
windowsLayout
.
scale
=
1
;
}
id
:
compositorRoot
color
:
"
black
"
...
...
@@ -66,38 +75,92 @@ Rectangle {
Item
{
id
:
desktopLayer
anchors.fill
:
parent
visible
:
true
z
:
showHome
?
2
:
1
visible
:
showHome
||
showPanel
}
Item
{
id
:
windowsLayer
Rectangle
{
id
:
windowsLayer
Background
anchors.fill
:
parent
anchors.topMargin
:
topBarHeight
anchors.bottomMargin
:
bottomBar
.
height
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.5
)
opacity
:
windowsLayer
.
switchMode
||
!
compositorRoot
.
showHome
?
1
:
0
z
:
showHome
?
1
:
2
visible
:
!
showHome
Behavior
on
opacity
{
NumberAnimation
{
easing.type
:
"
InOutQuad
"
duration
:
units
.
longDuration
}
}
Flickable
{
id
:
windowsLayer
anchors
{
left
:
parent
.
left
right
:
parent
.
right
verticalCenter
:
parent
.
verticalCenter
}
height
:
windowsLayout
.
height
interactive
:
windowsLayer
.
switchMode
contentWidth
:
windowsLayout
.
width
*
windowsLayout
.
scale
contentHeight
:
windowsLayout
.
height
property
bool
switchMode
:
windowsLayout
.
scale
<
1
function
addWindow
(
window
)
{
window
.
parent
=
windowsLayout
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
windowsLayout
.
scale
=
1
compositorRoot
.
showHome
=
true
;
}
Row
{
id
:
windowsLayout
height
:
windowsLayerBackground
.
height
transformOrigin
:
Item
.
Left
Behavior
on
scale
{
enabled
:
!
taskSwitchEdge
.
active
ParallelAnimation
{
PropertyAnimation
{
duration
:
units
.
shortDuration
easing
:
Easing
.
InOutQuad
}
PropertyAnimation
{
target
:
windowsLayer
property
:
"
contentX
"
to
:
compositorRoot
.
currentWindow
?
compositorRoot
.
currentWindow
.
x
:
0
duration
:
units
.
shortDuration
easing
:
Easing
.
InOutQuad
}
}
}
}
}
}
}
Item
{
id
:
panelLayer
anchors.fill
:
parent
z
:
showPanel
?
3
:
0
visible
:
showPanel
z
:
3
}
Rectangle
{
id
:
bottomBar
z
:
4
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.bottom
:
parent
.
bottom
height
:
(
showSplash
||
showHom
e
)
?
0
:
bottomBarHeight
height
:
(
!
windowsLayer
.
switchMod
e
)
?
0
:
bottomBarHeight
color
:
"
black
"
z
:
showHome
?
0
:
2
Behavior
on
height
{
NumberAnimation
{
easing.type
:
Easing
.
InOutQuad
easing.type
:
"
InOutQuad
"
duration
:
units
.
shortDuration
}
}
...
...
@@ -109,7 +172,7 @@ Rectangle {
colorGroup
:
PlasmaCore
.
Theme
.
ComplementaryColorGroup
width
:
units
.
iconSizes
.
smallMedium
height
:
width
source
:
"
window-clos
e
"
source
:
"
go-hom
e
"
Layout.alignment
:
Qt
.
AlignHCenter
Layout.preferredWidth
:
units
.
iconSizes
.
medium
...
...
@@ -118,29 +181,44 @@ Rectangle {
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
if
(
currentWindow
)
{
currentWindow
.
close
();
currentWindow
=
null
;
showHome
=
true
;
}
showHome
=
true
windowsLayout
.
scale
=
1
}
}
}
}
}
PlasmaCore.IconItem
{
colorGroup
:
PlasmaCore
.
Theme
.
ComplementaryColorGroup
width
:
units
.
iconSizes
.
smallMedium
height
:
width
source
:
"
go-home
"
Layout.alignment
:
Qt
.
AlignHCenter
Layout.preferredWidth
:
units
.
iconSizes
.
medium
Layout.preferredHeight
:
units
.
iconSizes
.
medium
MouseArea
{
anchors.fill
:
parent
onClicked
:
showHome
=
true
}
MouseArea
{
id
:
taskSwitchEdge
z
:
1000
property
bool
active
anchors
{
left
:
parent
.
left
right
:
parent
.
right
bottom
:
parent
.
bottom
}
height
:
8
enabled
:
windowsLayout
.
children
.
length
>
0
property
int
oldX
:
0
onPressed
:
{
active
=
true
;
oldX
=
mouse
.
x
;
}
onPositionChanged
:
{
var
newScale
=
(
1
-
Math
.
abs
(
mouse
.
y
)
/
(
compositorRoot
.
height
/
2
))
if
(
newScale
>
0.3
)
{
windowsLayout
.
scale
=
newScale
compositorRoot
.
showHome
=
false
;
}
windowsLayer
.
contentX
-=
(
mouse
.
x
-
oldX
);
oldX
=
mouse
.
x
;
}
onReleased
:
{
active
=
false
if
(
windowsLayout
.
scale
>
0.7
)
{
windowsLayout
.
scale
=
1
compositorRoot
.
showHome
=
true
;
}
}
}
...
...
compositor/contents/WindowManagement.js
View file @
edfcb31f
...
...
@@ -125,10 +125,9 @@ function mapApplicationSurface(surface) {
// Create and setup window container
var
window
=
component
.
createObject
(
compositorRoot
.
layers
.
windows
,
{
"
child
"
:
child
});
compositorRoot
.
layers
.
windows
.
addWindow
(
window
);
window
.
child
.
parent
=
window
;
window
.
child
.
touchEventsEnabled
=
true
;
window
.
anchors
.
top
=
window
.
parent
.
top
;
window
.
anchors
.
left
=
window
.
parent
.
left
;
window
.
width
=
surface
.
size
.
width
;
window
.
height
=
surface
.
size
.
height
;
...
...
compositor/contents/WindowWrapper.qml
View file @
edfcb31f
...
...
@@ -49,5 +49,6 @@ Item {
return
;
child
.
surface
.
client
.
close
();
window
.
destroy
();
}
}
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