You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
2.9 KiB
92 lines
2.9 KiB
/* |
|
* Copyright 2013 Marco Martin <mart@kde.org> |
|
* |
|
* This program is free software; you can redistribute it and/or modify |
|
* it under the terms of the GNU General Public License as published by |
|
* the Free Software Foundation; either version 2 of the License, 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 General Public License for more details. |
|
* |
|
* You should have received a copy of the GNU General Public License |
|
* along with this program; if not, write to the Free Software |
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. |
|
*/ |
|
import QtQuick 2.0 |
|
import QtQuick.Window 2.0 |
|
|
|
import org.kde.plasma.core 2.0 as PlasmaCore |
|
import org.kde.plasma.components 2.0 as PlasmaComponents |
|
|
|
Item { |
|
id: root |
|
objectName: "org.kde.desktop-CompactApplet" |
|
anchors.fill: parent |
|
|
|
property Item fullRepresentation |
|
property Item compactRepresentation |
|
property Item expandedFeedback: expandedItem |
|
|
|
PlasmaCore.FrameSvgItem { |
|
id: expandedItem |
|
anchors.fill: parent |
|
imagePath: "widgets/tabbar" |
|
visible: fromCurrentTheme |
|
prefix: { |
|
var prefix; |
|
var location; |
|
|
|
if (plasmoid.parent && plasmoid.parent.objectName == "taskListDelegate") { |
|
location = PlasmaCore.Types.LeftEdge; |
|
} else { |
|
location = plasmoid.location; |
|
} |
|
|
|
switch (location) { |
|
case PlasmaCore.Types.LeftEdge: |
|
prefix = "west-active-tab"; |
|
break; |
|
case PlasmaCore.Types.TopEdge: |
|
prefix = "north-active-tab"; |
|
break; |
|
case PlasmaCore.Types.RightEdge: |
|
prefix = "east-active-tab"; |
|
break; |
|
default: |
|
prefix = "south-active-tab"; |
|
} |
|
if (!hasElementPrefix(prefix)) { |
|
prefix = "active-tab"; |
|
} |
|
return prefix; |
|
} |
|
opacity: plasmoid.expanded ? 1 : 0 |
|
Behavior on opacity { |
|
NumberAnimation { |
|
duration: units.shortDuration |
|
easing.type: Easing.InOutQuad |
|
} |
|
} |
|
} |
|
PlasmaComponents.BusyIndicator { |
|
z: 1000 |
|
visible: plasmoid && plasmoid.busy |
|
running: visible |
|
width: Math.min(parent.width, parent.height) |
|
height: height |
|
anchors.centerIn: parent |
|
} |
|
|
|
onCompactRepresentationChanged: { |
|
if (!compactRepresentation) { |
|
return; |
|
} |
|
compactRepresentation.parent = root; |
|
compactRepresentation.anchors.fill = root; |
|
compactRepresentation.visible = true; |
|
root.visible = true; |
|
} |
|
}
|
|
|