forked from qt-creator/qt-creator
QmlProfiler: Center trace view vertically around newly selected items
It's rather unintuitive if it only centers horizontally. Change-Id: I9245da0b26fccc14a100804715d09aaa82059413 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -141,6 +141,13 @@ Rectangle {
|
||||
recenter((qmlProfilerModelProxy.startTime(modelIndex, itemIndex) +
|
||||
qmlProfilerModelProxy.endTime(modelIndex, itemIndex)) / 2);
|
||||
}
|
||||
var row = qmlProfilerModelProxy.row(modelIndex, itemIndex);
|
||||
var totalRowOffset = qmlProfilerModelProxy.modelOffset(modelIndex) +
|
||||
qmlProfilerModelProxy.rowOffset(modelIndex, row);
|
||||
if (totalRowOffset > flick.contentY + flick.height ||
|
||||
totalRowOffset + qmlProfilerModelProxy.rowHeight(modelIndex, row) < flick.contentY)
|
||||
flick.contentY = Math.min(flick.contentHeight - flick.height,
|
||||
Math.max(0, totalRowOffset - flick.height / 2));
|
||||
}
|
||||
|
||||
function hideRangeDetails() {
|
||||
|
||||
Reference in New Issue
Block a user