Changeset View
Changeset View
Standalone View
Standalone View
applets/systemtray/package/contents/ui/PlasmoidPopupsContainer.qml
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Copyright 2015 Marco Martin <mart@kde.org> | 2 | * Copyright 2015 Marco Martin <mart@kde.org> | ||
3 | * Copyright 2019 ivan tkachenko <ratijastk@kde.org> | ||||
3 | * | 4 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU Library General Public License as | 6 | * it under the terms of the GNU Library General Public License as | ||
6 | * published by the Free Software Foundation; either version 2, or | 7 | * published by the Free Software Foundation; either version 2, or | ||
7 | * (at your option) any later version. | 8 | * (at your option) any later version. | ||
8 | * | 9 | * | ||
9 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
Show All 18 Lines | 27 | StackView { | |||
29 | focus: true | 30 | focus: true | ||
30 | 31 | | |||
31 | Layout.minimumWidth: units.gridUnit * 12 | 32 | Layout.minimumWidth: units.gridUnit * 12 | ||
32 | Layout.minimumHeight: units.gridUnit * 12 | 33 | Layout.minimumHeight: units.gridUnit * 12 | ||
33 | 34 | | |||
34 | property Item activeApplet | 35 | property Item activeApplet | ||
35 | 36 | | |||
36 | onActiveAppletChanged: { | 37 | onActiveAppletChanged: { | ||
37 | if (activeApplet != null) { | 38 | if (activeApplet) { | ||
38 | //reset any potential anchor | 39 | //reset any potential anchor | ||
39 | activeApplet.fullRepresentationItem.anchors.left = undefined; | 40 | activeApplet.fullRepresentationItem.anchors.left = undefined; | ||
40 | activeApplet.fullRepresentationItem.anchors.top = undefined; | 41 | activeApplet.fullRepresentationItem.anchors.top = undefined; | ||
41 | activeApplet.fullRepresentationItem.anchors.right = undefined; | 42 | activeApplet.fullRepresentationItem.anchors.right = undefined; | ||
42 | activeApplet.fullRepresentationItem.anchors.bottom = undefined; | 43 | activeApplet.fullRepresentationItem.anchors.bottom = undefined; | ||
43 | activeApplet.fullRepresentationItem.anchors.centerIn = undefined; | 44 | activeApplet.fullRepresentationItem.anchors.centerIn = undefined; | ||
44 | activeApplet.fullRepresentationItem.anchors.fill = undefined; | 45 | activeApplet.fullRepresentationItem.anchors.fill = undefined; | ||
45 | 46 | | |||
46 | | ||||
47 | mainStack.replace({item: activeApplet.fullRepresentationItem, immediate: !dialog.visible, properties: {focus: true}}); | 47 | mainStack.replace({item: activeApplet.fullRepresentationItem, immediate: !dialog.visible, properties: {focus: true}}); | ||
48 | } else { | 48 | } else { | ||
49 | mainStack.replace(emptyPage); | 49 | mainStack.replace(emptyPage); | ||
50 | } | 50 | } | ||
51 | } | 51 | } | ||
52 | Connections { | 52 | Connections { | ||
53 | target: plasmoid | 53 | target: plasmoid | ||
54 | onAppletRemoved: { | 54 | onAppletRemoved: { | ||
55 | if (applet == root.activeApplet) { | 55 | if (applet === root.activeApplet) { | ||
56 | mainStack.clear() | 56 | mainStack.clear() | ||
57 | } | 57 | } | ||
58 | } | 58 | } | ||
59 | } | 59 | } | ||
60 | //used to animate away to nothing | 60 | //used to animate away to nothing | ||
61 | Item { | 61 | Item { | ||
62 | id: emptyPage | 62 | id: emptyPage | ||
63 | } | 63 | } | ||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |