Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Plasma
Plasma Phone Components
Commits
536dc945
Commit
536dc945
authored
Jun 21, 2015
by
Marco Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support closing windows
parent
1c708ff7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
35 deletions
+93
-35
containments/taskpanel/package/contents/ui/Task.qml
containments/taskpanel/package/contents/ui/Task.qml
+92
-0
containments/taskpanel/package/contents/ui/TaskSwitcher.qml
containments/taskpanel/package/contents/ui/TaskSwitcher.qml
+1
-35
No files found.
containments/taskpanel/package/contents/ui/Task.qml
0 → 100644
View file @
536dc945
/*
* Copyright 2015 Marco Martin <notmart@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import
QtQuick
2.0
import
QtQuick
.
Layouts
1.1
import
QtQuick
.
Window
2.2
import
org
.
kde
.
plasma
.
core
2.0
as
PlasmaCore
import
org
.
kde
.
plasma
.
components
2.0
as
PlasmaComponents
import
org
.
kde
.
plasma
.
mobilecomponents
0.2
import
org
.
kde
.
plasma
.
private
.
taskmanager
0.1
as
TaskManager
Item
{
id
:
delegate
width
:
window
.
width
/
2
height
:
window
.
height
/
2
Item
{
anchors
{
fill
:
parent
margins
:
units
.
gridUnit
}
NumberAnimation
{
id
:
slideAnim
target
:
background
properties
:
"
x
"
duration
:
units
.
longDuration
easing.type
:
Easing
.
InOutQuad
}
Rectangle
{
id
:
background
width
:
parent
.
width
height
:
parent
.
height
radius
:
units
.
gridUnit
opacity
:
0.8
PlasmaCore.IconItem
{
anchors.centerIn
:
parent
width
:
Math
.
min
(
parent
.
width
,
parent
.
height
)
source
:
model
.
DecorationRole
}
PlasmaComponents.Label
{
anchors
{
bottom
:
parent
.
bottom
horizontalCenter
:
parent
.
horizontalCenter
left
:
parent
.
left
right
:
parent
.
right
}
horizontalAlignment
:
Text
.
AlignHCenter
elide
:
Text
.
ElideRight
text
:
model
.
DisplayRole
}
MouseArea
{
anchors.fill
:
parent
drag
{
target
:
background
axis
:
Drag
.
XAxis
}
onPressed
:
delegate
.
z
=
10
;
onClicked
:
{
window
.
hide
();
backend
.
activateItem
(
model
.
Id
,
true
);
}
onReleased
:
{
delegate
.
z
=
0
;
if
(
Math
.
abs
(
background
.
x
)
>
background
.
width
/
2
)
{
backend
.
closeByItemId
(
model
.
Id
);
}
else
{
slideAnim
.
to
=
0
;
slideAnim
.
running
=
true
;
}
}
}
}
}
}
containments/taskpanel/package/contents/ui/TaskSwitcher.qml
View file @
536dc945
...
...
@@ -120,40 +120,6 @@ FullScreenPanel {
width
:
window
.
width
height
:
window
.
height
}
delegate
:
Item
{
width
:
window
.
width
/
2
height
:
window
.
height
/
2
Rectangle
{
anchors
{
fill
:
parent
margins
:
units
.
gridUnit
}
radius
:
units
.
gridUnit
opacity
:
0.8
PlasmaCore.IconItem
{
anchors.centerIn
:
parent
width
:
Math
.
min
(
parent
.
width
,
parent
.
height
)
source
:
model
.
DecorationRole
}
PlasmaComponents.Label
{
anchors
{
bottom
:
parent
.
bottom
horizontalCenter
:
parent
.
horizontalCenter
left
:
parent
.
left
right
:
parent
.
right
}
horizontalAlignment
:
Text
.
AlignHCenter
elide
:
Text
.
ElideRight
text
:
model
.
DisplayRole
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
window
.
hide
();
backend
.
activateItem
(
model
.
Id
,
true
);
}
}
}
}
delegate
:
Task
{}
}
}
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