mirror of https://code.videolan.org/videolan/vlc
qml: fix qt6 parameters injection warning from MouseArea
This commit is contained in:
parent
c12cb47d0a
commit
d34c08723d
|
@ -78,7 +78,7 @@ Control {
|
|||
}
|
||||
}
|
||||
|
||||
onPressed: {
|
||||
onPressed: (mouse) => {
|
||||
const pos = mapToItem(control.contentItem.target.parent, mouseX, mouseY)
|
||||
control.contentItem.target.y = pos.y + VLCStyle.dragDelta
|
||||
control.contentItem.target.x = pos.x + VLCStyle.dragDelta
|
||||
|
|
|
@ -159,7 +159,7 @@ GridView {
|
|||
}
|
||||
}
|
||||
|
||||
onPressed: {
|
||||
onPressed: (mouse) => {
|
||||
const pos = mapToItem(buttonDragItem.parent, mouseX, mouseY)
|
||||
buttonDragItem.y = pos.y + VLCStyle.dragDelta
|
||||
buttonDragItem.x = pos.x + VLCStyle.dragDelta
|
||||
|
|
|
@ -118,19 +118,19 @@ T.ItemDelegate {
|
|||
}
|
||||
}
|
||||
|
||||
onClicked: function(mouse) {
|
||||
onClicked: (mouse) => {
|
||||
if (!(root.selected && mouse.button === Qt.RightButton)) {
|
||||
view.selectionModel.updateSelection(mouse.modifiers, view.currentIndex, index)
|
||||
view.currentIndex = index
|
||||
}
|
||||
}
|
||||
|
||||
onDoubleClicked: function(mouse) {
|
||||
onDoubleClicked: (mouse) => {
|
||||
if (mouse.button !== Qt.RightButton)
|
||||
MediaLib.addAndPlay(model.id);
|
||||
}
|
||||
|
||||
onPressed: {
|
||||
onPressed: (mouse) => {
|
||||
root.forceActiveFocus(Qt.MouseFocusReason)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -241,7 +241,7 @@ ColumnLayout {
|
|||
|
||||
acceptedButtons: Qt.LeftButton
|
||||
|
||||
onPressed: {
|
||||
onPressed: (mouse) => {
|
||||
mouse.accepted = false
|
||||
|
||||
root._shiftPressed = (mouse.modifiers === Qt.ShiftModifier)
|
||||
|
|
|
@ -360,7 +360,7 @@ FocusScope {
|
|||
|
||||
visible: !rootPlayer.hasEmbededVideo
|
||||
|
||||
onWheel: {
|
||||
onWheel: (wheel) => {
|
||||
if (rootPlayer.hasEmbededVideo) {
|
||||
wheel.accepted = false
|
||||
|
||||
|
|
|
@ -229,11 +229,11 @@ Slider {
|
|||
|
||||
preventStealing: true
|
||||
|
||||
onPressed: fsm.pressControl(mouse.x / width, mouse.modifiers === Qt.ShiftModifier)
|
||||
onPressed: (mouse) => { fsm.pressControl(mouse.x / width, mouse.modifiers === Qt.ShiftModifier) }
|
||||
|
||||
onReleased: fsm.releaseControl(mouse.x / width, mouse.modifiers === Qt.ShiftModifier)
|
||||
onReleased: (mouse) => { fsm.releaseControl(mouse.x / width, mouse.modifiers === Qt.ShiftModifier) }
|
||||
|
||||
onPositionChanged: fsm.moveControl(mouse.x / width, mouse.modifiers === Qt.ShiftModifier)
|
||||
onPositionChanged: (mouse) => { fsm.moveControl(mouse.x / width, mouse.modifiers === Qt.ShiftModifier) }
|
||||
|
||||
onEntered: {
|
||||
if(Player.hasChapters)
|
||||
|
|
|
@ -173,7 +173,7 @@ T.Control {
|
|||
}
|
||||
}
|
||||
|
||||
onPressed: {
|
||||
onPressed: (mouse) => {
|
||||
if (!cursorInside) {
|
||||
mouse.accepted = false
|
||||
return
|
||||
|
@ -182,12 +182,12 @@ T.Control {
|
|||
root.forceActiveFocus(Qt.MouseFocusReason)
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
onClicked: (mouse) => {
|
||||
MainPlaylistController.togglePlayPause()
|
||||
mouse.accepted = true
|
||||
}
|
||||
|
||||
onPressAndHold: {
|
||||
onPressAndHold: (mouse) => {
|
||||
_pressAndHoldAction()
|
||||
mouse.accepted = true
|
||||
}
|
||||
|
|
|
@ -238,7 +238,7 @@ T.Pane {
|
|||
|
||||
anchors.margins: -(VLCStyle.dp(4, VLCStyle.scale))
|
||||
|
||||
onPressed: {
|
||||
onPressed: (mouse) => {
|
||||
mouse.accepted = false
|
||||
|
||||
if (mouse.modifiers === Qt.ShiftModifier)
|
||||
|
@ -256,7 +256,7 @@ T.Pane {
|
|||
|
||||
acceptedButtons: (Qt.LeftButton | Qt.RightButton)
|
||||
|
||||
onPressed: {
|
||||
onPressed: (mouse) => {
|
||||
if (root.paintOnly) {
|
||||
mouse.accepted = true
|
||||
return
|
||||
|
@ -273,9 +273,12 @@ T.Pane {
|
|||
adjustVolume(mouse)
|
||||
}
|
||||
|
||||
onPositionChanged: if (mouse.buttons & Qt.RightButton) adjustVolume(mouse)
|
||||
onPositionChanged: (mouse) => {
|
||||
if (mouse.buttons & Qt.RightButton)
|
||||
adjustVolume(mouse)
|
||||
}
|
||||
|
||||
onWheel: {
|
||||
onWheel: (wheel) => {
|
||||
let delta = 0, fineControl = false
|
||||
|
||||
if ((Math.abs(wheel.pixelDelta.x) % 120 > 0) || (Math.abs(wheel.pixelDelta.y) % 120 > 0)) {
|
||||
|
|
|
@ -245,7 +245,7 @@ T.ItemDelegate {
|
|||
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
|
||||
onClicked: {
|
||||
onClicked: (mouse) => {
|
||||
/* to receive keys events */
|
||||
if (!(delegate.selected && mouse.button === Qt.RightButton)) {
|
||||
view.selectionModel.updateSelection(mouse.modifiers, view.currentIndex, index)
|
||||
|
@ -256,12 +256,12 @@ T.ItemDelegate {
|
|||
contextMenu.popup(index, this.mapToGlobal(mouse.x, mouse.y))
|
||||
}
|
||||
|
||||
onDoubleClicked: {
|
||||
onDoubleClicked: (mouse) => {
|
||||
if (mouse.button !== Qt.RightButton)
|
||||
MainPlaylistController.goTo(index, true)
|
||||
}
|
||||
|
||||
onPressed: {
|
||||
onPressed: (mouse) => {
|
||||
delegate.forceActiveFocus(Qt.MouseFocusReason)
|
||||
}
|
||||
|
||||
|
|
|
@ -634,7 +634,7 @@ FocusScope {
|
|||
preventStealing: true
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
|
||||
onPressed: {
|
||||
onPressed: (mouse) => {
|
||||
Helpers.enforceFocus(flickable, Qt.MouseFocusReason)
|
||||
|
||||
if (!(mouse.modifiers & (Qt.ShiftModifier | Qt.ControlModifier))) {
|
||||
|
@ -643,7 +643,7 @@ FocusScope {
|
|||
}
|
||||
}
|
||||
|
||||
onReleased: {
|
||||
onReleased: (mouse) => {
|
||||
if (mouse.button & Qt.RightButton) {
|
||||
root.showContextMenu(mapToGlobal(mouse.x, mouse.y))
|
||||
}
|
||||
|
|
|
@ -188,7 +188,7 @@ T.ItemDelegate {
|
|||
|
||||
drag.smoothed: false
|
||||
|
||||
onClicked: {
|
||||
onClicked: (mouse) => {
|
||||
if (mouse.button === Qt.RightButton)
|
||||
contextMenuButtonClicked(picture, root.mapToGlobal(mouse.x,mouse.y));
|
||||
else {
|
||||
|
@ -196,12 +196,12 @@ T.ItemDelegate {
|
|||
}
|
||||
}
|
||||
|
||||
onDoubleClicked: {
|
||||
onDoubleClicked: (mouse) => {
|
||||
if (mouse.button === Qt.LeftButton)
|
||||
root.itemDoubleClicked(picture,mouse.buttons, mouse.modifiers)
|
||||
}
|
||||
|
||||
onPressed: {
|
||||
onPressed: (mouse) => {
|
||||
_modifiersOnLastPress = mouse.modifiers
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ T.ItemDelegate {
|
|||
Layout.preferredWidth: pictureWidth
|
||||
Layout.preferredHeight: pictureHeight
|
||||
|
||||
onPlayIconClicked: {
|
||||
onPlayIconClicked: (mouse) => {
|
||||
// emulate a mouse click before delivering the play signal as to select the item
|
||||
// this helps in updating the selection and restore of initial index in the parent views
|
||||
root.itemClicked(picture, mouse.button, mouse.modifiers)
|
||||
|
|
|
@ -42,12 +42,12 @@ MouseArea {
|
|||
width: VLCStyle.dp(8, VLCStyle.scale)
|
||||
acceptedButtons: Qt.LeftButton
|
||||
|
||||
onPressed: {
|
||||
onPressed: (mouse) => {
|
||||
MainCtx.setCursor(cursorShape)
|
||||
_previousX = mouseX
|
||||
}
|
||||
|
||||
onReleased: {
|
||||
onReleased:(mouse) => {
|
||||
MainCtx.restoreCursor()
|
||||
}
|
||||
|
||||
|
|
|
@ -314,7 +314,7 @@ ListView {
|
|||
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
|
||||
onPressed: {
|
||||
onPressed: (mouse) => {
|
||||
focus = true // Grab the focus from delegate
|
||||
root.forceActiveFocus(Qt.MouseFocusReason) // Re-focus the list
|
||||
|
||||
|
@ -326,7 +326,7 @@ ListView {
|
|||
mouse.accepted = true
|
||||
}
|
||||
|
||||
onReleased: {
|
||||
onReleased: (mouse) => {
|
||||
if (mouse.button & Qt.RightButton) {
|
||||
root.showContextMenu(mapToGlobal(mouse.x, mouse.y))
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ Rectangle {
|
|||
sourceComponent: Widgets.PlayCover {
|
||||
width: playIconSize
|
||||
|
||||
onClicked: playIconClicked(mouse)
|
||||
onClicked: (mouse) => playIconClicked(mouse)
|
||||
}
|
||||
|
||||
asynchronous: true
|
||||
|
|
|
@ -127,11 +127,11 @@ T.Control {
|
|||
|
||||
// Events
|
||||
|
||||
onPressed: {
|
||||
onPressed: (mouse) => {
|
||||
_modifiersOnLastPress = mouse.modifiers
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
onClicked: (mouse) => {
|
||||
if ((mouse.button === Qt.LeftButton) || !delegate.selected) {
|
||||
delegate.selectAndFocus(mouse.modifiers, Qt.MouseFocusReason)
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ T.Control {
|
|||
delegate.rightClick(delegate, delegate.rowModel, hoverArea.mapToGlobal(mouse.x, mouse.y))
|
||||
}
|
||||
|
||||
onDoubleClicked: {
|
||||
onDoubleClicked: (mouse) => {
|
||||
if (mouse.button === Qt.LeftButton)
|
||||
delegate.itemDoubleClicked(delegate._index, delegate.rowModel)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue