Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/AnalyzeView/LogViewer/LogViewerAltChart.qml
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,10 @@ Item {
z: 10
}

// Mouse area — drag to zoom, right-click to reset, click/move to set cursor
// Mouse area — drag to zoom, right-click to reset, hover/click to set cursor
MouseArea {
anchors.fill: parent
hoverEnabled: !ScreenTools.isMobile
acceptedButtons: Qt.LeftButton | Qt.RightButton
z: 11

Expand All @@ -275,6 +276,7 @@ Item {
_zoomRect.width = 0
_zoomRect.height = _altChart.plotArea.height
_zoomRect.visible = true
root._updateCursor(mouse.x)
}

onPositionChanged: (mouse) => {
Expand All @@ -283,6 +285,10 @@ Item {
const right = Math.max(_dragStartX, mouse.x)
_zoomRect.x = left
_zoomRect.width = Math.max(0, right - left)
return
}
if (!pressed) {
root._updateCursor(mouse.x)
}
}

Expand All @@ -291,12 +297,17 @@ Item {
const dragW = _zoomRect.width
_zoomRect.visible = false
if (dragW < ScreenTools.defaultFontPixelWidth * 0.5) {
root._updateCursor(mouse.x)
return
}
const leftX = root._pixelToAxisX(_zoomRect.x)
const rightX = root._pixelToAxisX(_zoomRect.x + _zoomRect.width)
root._applyZoom(Math.min(leftX, rightX), Math.max(leftX, rightX))
root._updateCursor(mouse.x)
}
Comment on lines 297 to +306

onExited: {
_markerVisible = false
root.markerCleared()
}
}

Expand Down
21 changes: 20 additions & 1 deletion src/AnalyzeView/LogViewer/LogViewerChart.qml
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ ColumnLayout {
id: _chartZoomArea
anchors.fill: parent
enabled: _binXAxis.max > _binXAxis.min
hoverEnabled: !ScreenTools.isMobile
acceptedButtons: Qt.LeftButton | Qt.RightButton
z: 1001

Expand All @@ -580,6 +581,7 @@ ColumnLayout {
_zoomSelectionRect.width = 0
_zoomSelectionRect.height = _binChart.plotArea.height
_zoomSelectionRect.visible = true
_updateCursorInfo(mouse.x, mouse.y, width, height)
}

onPositionChanged: (mouse) => {
Expand All @@ -588,6 +590,10 @@ ColumnLayout {
const right = Math.max(_dragStartX, mouse.x)
_zoomSelectionRect.x = left
_zoomSelectionRect.width = Math.max(0, right - left)
return
}
if (!pressed) {
_updateCursorInfo(mouse.x, mouse.y, width, height)
}
}

Expand All @@ -596,12 +602,16 @@ ColumnLayout {
const dragWidth = _zoomSelectionRect.width
_zoomSelectionRect.visible = false
if (dragWidth < ScreenTools.defaultFontPixelWidth * 0.5) {
_updateCursorInfo(mouse.x, mouse.y, width, height)
return
}
const leftX = _pixelToAxisX(_zoomSelectionRect.x)
const rightX = _pixelToAxisX(_zoomSelectionRect.x + _zoomSelectionRect.width)
applyZoomRange(Math.min(leftX, rightX), Math.max(leftX, rightX))
_updateCursorInfo(mouse.x, mouse.y, width, height)
}
Comment on lines 602 to +611

onExited: {
_positionMarkerVisible = false
}
}

Expand All @@ -614,6 +624,15 @@ ColumnLayout {
height: _binChart.plotArea.height
color: qgcPal.text
z: 1002

Connections {
target: _binChart
function onPlotAreaChanged() {
if (_positionMarkerVisible) {
_refreshCursorPixelPos()
}
}
}
}

// Value popup
Expand Down
Loading