Changeset View
Changeset View
Standalone View
Standalone View
applets/devicenotifier/package/contents/ui/DeviceItem.qml
Show First 20 Lines • Show All 225 Lines • ▼ Show 20 Line(s) | 212 | PlasmaComponents.ProgressBar { | |||
---|---|---|---|---|---|
226 | // setting enabled to false will also make the ProgressBar *look* disabled | 226 | // setting enabled to false will also make the ProgressBar *look* disabled | ||
227 | MouseArea { | 227 | MouseArea { | ||
228 | anchors.fill: parent | 228 | anchors.fill: parent | ||
229 | onClicked: deviceItem.clicked(mouse) | 229 | onClicked: deviceItem.clicked(mouse) | ||
230 | } | 230 | } | ||
231 | } | 231 | } | ||
232 | 232 | | |||
233 | PlasmaComponents.Label { | 233 | PlasmaComponents.Label { | ||
234 | id: actionMessage | ||||
234 | width: parent.width | 235 | width: parent.width | ||
235 | height: undefined | 236 | height: undefined | ||
236 | opacity: 0.6 | 237 | opacity: 0.6 | ||
237 | font.pointSize: theme.smallestFont.pointSize | 238 | font.pointSize: theme.smallestFont.pointSize | ||
238 | visible: deviceItem.state != 0 || (!actionsList.visible && !deviceItem.hasMessage) | 239 | visible: deviceItem.state != 0 || (!actionsList.visible && !deviceItem.hasMessage) | ||
239 | text: { | 240 | text: { | ||
240 | // FIXME: state changes do not reach the plasmoid if the | 241 | // FIXME: state changes do not reach the plasmoid if the | ||
241 | // device was already attached when the plasmoid was initialized | 242 | // device was already attached when the plasmoid was initialized | ||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | |||||
299 | Item { | 300 | Item { | ||
300 | Layout.preferredWidth: units.iconSizes.medium | 301 | Layout.preferredWidth: units.iconSizes.medium | ||
301 | Layout.fillHeight: true | 302 | Layout.fillHeight: true | ||
302 | 303 | | |||
303 | PlasmaComponents.ToolButton { | 304 | PlasmaComponents.ToolButton { | ||
304 | id: actionButton | 305 | id: actionButton | ||
305 | visible: !busyIndicator.visible && deviceItem.actionVisible | 306 | visible: !busyIndicator.visible && deviceItem.actionVisible | ||
306 | onClicked: actionTriggered() | 307 | onClicked: actionTriggered() | ||
308 | y: mounted ? deviceLabel.height + (freeSpaceBar.height - height - units.smallSpacing) / 2 : (deviceLabel.height + actionMessage.height - height) / 2 | ||||
ngraham: `- 2` looks like a magic number. Might that be better expressed as `units.smallSpacing / 2`… | |||||
307 | } | 309 | } | ||
308 | 310 | | |||
309 | PlasmaComponents.BusyIndicator { | 311 | PlasmaComponents.BusyIndicator { | ||
310 | id: busyIndicator | 312 | id: busyIndicator | ||
311 | width: parent.width | 313 | width: parent.width | ||
312 | height: width | 314 | height: width | ||
313 | running: visible | 315 | running: visible | ||
314 | visible: deviceItem.state != 0 | 316 | visible: deviceItem.state != 0 | ||
315 | } | 317 | } | ||
316 | } | 318 | } | ||
317 | } | 319 | } | ||
318 | } | 320 | } |
- 2 looks like a magic number. Might that be better expressed as units.smallSpacing / 2 instead?