Changeset View
Changeset View
Standalone View
Standalone View
applets/pager/package/contents/ui/main.qml
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 29 | MouseArea { | |||
---|---|---|---|---|---|
46 | 46 | | |||
47 | Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation | 47 | Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation | ||
48 | Plasmoid.status: pagerModel.shouldShowPager ? PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.HiddenStatus | 48 | Plasmoid.status: pagerModel.shouldShowPager ? PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.HiddenStatus | ||
49 | 49 | | |||
50 | Layout.fillWidth: root.vertical | 50 | Layout.fillWidth: root.vertical | ||
51 | Layout.fillHeight: !root.vertical | 51 | Layout.fillHeight: !root.vertical | ||
52 | 52 | | |||
53 | property bool dragging: false | 53 | property bool dragging: false | ||
54 | property int dragId | 54 | property string dragId | ||
55 | 55 | | |||
56 | property int dragSwitchDesktopId: -1 | 56 | property string dragSwitchDesktopId | ||
57 | 57 | | |||
58 | property int wheelDelta: 0 | 58 | property int wheelDelta: 0 | ||
59 | 59 | | |||
60 | anchors.fill: parent | 60 | anchors.fill: parent | ||
61 | acceptedButtons: Qt.NoButton | 61 | acceptedButtons: Qt.NoButton | ||
62 | 62 | | |||
63 | hoverEnabled: true | 63 | hoverEnabled: true | ||
64 | 64 | | |||
▲ Show 20 Lines • Show All 232 Lines • ▼ Show 20 Line(s) | 229 | Grid { | |||
297 | 297 | | |||
298 | Repeater { | 298 | Repeater { | ||
299 | id: repeater | 299 | id: repeater | ||
300 | model: pagerModel | 300 | model: pagerModel | ||
301 | 301 | | |||
302 | PlasmaCore.ToolTipArea { | 302 | PlasmaCore.ToolTipArea { | ||
303 | id: desktop | 303 | id: desktop | ||
304 | 304 | | |||
305 | property int desktopId: index | 305 | property string desktopId: isActivityPager ? model.TasksModel.activity : model.TasksModel.virtualDesktop | ||
306 | property bool active: (index == pagerModel.currentPage) | 306 | property bool active: (index == pagerModel.currentPage) | ||
307 | 307 | | |||
308 | mainText: model.display | 308 | mainText: model.display | ||
309 | // our ToolTip has maximumLineCount of 8 which doesn't fit but QML doesn't | 309 | // our ToolTip has maximumLineCount of 8 which doesn't fit but QML doesn't | ||
310 | // respect that in RichText so we effectively can put in as much as we like :) | 310 | // respect that in RichText so we effectively can put in as much as we like :) | ||
311 | // it also gives us more flexibility when it comes to styling the <li> | 311 | // it also gives us more flexibility when it comes to styling the <li> | ||
312 | textFormat: Text.RichText | 312 | textFormat: Text.RichText | ||
313 | 313 | | |||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 383 | DropArea { | |||
385 | anchors.fill: parent | 385 | anchors.fill: parent | ||
386 | preventStealing: true | 386 | preventStealing: true | ||
387 | 387 | | |||
388 | onDragEnter: { | 388 | onDragEnter: { | ||
389 | root.dragSwitchDesktopId = desktop.desktopId; | 389 | root.dragSwitchDesktopId = desktop.desktopId; | ||
390 | dragTimer.start(); | 390 | dragTimer.start(); | ||
391 | } | 391 | } | ||
392 | onDragLeave: { | 392 | onDragLeave: { | ||
393 | root.dragSwitchDesktopId = -1; | 393 | root.dragSwitchDesktopId = ""; | ||
394 | dragTimer.stop(); | 394 | dragTimer.stop(); | ||
395 | } | 395 | } | ||
396 | onDrop: { | 396 | onDrop: { | ||
397 | pagerModel.drop(event.mimeData, desktop.desktopId); | 397 | pagerModel.drop(event.mimeData, desktop.desktopId); | ||
398 | root.dragSwitchDesktopId = -1; | 398 | root.dragSwitchDesktopId = -1; | ||
399 | dragTimer.stop(); | 399 | dragTimer.stop(); | ||
400 | } | 400 | } | ||
401 | } | 401 | } | ||
402 | 402 | | |||
403 | MouseArea { | 403 | MouseArea { | ||
404 | id: desktopMouseArea | 404 | id: desktopMouseArea | ||
405 | anchors.fill: parent | 405 | anchors.fill: parent | ||
406 | hoverEnabled : true | 406 | hoverEnabled : true | ||
407 | onClicked: pagerModel.changePage(desktopId); | 407 | onClicked: pagerModel.changePage(index); | ||
408 | } | 408 | } | ||
409 | 409 | | |||
410 | Item { | 410 | Item { | ||
411 | id: clipRect | 411 | id: clipRect | ||
412 | x: Math.round(units.devicePixelRatio) | 412 | x: Math.round(units.devicePixelRatio) | ||
413 | y: Math.round(units.devicePixelRatio) | 413 | y: Math.round(units.devicePixelRatio) | ||
414 | width: desktop.width - 2 * x | 414 | width: desktop.width - 2 * x | ||
415 | height: desktop.height - 2 * y | 415 | height: desktop.height - 2 * y | ||
416 | 416 | | |||
417 | z: 1 // Between optional label item and FrameSvg | 417 | z: 1 // Between optional label item and FrameSvg | ||
418 | 418 | | |||
419 | Repeater { | 419 | Repeater { | ||
420 | id: windowRectRepeater | 420 | id: windowRectRepeater | ||
421 | 421 | | |||
422 | model: TasksModel | 422 | model: TasksModel | ||
423 | 423 | | |||
424 | onCountChanged: desktop.updateSubText() | 424 | onCountChanged: desktop.updateSubText() | ||
425 | 425 | | |||
426 | Rectangle { | 426 | Rectangle { | ||
427 | id: windowRect | 427 | id: windowRect | ||
428 | 428 | | |||
429 | z: 1 + model.StackingOrder | 429 | z: 1 + model.StackingOrder | ||
430 | 430 | | |||
431 | property rect geometry: model.Geometry | 431 | property rect geometry: model.Geometry | ||
432 | property int windowId: model.LegacyWinIdList[0] | 432 | property int windowId: model.WinIdList[0] | ||
433 | property string visibleName: model.display | 433 | property string visibleName: model.display | ||
434 | property bool minimized: (model.IsMinimized === true) | 434 | property bool minimized: (model.IsMinimized === true) | ||
435 | onMinimizedChanged: desktop.updateSubText() | 435 | onMinimizedChanged: desktop.updateSubText() | ||
436 | onVisibleNameChanged: desktop.updateSubText() | 436 | onVisibleNameChanged: desktop.updateSubText() | ||
437 | 437 | | |||
438 | /* since we move clipRect with 1, move it back */ | 438 | /* since we move clipRect with 1, move it back */ | ||
439 | x: (geometry.x * pagerItemGrid.widthScaleFactor) - Math.round(units.devicePixelRatio) | 439 | x: (geometry.x * pagerItemGrid.widthScaleFactor) - Math.round(units.devicePixelRatio) | ||
440 | y: (geometry.y * pagerItemGrid.heightScaleFactor) - Math.round(units.devicePixelRatio) | 440 | y: (geometry.y * pagerItemGrid.heightScaleFactor) - Math.round(units.devicePixelRatio) | ||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |