mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2025-12-05 22:26:16 +00:00
autofmt
This commit is contained in:
@@ -120,7 +120,7 @@ RowLayout {
|
|||||||
width: ListView.view ? ListView.view.width : (parentComboBox ? parentComboBox.width - Style.marginM * 3 : 0)
|
width: ListView.view ? ListView.view.width : (parentComboBox ? parentComboBox.width - Style.marginM * 3 : 0)
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
highlighted: ListView.view.currentIndex === itemIndex
|
highlighted: ListView.view.currentIndex === itemIndex
|
||||||
|
|
||||||
property bool pendingClick: false
|
property bool pendingClick: false
|
||||||
Timer {
|
Timer {
|
||||||
id: clickRetryTimer
|
id: clickRetryTimer
|
||||||
|
|||||||
@@ -112,37 +112,37 @@ Item {
|
|||||||
ListView {
|
ListView {
|
||||||
id: listView
|
id: listView
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
anchors.rightMargin: root.verticalScrollBarActive ? root.handleWidth + 4 : 0
|
anchors.rightMargin: root.verticalScrollBarActive ? root.handleWidth + 4 : 0
|
||||||
clip: true
|
clip: true
|
||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
flickDeceleration: 1500
|
flickDeceleration: 1500
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: scrollbarActiveTimer
|
id: scrollbarActiveTimer
|
||||||
interval: 150
|
interval: 150
|
||||||
repeat: false
|
repeat: false
|
||||||
}
|
}
|
||||||
|
|
||||||
WheelHandler {
|
WheelHandler {
|
||||||
id: wheelHandler
|
id: wheelHandler
|
||||||
target: listView
|
target: listView
|
||||||
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||||
|
|
||||||
onWheel: function(event) {
|
onWheel: function (event) {
|
||||||
if (listView.flicking || listView.moving) {
|
if (listView.flicking || listView.moving) {
|
||||||
listView.cancelFlick();
|
listView.cancelFlick();
|
||||||
}
|
}
|
||||||
|
|
||||||
var delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y : (event.angleDelta.y / 8);
|
var delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y : (event.angleDelta.y / 8);
|
||||||
var newContentY = listView.contentY - delta;
|
var newContentY = listView.contentY - delta;
|
||||||
newContentY = Math.max(0, Math.min(newContentY, listView.contentHeight - listView.height));
|
newContentY = Math.max(0, Math.min(newContentY, listView.contentHeight - listView.height));
|
||||||
listView.contentY = newContentY;
|
listView.contentY = newContentY;
|
||||||
|
|
||||||
if (listView.ScrollBar.vertical) {
|
if (listView.ScrollBar.vertical) {
|
||||||
listView.ScrollBar.vertical.active = true;
|
listView.ScrollBar.vertical.active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollbarActiveTimer.restart();
|
scrollbarActiveTimer.restart();
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user