Changeset View
Changeset View
Standalone View
Standalone View
toolboxes/desktoptoolbox/contents/ui/ToolBoxButton.qml
Show First 20 Lines • Show All 253 Lines • ▼ Show 20 Line(s) | 228 | MouseArea { | |||
---|---|---|---|---|---|
254 | } | 254 | } | ||
255 | onPositionChanged: { | 255 | onPositionChanged: { | ||
256 | if (pressed && (Math.abs(toolBoxButton.x - pressedX) > iconSize || | 256 | if (pressed && (Math.abs(toolBoxButton.x - pressedX) > iconSize || | ||
257 | Math.abs(toolBoxButton.y - pressedY) > iconSize)) { | 257 | Math.abs(toolBoxButton.y - pressedY) > iconSize)) { | ||
258 | dragging = true; | 258 | dragging = true; | ||
259 | } | 259 | } | ||
260 | } | 260 | } | ||
261 | onClicked: { | 261 | onClicked: { | ||
262 | toolBoxLoader.active = true | | |||
263 | // the dialog auto-closes on losing focus | 262 | // the dialog auto-closes on losing focus | ||
264 | toolBoxLoader.item.visible = !main.dialogWasVisible | 263 | main.open = !main.dialogWasVisible | ||
265 | plasmoid.focus = true; | 264 | plasmoid.focus = true; | ||
266 | } | 265 | } | ||
267 | onReleased: { | 266 | onReleased: { | ||
268 | main.Plasmoid.configuration.ToolBoxButtonState = toolBoxButton.state; | 267 | main.Plasmoid.configuration.ToolBoxButtonState = toolBoxButton.state; | ||
269 | main.Plasmoid.configuration.ToolBoxButtonX = toolBoxButton.x; | 268 | main.Plasmoid.configuration.ToolBoxButtonX = toolBoxButton.x; | ||
270 | main.Plasmoid.configuration.ToolBoxButtonY = toolBoxButton.y; | 269 | main.Plasmoid.configuration.ToolBoxButtonY = toolBoxButton.y; | ||
271 | //print("Saved coordinates for ToolBox in config: " + toolBoxButton.x + ", " +toolBoxButton.x); | 270 | //print("Saved coordinates for ToolBox in config: " + toolBoxButton.x + ", " +toolBoxButton.x); | ||
272 | if (dragging) { | 271 | if (dragging) { | ||
Show All 39 Lines |