Changeset View
Changeset View
Standalone View
Standalone View
applets/systemtray/package/contents/ui/main.qml
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Line(s) | 99 | onWheel: { | |||
---|---|---|---|---|---|
100 | // Don't propagate unhandled wheel events | 100 | // Don't propagate unhandled wheel events | ||
101 | wheel.accepted = true; | 101 | wheel.accepted = true; | ||
102 | } | 102 | } | ||
103 | 103 | | |||
104 | Containment.onAppletAdded: { | 104 | Containment.onAppletAdded: { | ||
105 | if (!plasmoidItemComponent) { | 105 | if (!plasmoidItemComponent) { | ||
106 | plasmoidItemComponent = Qt.createComponent("items/PlasmoidItem.qml"); | 106 | plasmoidItemComponent = Qt.createComponent("items/PlasmoidItem.qml"); | ||
107 | } | 107 | } | ||
108 | //Allow the plasmoid expander to know in what window it will be | ||||
108 | var plasmoidContainer = plasmoidItemComponent.createObject(invisibleEntriesContainer, {"x": x, "y": y, "applet": applet}); | 109 | var plasmoidContainer = plasmoidItemComponent.createObject(invisibleEntriesContainer, {"x": x, "y": y, "applet": applet}); | ||
109 | 110 | | |||
110 | applet.parent = plasmoidContainer | 111 | applet.parent = plasmoidContainer | ||
111 | applet.anchors.left = plasmoidContainer.left | 112 | applet.anchors.left = plasmoidContainer.left | ||
112 | applet.anchors.top = plasmoidContainer.top | 113 | applet.anchors.top = plasmoidContainer.top | ||
113 | applet.anchors.bottom = plasmoidContainer.bottom | 114 | applet.anchors.bottom = plasmoidContainer.bottom | ||
114 | applet.width = plasmoidContainer.height | 115 | applet.width = plasmoidContainer.height | ||
115 | applet.visible = true | 116 | applet.visible = true | ||
116 | plasmoidContainer.visible = true | 117 | plasmoidContainer.visible = true | ||
118 | | ||||
119 | //This is to make preloading effective, minimizes the scene changes | ||||
120 | if (applet.fullRepresentationItem) { | ||||
121 | applet.fullRepresentationItem.width = expandedRepresentation.width | ||||
broulik: Shouldn't this be a binding? | |||||
not really, as is just an inizialization to have the size it will have when properly reparented when the popup is open, it's put in the StackView, so is them propely anchored and all putting a binding here would just make things more complicated and potentially different things that want to resize the same thing at once mart: not really, as is just an inizialization to have the size it will have when properly reparented… | |||||
122 | applet.fullRepresentationItem.width = expandedRepresentation.height | ||||
123 | applet.fullRepresentationItem.parent = preloadedStorage; | ||||
124 | } else { | ||||
125 | applet.fullRepresentationItemChanged.connect(function() { | ||||
126 | applet.fullRepresentationItem.width = expandedRepresentation.width | ||||
127 | applet.fullRepresentationItem.width = expandedRepresentation.height | ||||
128 | applet.fullRepresentationItem.parent = preloadedStorage; | ||||
129 | }); | ||||
130 | } | ||||
131 | } | ||||
132 | | ||||
133 | //being there forces the items to fully load, and they will be reparented in the popup one by one | ||||
134 | Item { | ||||
135 | id: preloadedStorage | ||||
136 | visible: false | ||||
137 | z: -1 | ||||
138 | | ||||
117 | } | 139 | } | ||
118 | 140 | | |||
119 | Containment.onAppletRemoved: { | 141 | Containment.onAppletRemoved: { | ||
120 | } | 142 | } | ||
121 | 143 | | |||
122 | Connections { | 144 | Connections { | ||
123 | target: plasmoid | 145 | target: plasmoid | ||
124 | onUserConfiguringChanged: { | 146 | onUserConfiguringChanged: { | ||
▲ Show 20 Lines • Show All 244 Lines • Show Last 20 Lines |
Shouldn't this be a binding?