Commit d3c1366f authored by David Edmundson's avatar David Edmundson
Browse files

Use smarter hover activation

See plasma/plasma-workspace!741
parent 70f8d100
......@@ -22,6 +22,7 @@
import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.private.kicker 0.1 as Kicker
FocusScope {
id: appViewContainer
......@@ -68,37 +69,43 @@ FocusScope {
}
}
KickoffListView {
id: applicationsView
isManagerMode: true
Kicker.TriangleMouseFilter {
anchors.fill: parent
property Item activatedItem: null
property var newModel: null
edge: LayoutMirroring.enabled ? Qt.LeftEdge : Qt.RightEdge
Behavior on opacity {
NumberAnimation {
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
KickoffListView {
id: applicationsView
isManagerMode: true
anchors.fill: parent
property Item activatedItem: null
property var newModel: null
Behavior on opacity {
NumberAnimation {
duration: PlasmaCore.Units.longDuration
easing.type: Easing.InOutQuad
}
}
}
focus: true
focus: true
appView: true
appView: true
model: rootModel
model: rootModel
function moveRight() {
var childModel = activatedItem.activate()
if (childModel != null) {
appViewContainer.activatedSection = childModel.model
appViewContainer.newBreadcrumbName = childModel.name
appViewContainer.appModelChange()
function moveRight() {
var childModel = activatedItem.activate()
if (childModel != null) {
appViewContainer.activatedSection = childModel.model
appViewContainer.newBreadcrumbName = childModel.name
appViewContainer.appModelChange()
}
}
}
onReset: appViewContainer.reset()
onReset: appViewContainer.reset()
}
}
// Displays text when application list gets updated
......
......@@ -113,20 +113,6 @@ FocusScope {
repeat: false
}
Timer {
id: delayedActivation
// interaction time needs to be a constant
interval: 250
repeat: false
property int indexToGoTo: -1
onTriggered: {
if (indexToGoTo !== -1) {
listView.currentIndex = indexToGoTo
indexToGoTo = -1
}
}
}
PC3.ScrollView {
anchors.fill: parent
PC3.ScrollBar.horizontal.visible: false
......@@ -248,13 +234,6 @@ FocusScope {
hoverEnabled: true
acceptedButtons: Qt.LeftButton | Qt.RightButton
onExited: {
if (view.isManagerMode || view.isExternalManagerMode) {
delayedActivation.stop();
delayedActivation.indexToGoTo = -1;
}
}
onPressed: {
var mapped = listView.mapToItem(listView.contentItem, mouse.x, mouse.y);
var item = listView.itemAt(mapped.x, mapped.y);
......@@ -320,12 +299,7 @@ FocusScope {
}
}
if (kickoff.dragSource == null || kickoff.dragSource == item) {
if ((!view.isManagerMode && !view.isExternalManagerMode) || changedIndexRecently.running || mouse.source == Qt.MouseEventSynthesizedByQt) {
listView.currentIndex = item.itemIndex;
} else {
delayedActivation.indexToGoTo = item.itemIndex;
delayedActivation.start()
}
listView.currentIndex = item.itemIndex;
}
}
......
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