Changeset View
Standalone View
kcm/package/contents/ui/Output.qml
Show First 20 Lines • Show All 258 Lines • ▼ Show 20 Line(s) | 255 | DragHandler { | |||
---|---|---|---|---|---|
259 | target: null | 259 | target: null | ||
260 | 260 | | |||
261 | onTranslationChanged: { | 261 | onTranslationChanged: { | ||
262 | var newX = dragStartPosition.x + translation.x; | 262 | var newX = dragStartPosition.x + translation.x; | ||
263 | var newY = dragStartPosition.y + translation.y; | 263 | var newY = dragStartPosition.y + translation.y; | ||
264 | model.position = getAbsolutePosition(Qt.point(newX, newY)); | 264 | model.position = getAbsolutePosition(Qt.point(newX, newY)); | ||
265 | } | 265 | } | ||
266 | } | 266 | } | ||
267 | | ||||
268 | // So we can show a grabby hand cursor when hovered over | ||||
269 | MouseArea { | ||||
270 | anchors.fill: parent | ||||
271 | cursorShape: Qt.OpenHandCursor | ||||
272 | acceptedButtons: Qt.NoButton // Otherwise it interferes with the drag handler | ||||
broulik: Hm, can you still make the hand "close" when you press the button, which is what is typically… | |||||
I can do that if I accept the left button, but doing so interferes with the drag handler. I couldn;t figure out how to make these two play nicely together; assistance would be appreciated ngraham: I can do that if I accept the left button, but doing so interferes with the drag handler. I… | |||||
273 | visible: kcm.outputModel && kcm.outputModel.rowCount() > 1 | ||||
That won't update when outputs are added/removed, an invokable cannot be signalled broulik: That won't update when outputs are added/removed, an invokable cannot be signalled | |||||
ngraham: Nah it totally works! :) | |||||
This is against the laws of Physics. broulik: This is against the laws of Physics.
I suspect it just erroring out (possibly `rowCount`… | |||||
It would, but: connect (m_config.get(), &ConfigHandler::outputModelChanged, this, &KCMKScreen::outputModelChanged); which gets emitted in ConfigHandler::setConfig(KScreen::ConfigPtr config) A new screen would be a new config. I think output model is the same object, but it would retrigger this evaluation. davidedmundson: > Or the KCM re-creating the outputModel which would be weird.
It would, but:
```
connect… | |||||
This still needs fixing. Regardless of whether it happens to work now or not. davidedmundson: This still needs fixing. Regardless of whether it happens to work now or not. | |||||
Per discussion, we can do it this way for now since other pieces of code that are already committed do the same thing, and then we'll fix it for all of them in a follow-up patch. ngraham: Per discussion, we can do it this way for now since other pieces of code that are already… | |||||
274 | } | ||||
267 | } | 275 | } | ||
268 | 276 | |
Hm, can you still make the hand "close" when you press the button, which is what is typically done for dragging things