Commit 5975cd95 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

effects: Make setting WindowHeap layout mode nicer

Expose only the layout object and set its mode using "layout.mode:"
syntax rather than expose the layout object and its properties in the
WindowHeap.
parent 6fa6c3f2
Pipeline #197903 passed with stage
in 11 minutes and 42 seconds
......@@ -104,7 +104,7 @@ DropArea {
absolutePositioning: false
animationEnabled: container.animationEnabled
organized: container.organized
layout: effect.layout
layout.mode: effect.layout
model: KWinComponents.ClientFilterModel {
activity: KWinComponents.Workspace.currentActivity
desktop: desktopView.desktop
......
......@@ -184,7 +184,7 @@ FocusScope {
id: heap
visible: !(container.organized && searchField.text)
anchors.fill: parent
layout: effect.layout
layout.mode: effect.layout
padding: PlasmaCore.Units.largeSpacing
animationDuration: effect.animationDuration
animationEnabled: container.animationEnabled
......@@ -210,11 +210,11 @@ FocusScope {
windowHeap: heap
targetScale: {
var localPressPosition = dragHandler.centroid.scenePressPosition.y - heap.expoLayout.Kirigami.ScenePosition.y;
var localPressPosition = dragHandler.centroid.scenePressPosition.y - heap.layout.Kirigami.ScenePosition.y;
if (localPressPosition == 0) {
return 0.1
} else {
var localPosition = dragHandler.centroid.scenePosition.y - heap.expoLayout.Kirigami.ScenePosition.y;
var localPosition = dragHandler.centroid.scenePosition.y - heap.layout.Kirigami.ScenePosition.y;
return Math.max(0.1, Math.min(localPosition / localPressPosition, 1))
}
}
......
......@@ -24,8 +24,7 @@ FocusScope {
property alias model: windowsRepeater.model
property alias delegate: windowsRepeater.delegate
property alias layout: expoLayout.mode
property alias expoLayout: expoLayout
property alias layout: expoLayout
property int selectedIndex: -1
property int animationDuration: PlasmaCore.Units.longDuration
property bool animationEnabled: false
......
......@@ -178,10 +178,10 @@ Item {
ExpoCell {
id: cell
layout: windowHeap.expoLayout
layout: windowHeap.layout
enabled: !thumb.hidden
naturalX: thumb.client.x - targetScreen.geometry.x - windowHeap.expoLayout.Kirigami.ScenePosition.x
naturalY: thumb.client.y - targetScreen.geometry.y - windowHeap.expoLayout.Kirigami.ScenePosition.y
naturalX: thumb.client.x - targetScreen.geometry.x - windowHeap.layout.Kirigami.ScenePosition.x
naturalY: thumb.client.y - targetScreen.geometry.y - windowHeap.layout.Kirigami.ScenePosition.y
naturalWidth: thumb.client.width
naturalHeight: thumb.client.height
persistentKey: thumb.client.internalId
......@@ -193,8 +193,8 @@ Item {
name: "initial"
PropertyChanges {
target: thumb
x: thumb.client.x - targetScreen.geometry.x - (thumb.windowHeap.absolutePositioning ? windowHeap.expoLayout.Kirigami.ScenePosition.x : 0)
y: thumb.client.y - targetScreen.geometry.y - (thumb.windowHeap.absolutePositioning ? windowHeap.expoLayout.Kirigami.ScenePosition.y : 0)
x: thumb.client.x - targetScreen.geometry.x - (thumb.windowHeap.absolutePositioning ? windowHeap.layout.Kirigami.ScenePosition.x : 0)
y: thumb.client.y - targetScreen.geometry.y - (thumb.windowHeap.absolutePositioning ? windowHeap.layout.Kirigami.ScenePosition.y : 0)
width: thumb.client.width
height: thumb.client.height
}
......@@ -211,8 +211,8 @@ Item {
name: "partial"
PropertyChanges {
target: thumb
x: (thumb.client.x - targetScreen.geometry.x - (thumb.windowHeap.absolutePositioning ? windowHeap.expoLayout.Kirigami.ScenePosition.x : 0)) * (1 - effect.partialActivationFactor) + cell.x * effect.partialActivationFactor
y: (thumb.client.y - targetScreen.geometry.y - (thumb.windowHeap.absolutePositioning ? windowHeap.expoLayout.Kirigami.ScenePosition.y : 0)) * (1 - effect.partialActivationFactor) + cell.y * effect.partialActivationFactor
x: (thumb.client.x - targetScreen.geometry.x - (thumb.windowHeap.absolutePositioning ? windowHeap.layout.Kirigami.ScenePosition.x : 0)) * (1 - effect.partialActivationFactor) + cell.x * effect.partialActivationFactor
y: (thumb.client.y - targetScreen.geometry.y - (thumb.windowHeap.absolutePositioning ? windowHeap.layout.Kirigami.ScenePosition.y : 0)) * (1 - effect.partialActivationFactor) + cell.y * effect.partialActivationFactor
width: thumb.client.width * (1 - effect.partialActivationFactor) + cell.width * effect.partialActivationFactor
height: thumb.client.height * (1 - effect.partialActivationFactor) + cell.height * effect.partialActivationFactor
opacity: thumb.client.minimized ? effect.partialActivationFactor : 1
......
......@@ -123,7 +123,7 @@ Item {
animationEnabled: container.animationEnabled
organized: container.organized
showOnly: container.effect.mode === WindowView.ModeWindowClass ? "activeClass" : selectedIds
layout: effect.layout
layout.mode: effect.layout
onWindowClicked: {
if (eventPoint.event.button !== Qt.MiddleButton) {
return;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment