Changeset View
Changeset View
Standalone View
Standalone View
toolboxes/paneltoolbox/contents/ui/main.qml
Show All 12 Lines | |||||
13 | * GNU Library General Public License for more details | 13 | * GNU Library General Public License for more details | ||
14 | * | 14 | * | ||
15 | * You should have received a copy of the GNU Library General Public | 15 | * You should have received a copy of the GNU Library General Public | ||
16 | * License along with this program; if not, write to the | 16 | * License along with this program; if not, write to the | ||
17 | * Free Software Foundation, Inc., | 17 | * Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.0 | 21 | import QtQuick 2.8 | ||
22 | import org.kde.plasma.core 2.0 as PlasmaCore | 22 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
23 | import org.kde.plasma.components 2.0 as PlasmaComponents | 23 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
24 | import org.kde.plasma.plasmoid 2.0 | 24 | import org.kde.plasma.plasmoid 2.0 | ||
25 | 25 | | |||
26 | Item { | 26 | Item { | ||
27 | id: main | 27 | id: main | ||
28 | 28 | | |||
29 | width: isVertical ? units.iconSizes.medium : units.iconSizes.smallMedium + units.smallSpacing * 2 | 29 | width: isVertical ? units.iconSizes.medium : units.iconSizes.smallMedium + units.smallSpacing * 2 | ||
30 | height: isVertical ? units.iconSizes.smallMedium + units.smallSpacing * 2 : units.iconSizes.medium | 30 | height: isVertical ? units.iconSizes.smallMedium + units.smallSpacing * 2 : units.iconSizes.medium | ||
31 | property bool isVertical: plasmoid.formFactor === 3 | 31 | property bool isVertical: plasmoid.formFactor === 3 | ||
32 | opacity: plasmoid.immutable ? 0 : (mouseArea.containsMouse || plasmoid.userConfiguring ? 1 : 0.5) | | |||
33 | 32 | | |||
34 | z: 999 | 33 | z: 999 | ||
35 | 34 | | |||
35 | states: [ | ||||
36 | State { | ||||
37 | when: plasmoid.editMode | ||||
38 | PropertyChanges { | ||||
39 | target: main | ||||
40 | visible: true | ||||
41 | } | ||||
42 | PropertyChanges { | ||||
43 | target: main | ||||
44 | opacity: mouseArea.containsMouse || plasmoid.userConfiguring ? 1 : 0.5 | ||||
45 | } | ||||
46 | }, | ||||
47 | State { | ||||
48 | when: !plasmoid.editMode | ||||
49 | PropertyChanges { | ||||
50 | target: main | ||||
51 | visible: false | ||||
52 | } | ||||
53 | PropertyChanges { | ||||
54 | target: main | ||||
55 | opacity: 0 | ||||
56 | } | ||||
57 | } | ||||
58 | ] | ||||
36 | Behavior on opacity { | 59 | Behavior on opacity { | ||
37 | NumberAnimation { | 60 | OpacityAnimator { | ||
38 | duration: units.longDuration; | 61 | duration: units.longDuration; | ||
39 | easing.type: Easing.InOutExpo; | 62 | easing.type: Easing.InOutQuad; | ||
40 | } | 63 | } | ||
41 | } | 64 | } | ||
42 | 65 | | |||
43 | LayoutMirroring.enabled: (Qt.application.layoutDirection === Qt.RightToLeft) | 66 | LayoutMirroring.enabled: (Qt.application.layoutDirection === Qt.RightToLeft) | ||
44 | anchors { | 67 | anchors { | ||
45 | left: undefined | 68 | left: undefined | ||
46 | top: undefined | 69 | top: undefined | ||
47 | right: isVertical || !parent ? undefined : parent.right | 70 | right: isVertical || !parent ? undefined : parent.right | ||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |