Spracherkennung für: .qml vermutete Sprache: Delphi {Delphi[48] SPS[42] C[36]} [Methode: maximale Elemente, drei Dimensionen]
/*****************************************************************************
* Copyright (C) 2020 VLC authors and VideoLAN
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* ( at your option ) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
import QtQuick
import VLC.MainInterface
import VLC.Style
import VLC.Util
// targetWidth: concerned widget's current width
// HorizontalResizeHandle actually doesn't resizes target
// you have to assign target's width manually using requestedWidth property
// e.g target.width: Helpers.clamp(requestedWidth, minimumWidth, maximumWidth)
MouseArea {
id: root
required property int currentWidth
property int requestedWidth: 0
property int minimumWidth: 0
property int maximumWidth: Number.MAX_SAFE_INTEGER
property bool atRight: true
property int _previousX
cursorShape: Qt.SplitHCursor
width: VLCStyle.resizeHandleWidth
acceptedButtons: Qt.LeftButton
preventStealing: true
onPressed: (mouse) => {
MainCtx.setCursor(cursorShape)
_previousX = mouseX
}
onReleased:(mouse) => {
MainCtx.restoreCursor()
}
onCanceled: {
MainCtx.restoreCursor()
}
onPositionChanged: {
const f = atRight ? 1 : -1
const delta = mouseX - _previousX
root.requestedWidth = Helpers.clamp(
root.currentWidth + (delta * f),
minimumWidth,
maximumWidth)
}
}
[Dauer der Verarbeitung: 0.3 Sekunden, vorverarbeitet 2026-10-24]