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 226 Lines • ▼ Show 20 Line(s) | 223 | Grid { | |||
291 | 291 | | |||
292 | Repeater { | 292 | Repeater { | ||
293 | id: repeater | 293 | id: repeater | ||
294 | model: pagerModel | 294 | model: pagerModel | ||
295 | 295 | | |||
296 | PlasmaCore.ToolTipArea { | 296 | PlasmaCore.ToolTipArea { | ||
297 | id: desktop | 297 | id: desktop | ||
298 | 298 | | |||
299 | property int desktopId: index | 299 | property string desktopId: isActivityPager ? model.TasksModel.activity : model.TasksModel.virtualDesktop | ||
300 | property bool active: (index == pagerModel.currentPage) | 300 | property bool active: (index == pagerModel.currentPage) | ||
301 | 301 | | |||
302 | mainText: model.display | 302 | mainText: model.display | ||
303 | // our ToolTip has maximumLineCount of 8 which doesn't fit but QML doesn't | 303 | // our ToolTip has maximumLineCount of 8 which doesn't fit but QML doesn't | ||
304 | // respect that in RichText so we effectively can put in as much as we like :) | 304 | // respect that in RichText so we effectively can put in as much as we like :) | ||
305 | // it also gives us more flexibility when it comes to styling the <li> | 305 | // it also gives us more flexibility when it comes to styling the <li> | ||
306 | textFormat: Text.RichText | 306 | textFormat: Text.RichText | ||
307 | 307 | | |||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 377 | DropArea { | |||
379 | anchors.fill: parent | 379 | anchors.fill: parent | ||
380 | preventStealing: true | 380 | preventStealing: true | ||
381 | 381 | | |||
382 | onDragEnter: { | 382 | onDragEnter: { | ||
383 | root.dragSwitchDesktopId = desktop.desktopId; | 383 | root.dragSwitchDesktopId = desktop.desktopId; | ||
384 | dragTimer.start(); | 384 | dragTimer.start(); | ||
385 | } | 385 | } | ||
386 | onDragLeave: { | 386 | onDragLeave: { | ||
387 | root.dragSwitchDesktopId = -1; | 387 | root.dragSwitchDesktopId = ""; | ||
388 | dragTimer.stop(); | 388 | dragTimer.stop(); | ||
389 | } | 389 | } | ||
390 | onDrop: { | 390 | onDrop: { | ||
391 | pagerModel.drop(event.mimeData, desktop.desktopId); | 391 | pagerModel.drop(event.mimeData, desktop.desktopId); | ||
392 | root.dragSwitchDesktopId = -1; | 392 | root.dragSwitchDesktopId = -1; | ||
393 | dragTimer.stop(); | 393 | dragTimer.stop(); | ||
394 | } | 394 | } | ||
395 | } | 395 | } | ||
396 | 396 | | |||
397 | MouseArea { | 397 | MouseArea { | ||
398 | id: desktopMouseArea | 398 | id: desktopMouseArea | ||
399 | anchors.fill: parent | 399 | anchors.fill: parent | ||
400 | hoverEnabled : true | 400 | hoverEnabled : true | ||
401 | onClicked: pagerModel.changePage(desktopId); | 401 | onClicked: pagerModel.changePage(index); | ||
402 | } | 402 | } | ||
403 | 403 | | |||
404 | Item { | 404 | Item { | ||
405 | id: clipRect | 405 | id: clipRect | ||
406 | x: Math.round(units.devicePixelRatio) | 406 | x: Math.round(units.devicePixelRatio) | ||
407 | y: Math.round(units.devicePixelRatio) | 407 | y: Math.round(units.devicePixelRatio) | ||
408 | width: desktop.width - 2 * x | 408 | width: desktop.width - 2 * x | ||
409 | height: desktop.height - 2 * y | 409 | height: desktop.height - 2 * y | ||
410 | 410 | | |||
411 | z: 1 // Between optional label item and FrameSvg | 411 | z: 1 // Between optional label item and FrameSvg | ||
412 | 412 | | |||
413 | Repeater { | 413 | Repeater { | ||
414 | id: windowRectRepeater | 414 | id: windowRectRepeater | ||
415 | 415 | | |||
416 | model: TasksModel | 416 | model: TasksModel | ||
417 | 417 | | |||
418 | onCountChanged: desktop.updateSubText() | 418 | onCountChanged: desktop.updateSubText() | ||
419 | 419 | | |||
420 | Rectangle { | 420 | Rectangle { | ||
421 | id: windowRect | 421 | id: windowRect | ||
422 | 422 | | |||
423 | z: 1 + model.StackingOrder | 423 | z: 1 + model.StackingOrder | ||
424 | 424 | | |||
425 | property rect geometry: model.Geometry | 425 | property rect geometry: model.Geometry | ||
426 | property int windowId: model.LegacyWinIdList[0] | 426 | property int windowId: model.WinIdList[0] | ||
427 | property string visibleName: model.display | 427 | property string visibleName: model.display | ||
428 | property bool minimized: (model.IsMinimized === true) | 428 | property bool minimized: (model.IsMinimized === true) | ||
429 | onMinimizedChanged: desktop.updateSubText() | 429 | onMinimizedChanged: desktop.updateSubText() | ||
430 | onVisibleNameChanged: desktop.updateSubText() | 430 | onVisibleNameChanged: desktop.updateSubText() | ||
431 | 431 | | |||
432 | /* since we move clipRect with 1, move it back */ | 432 | /* since we move clipRect with 1, move it back */ | ||
433 | x: (geometry.x * pagerItemGrid.widthScaleFactor) - Math.round(units.devicePixelRatio) | 433 | x: (geometry.x * pagerItemGrid.widthScaleFactor) - Math.round(units.devicePixelRatio) | ||
434 | y: (geometry.y * pagerItemGrid.heightScaleFactor) - Math.round(units.devicePixelRatio) | 434 | y: (geometry.y * pagerItemGrid.heightScaleFactor) - Math.round(units.devicePixelRatio) | ||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |