mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
try to replace the flickable with a custom implementation
This commit is contained in:
parent
3f515a3c16
commit
4ab220ed06
1 changed files with 15 additions and 15 deletions
|
|
@ -18,7 +18,7 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import QtQuick 2.6
|
import QtQuick 2.7
|
||||||
import QtGraphicalEffects 1.0
|
import QtGraphicalEffects 1.0
|
||||||
import QtQuick.Controls 2.3
|
import QtQuick.Controls 2.3
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
|
|
@ -50,16 +50,16 @@ Item {
|
||||||
velocity: width
|
velocity: width
|
||||||
easing.type: Easing.InOutQuad
|
easing.type: Easing.InOutQuad
|
||||||
}
|
}
|
||||||
Flickable {
|
MouseArea {
|
||||||
id: activitiesView
|
id: activitiesView
|
||||||
z: 99
|
z: 99
|
||||||
visible: root.containment
|
visible: root.containment
|
||||||
interactive: true
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
contentWidth: activitiesLayout.width
|
drag.filterChildren: true
|
||||||
contentHeight: height
|
drag.target: activitiesLayout
|
||||||
boundsBehavior: Flickable.StopAtBounds
|
drag.axis: Drag.XAxis
|
||||||
maximumFlickVelocity: width/5
|
drag.minimumX: -activitiesLayout.width + width
|
||||||
|
drag.maximumX: 0
|
||||||
property int currentIndex: -1
|
property int currentIndex: -1
|
||||||
|
|
||||||
onCurrentIndexChanged: {
|
onCurrentIndexChanged: {
|
||||||
|
|
@ -71,12 +71,12 @@ Item {
|
||||||
switchAnim.to = currentIndex * width;
|
switchAnim.to = currentIndex * width;
|
||||||
switchAnim.running = true;
|
switchAnim.running = true;
|
||||||
}
|
}
|
||||||
onFlickEnded: movementEnded();
|
/* onFlickEnded: movementEnded();
|
||||||
onMovementEnded: {
|
onMovementEnded: {
|
||||||
currentIndex = Math.round(contentX / width);
|
currentIndex = Math.round(contentX / width);
|
||||||
//be sure the animation will work
|
//be sure the animation will work
|
||||||
currentIndexChanged();
|
currentIndexChanged();
|
||||||
}
|
}*/
|
||||||
//don't animate
|
//don't animate
|
||||||
onWidthChanged: contentX = currentIndex * width;
|
onWidthChanged: contentX = currentIndex * width;
|
||||||
|
|
||||||
|
|
@ -101,10 +101,10 @@ Item {
|
||||||
height: activitiesView.height
|
height: activitiesView.height
|
||||||
property Item containment
|
property Item containment
|
||||||
readonly property bool inViewport: activitiesLayout.loadCompleted && root.containment &&
|
readonly property bool inViewport: activitiesLayout.loadCompleted && root.containment &&
|
||||||
((x >= activitiesView.contentX &&
|
((x >= -activitiesLayout.x &&
|
||||||
x < activitiesView.contentX + activitiesView.width) ||
|
x < -activitiesLayout.x + activitiesView.width) ||
|
||||||
(x + width > activitiesView.contentX &&
|
(x + width > -activitiesLayout.x &&
|
||||||
x + width < activitiesView.contentX + activitiesView.width))
|
x + width < -activitiesLayout.x + activitiesView.width))
|
||||||
readonly property bool currentActivity: root.containment && model.current
|
readonly property bool currentActivity: root.containment && model.current
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -136,9 +136,9 @@ Item {
|
||||||
Text {
|
Text {
|
||||||
z: 100
|
z: 100
|
||||||
text: "inViewport: " + mainDelegate.inViewport +
|
text: "inViewport: " + mainDelegate.inViewport +
|
||||||
"\n activitiesView.contentX: " + activitiesView.contentX +
|
"\n -activitiesLayout.x: " + -activitiesLayout.x +
|
||||||
"\n mainDelegate.x: "+ mainDelegate.x +
|
"\n mainDelegate.x: "+ mainDelegate.x +
|
||||||
"\n (activitiesView.contentX + activitiesView.width):"+ (activitiesView.contentX + activitiesView.width) +
|
"\n (-activitiesLayout.x + activitiesView.width):"+ (-activitiesLayout.x + activitiesView.width) +
|
||||||
"\n (mainDelegate.x + mainDelegate.width):" + (mainDelegate.x + mainDelegate.width)
|
"\n (mainDelegate.x + mainDelegate.width):" + (mainDelegate.x + mainDelegate.width)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue