MainView.qml 19.8 KB
Newer Older
hjk's avatar
hjk committed
1
/****************************************************************************
Kai Koehne's avatar
Kai Koehne committed
2
**
3
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
hjk's avatar
hjk committed
4
** Contact: http://www.qt-project.org/legal
Kai Koehne's avatar
Kai Koehne committed
5
**
hjk's avatar
hjk committed
6
** This file is part of Qt Creator.
Kai Koehne's avatar
Kai Koehne committed
7
**
hjk's avatar
hjk committed
8 9 10 11 12 13 14
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.  For licensing terms and
** conditions see http://qt.digia.com/licensing.  For further information
** use the contact form at http://qt.digia.com/contact-us.
Kai Koehne's avatar
Kai Koehne committed
15 16
**
** GNU Lesser General Public License Usage
hjk's avatar
hjk committed
17 18 19 20 21 22 23 24 25
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights.  These rights are described in the Digia Qt LGPL Exception
Kai Koehne's avatar
Kai Koehne committed
26 27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
hjk's avatar
hjk committed
28
****************************************************************************/
Kai Koehne's avatar
Kai Koehne committed
29

30
import QtQuick 1.0
Christiaan Janssen's avatar
Christiaan Janssen committed
31 32 33 34 35
import Monitor 1.0

Rectangle {
    id: root

36 37 38
    // ***** properties

    property int candidateHeight: 0
39
    property int scrollY: 0
40 41 42
    height: Math.max( candidateHeight, labels.height + 2 )

    property int singleRowHeight: 30
43 44 45 46

    property bool dataAvailable: true
    property int eventCount: 0
    property real progress: 0
Christiaan Janssen's avatar
Christiaan Janssen committed
47

48 49 50
    property alias selectionLocked : view.selectionLocked
    signal updateLockButton
    property alias selectedItem: view.selectedItem
Christiaan Janssen's avatar
Christiaan Janssen committed
51
    signal selectedEventChanged(int eventId)
52
    property bool lockItemSelection : false
53

54 55
    property variant mainviewTimePerPixel : 0

Christiaan Janssen's avatar
Christiaan Janssen committed
56 57 58
    signal updateCursorPosition
    property string fileName: ""
    property int lineNumber: -1
59
    property int columnNumber: 0
60

61 62 63
    signal updateRangeButton
    property bool selectionRangeMode: false

64 65 66 67
    property bool selectionRangeReady: selectionRange.ready
    property variant selectionRangeStart: selectionRange.startTime
    property variant selectionRangeEnd: selectionRange.startTime + selectionRange.duration

68
    signal changeToolTip(string text)
69
    signal updateVerticalScroll(int newPosition)
70

Christiaan Janssen's avatar
Christiaan Janssen committed
71 72 73 74 75
    property bool recordingEnabled: false
    property bool appKilled : false

    property date recordingStartDate
    property real elapsedTime
76

77 78 79 80 81 82 83 84 85 86 87 88 89
    // ***** connections with external objects
    Connections {
        target: zoomControl
        onRangeChanged: {
            var startTime = zoomControl.startTime();
            var endTime = zoomControl.endTime();
            var duration = Math.abs(endTime - startTime);

            mainviewTimePerPixel = duration / root.width;

            backgroundMarks.updateMarks(startTime, endTime);
            view.updateFlickRange(startTime, endTime);
            if (duration > 0) {
Christiaan Janssen's avatar
Christiaan Janssen committed
90
                var candidateWidth = qmlProfilerModelProxy.traceDuration() *
Christiaan Janssen's avatar
Christiaan Janssen committed
91
                        flick.width / duration;
92 93 94 95 96 97 98
                if (flick.contentWidth !== candidateWidth)
                    flick.contentWidth = candidateWidth;
            }

        }
    }

Christiaan Janssen's avatar
Christiaan Janssen committed
99

100
    Connections {
Christiaan Janssen's avatar
Christiaan Janssen committed
101
        target: qmlProfilerModelProxy
102
        onCountChanged: {
Christiaan Janssen's avatar
Christiaan Janssen committed
103
            eventCount = qmlProfilerModelProxy.count();
104 105 106 107
            if (eventCount === 0)
                root.clearAll();
            if (eventCount > 1) {
                root.progress = Math.min(1.0,
Christiaan Janssen's avatar
Christiaan Janssen committed
108 109
                    (qmlProfilerModelProxy.lastTimeMark() -
                    qmlProfilerModelProxy.traceStartTime()) / root.elapsedTime * 1e-9 );
110 111 112 113
            } else {
                root.progress = 0;
            }
        }
114
        onStateChanged: {
Christiaan Janssen's avatar
Christiaan Janssen committed
115
            switch (qmlProfilerModelProxy.getState()) {
116 117 118 119 120 121 122 123 124 125 126 127
            case 0: {
                root.clearAll();
                break;
            }
            case 1: {
                root.dataAvailable = false;
                break;
            }
            case 2: {
                root.progress = 0.9; // jump to 90%
                break;
            }
128 129
            }
        }
Christiaan Janssen's avatar
Christiaan Janssen committed
130 131 132 133 134 135 136 137 138 139 140
        onDataAvailable: {
            view.clearData();
            zoomControl.setRange(0,0);
            progress = 1.0;
            dataAvailable = true;
            view.visible = true;
            view.requestPaint();
            zoomControl.setRange(qmlProfilerModelProxy.traceStartTime(),
                                 qmlProfilerModelProxy.traceStartTime() +
                                 qmlProfilerModelProxy.traceDuration()/10);
        }
141 142
    }

Christiaan Janssen's avatar
Christiaan Janssen committed
143

144
    // ***** functions
145
    function gotoSourceLocation(file,line,column) {
Christiaan Janssen's avatar
Christiaan Janssen committed
146 147 148 149 150 151
        if (file !== undefined) {
            root.fileName = file;
            root.lineNumber = line;
            root.columnNumber = column;
            root.updateCursorPosition();
        }
Christiaan Janssen's avatar
Christiaan Janssen committed
152 153
    }

154
    function clearData() {
155
        view.clearData();
156
        dataAvailable = false;
Christiaan Janssen's avatar
Christiaan Janssen committed
157
        appKilled = false;
158
        eventCount = 0;
159
        hideRangeDetails();
160 161 162
        selectionRangeMode = false;
        updateRangeButton();
        zoomControl.setRange(0,0);
163 164
    }

165
    function clearDisplay() {
166 167
        clearData();
        view.visible = false;
168 169 170 171
    }

    function clearAll() {
        clearDisplay();
172
        elapsedTime = 0;
173 174
    }

175
    function nextEvent() {
176
        view.selectNext();
177 178 179
    }

    function prevEvent() {
180
        view.selectPrev();
181 182
    }

183 184
    function updateWindowLength(absoluteFactor) {
        var windowLength = view.endTime - view.startTime;
Christiaan Janssen's avatar
Christiaan Janssen committed
185
        if (qmlProfilerModelProxy.traceEndTime() <= qmlProfilerModelProxy.traceStartTime() ||
Christiaan Janssen's avatar
Christiaan Janssen committed
186
                windowLength <= 0)
187
            return;
Christiaan Janssen's avatar
Christiaan Janssen committed
188
        var currentFactor = windowLength / qmlProfilerModelProxy.traceDuration();
189
        updateZoom(absoluteFactor / currentFactor);
190 191
    }

192
    function updateZoom(relativeFactor) {
193 194 195 196
        var min_length = 1e5; // 0.1 ms
        var windowLength = view.endTime - view.startTime;
        if (windowLength < min_length)
            windowLength = min_length;
197
        var newWindowLength = windowLength * relativeFactor;
198

Christiaan Janssen's avatar
Christiaan Janssen committed
199 200
        if (newWindowLength > qmlProfilerModelProxy.traceDuration()) {
            newWindowLength = qmlProfilerModelProxy.traceDuration();
201
            relativeFactor = newWindowLength / windowLength;
202 203 204
        }
        if (newWindowLength < min_length) {
            newWindowLength = min_length;
205
            relativeFactor = newWindowLength / windowLength;
Christiaan Janssen's avatar
Christiaan Janssen committed
206 207
        }

208
        var fixedPoint = (view.startTime + view.endTime) / 2;
Christiaan Janssen's avatar
Christiaan Janssen committed
209

210
        if (view.selectedItem !== -1) {
211
            // center on selected item if it's inside the current screen
Christiaan Janssen's avatar
Christiaan Janssen committed
212
            var newFixedPoint = qmlProfilerModelProxy.getStartTime(view.selectedModel, view.selectedItem);
213 214
            if (newFixedPoint >= view.startTime && newFixedPoint < view.endTime)
                fixedPoint = newFixedPoint;
Christiaan Janssen's avatar
Christiaan Janssen committed
215 216
        }

Christiaan Janssen's avatar
Christiaan Janssen committed
217

218 219 220 221 222 223 224 225 226 227 228 229
        var startTime = fixedPoint - relativeFactor*(fixedPoint - view.startTime);
        zoomControl.setRange(startTime, startTime + newWindowLength);
    }

    function updateZoomCentered(centerX, relativeFactor)
    {
        var min_length = 1e5; // 0.1 ms
        var windowLength = view.endTime - view.startTime;
        if (windowLength < min_length)
            windowLength = min_length;
        var newWindowLength = windowLength * relativeFactor;

Christiaan Janssen's avatar
Christiaan Janssen committed
230 231
        if (newWindowLength > qmlProfilerModelProxy.traceDuration()) {
            newWindowLength = qmlProfilerModelProxy.traceDuration();
232 233 234 235 236 237 238 239 240
            relativeFactor = newWindowLength / windowLength;
        }
        if (newWindowLength < min_length) {
            newWindowLength = min_length;
            relativeFactor = newWindowLength / windowLength;
        }

        var fixedPoint = (centerX - flick.x) * windowLength / flick.width + view.startTime;
        var startTime = fixedPoint - relativeFactor*(fixedPoint - view.startTime);
241 242 243
        zoomControl.setRange(startTime, startTime + newWindowLength);
    }

244 245 246 247 248
    function recenter( centerPoint ) {
        var windowLength = view.endTime - view.startTime;
        var newStart = Math.floor(centerPoint - windowLength/2);
        if (newStart < 0)
            newStart = 0;
Christiaan Janssen's avatar
Christiaan Janssen committed
249 250
        if (newStart + windowLength > qmlProfilerModelProxy.traceEndTime())
            newStart = qmlProfilerModelProxy.traceEndTime() - windowLength;
251 252 253
        zoomControl.setRange(newStart, newStart + windowLength);
    }

Christiaan Janssen's avatar
Christiaan Janssen committed
254
    function recenterOnItem( modelIndex, itemIndex )
255
    {
256 257 258
        if (itemIndex === -1)
            return;

259
        // if item is outside of the view, jump back to its position
Christiaan Janssen's avatar
Christiaan Janssen committed
260 261 262 263
        if (qmlProfilerModelProxy.getEndTime(modelIndex, itemIndex) < view.startTime ||
                qmlProfilerModelProxy.getStartTime(modelIndex, itemIndex) > view.endTime) {
            recenter((qmlProfilerModelProxy.getStartTime(modelIndex, itemIndex) +
                      qmlProfilerModelProxy.getEndTime(modelIndex, itemIndex)) / 2);
264
        }
Christiaan Janssen's avatar
Christiaan Janssen committed
265

266 267
    }

268
    function wheelZoom(wheelCenter, wheelDelta) {
Christiaan Janssen's avatar
Christiaan Janssen committed
269
        if (qmlProfilerModelProxy.traceEndTime() > qmlProfilerModelProxy.traceStartTime() &&
Christiaan Janssen's avatar
Christiaan Janssen committed
270
                wheelDelta !== 0) {
271 272 273 274 275 276 277
            if (wheelDelta>0)
                updateZoomCentered(wheelCenter, 1/1.2);
            else
                updateZoomCentered(wheelCenter, 1.2);
        }
    }

278 279 280 281
    function hideRangeDetails() {
        rangeDetails.visible = false;
        rangeDetails.duration = "";
        rangeDetails.label = "";
Christiaan Janssen's avatar
Christiaan Janssen committed
282
        //rangeDetails.type = "";
283 284
        rangeDetails.file = "";
        rangeDetails.line = -1;
285
        rangeDetails.column = 0;
286
        rangeDetails.isBindingLoop = false;
287 288
    }

Christiaan Janssen's avatar
Christiaan Janssen committed
289 290 291 292 293 294 295 296
    function selectNextByHash(hash) {
        var eventId = qmlProfilerModelProxy.getEventIdForHash(hash);
        if (eventId !== -1) {
            selectNextById(eventId);
        }
    }

    function selectNextById(eventId)
297
    {
Christiaan Janssen's avatar
Christiaan Janssen committed
298 299
        // this is a slot responding to events from the other pane
        // which tracks only events from the basic model
300 301
        if (!lockItemSelection) {
            lockItemSelection = true;
Christiaan Janssen's avatar
Christiaan Janssen committed
302 303
            var modelIndex = qmlProfilerModelProxy.basicModelIndex();
            var itemIndex = view.nextItemFromId( modelIndex, eventId );
304
            // select an item, lock to it, and recenter if necessary
Christiaan Janssen's avatar
Christiaan Janssen committed
305 306
            if (view.selectedItem != itemIndex || view.selectedModel != modelIndex) {
                view.selectedModel = modelIndex;
307 308 309
                view.selectedItem = itemIndex;
                if (itemIndex !== -1) {
                    view.selectionLocked = true;
Christiaan Janssen's avatar
Christiaan Janssen committed
310
                    recenterOnItem(modelIndex, itemIndex);
311 312 313 314 315 316
                }
            }
            lockItemSelection = false;
        }
    }

317
    // ***** slots
318 319 320 321 322
    onSelectionRangeModeChanged: {
        selectionRangeControl.enabled = selectionRangeMode;
        selectionRange.reset(selectionRangeMode);
    }

323 324 325 326
    onSelectionLockedChanged: {
        updateLockButton();
    }

327 328 329
    onSelectedItemChanged: {
        if (selectedItem != -1 && !lockItemSelection) {
            lockItemSelection = true;
Christiaan Janssen's avatar
Christiaan Janssen committed
330 331 332
            // update in other views
            var eventLocation = qmlProfilerModelProxy.getEventLocation(view.selectedModel, view.selectedItem);
            gotoSourceLocation(eventLocation.file, eventLocation.line, eventLocation.column);
333 334 335 336
            lockItemSelection = false;
        }
    }

Christiaan Janssen's avatar
Christiaan Janssen committed
337 338 339 340 341 342
    onRecordingEnabledChanged: {
        if (recordingEnabled) {
            recordingStartDate = new Date();
            elapsedTime = 0;
        } else {
            elapsedTime = (new Date() - recordingStartDate)/1000.0;
Christiaan Janssen's avatar
Christiaan Janssen committed
343 344 345
        }
    }

Christiaan Janssen's avatar
Christiaan Janssen committed
346 347

    // ***** child items
348 349 350 351
    TimeMarks {
        id: backgroundMarks
        y: labels.y
        height: flick.height
Christiaan Janssen's avatar
Christiaan Janssen committed
352 353
        anchors.left: flick.left
        anchors.right: flick.right
354 355
    }

Christiaan Janssen's avatar
Christiaan Janssen committed
356 357 358
    Flickable {
        id: flick
        anchors.top: parent.top
Christiaan Janssen's avatar
Christiaan Janssen committed
359
        anchors.topMargin: labels.y
Christiaan Janssen's avatar
Christiaan Janssen committed
360 361
        anchors.right: parent.right
        anchors.left: labels.right
362 363
        height: root.height
        contentWidth: 0;
364
        contentHeight: labels.height
365
        flickableDirection: Flickable.HorizontalFlick
Christiaan Janssen's avatar
Christiaan Janssen committed
366

367 368 369 370 371
        onContentXChanged: {
            if (Math.round(view.startX) !== contentX)
                view.startX = contentX;
        }

372 373
        clip:true

374 375 376 377 378 379 380 381 382 383 384 385 386 387 388
        MouseArea {
            id: selectionRangeDrag
            enabled: selectionRange.ready
            anchors.fill: selectionRange
            drag.target: selectionRange
            drag.axis: "XAxis"
            drag.minimumX: 0
            drag.maximumX: flick.contentWidth - selectionRange.width
            onPressed: {
                selectionRange.isDragging = true;
            }
            onReleased: {
                selectionRange.isDragging = false;
            }
            onDoubleClicked: {
Christiaan Janssen's avatar
Christiaan Janssen committed
389 390
                zoomControl.setRange(selectionRange.startTime,
                                     selectionRange.startTime + selectionRange.duration);
391 392 393 394 395 396 397 398 399 400 401 402 403
                root.selectionRangeMode = false;
                root.updateRangeButton();
            }
        }


        SelectionRange {
            id: selectionRange
            visible: root.selectionRangeMode
            height: root.height
            z: 2
        }

Christiaan Janssen's avatar
Christiaan Janssen committed
404
        TimelineRenderer {
Christiaan Janssen's avatar
Christiaan Janssen committed
405 406
            id: view

Christiaan Janssen's avatar
Christiaan Janssen committed
407
            profilerModelProxy: qmlProfilerModelProxy
408

409
            x: flick.contentX
410
            width: flick.width
411
            height: root.height
Christiaan Janssen's avatar
Christiaan Janssen committed
412

413
            property variant startX: 0
Christiaan Janssen's avatar
Christiaan Janssen committed
414
            onStartXChanged: {
Christiaan Janssen's avatar
Christiaan Janssen committed
415
                var newStartTime = Math.round(startX * (endTime - startTime) / flick.width) +
Christiaan Janssen's avatar
Christiaan Janssen committed
416
                        qmlProfilerModelProxy.traceStartTime();
417
                if (Math.abs(newStartTime - startTime) > 1) {
Christiaan Janssen's avatar
Christiaan Janssen committed
418 419 420
                    var newEndTime = Math.round((startX+flick.width) *
                                                (endTime - startTime) /
                                                flick.width) +
Christiaan Janssen's avatar
Christiaan Janssen committed
421
                                                qmlProfilerModelProxy.traceStartTime();
422 423 424 425 426
                    zoomControl.setRange(newStartTime, newEndTime);
                }

                if (Math.round(startX) !== flick.contentX)
                    flick.contentX = startX;
Christiaan Janssen's avatar
Christiaan Janssen committed
427
            }
428 429 430 431 432

            function updateFlickRange(start, end) {
                if (start !== startTime || end !== endTime) {
                    startTime = start;
                    endTime = end;
Christiaan Janssen's avatar
Christiaan Janssen committed
433
                    var newStartX = (startTime - qmlProfilerModelProxy.traceStartTime()) *
Christiaan Janssen's avatar
Christiaan Janssen committed
434
                            flick.width / (endTime-startTime);
435 436 437
                    if (Math.abs(newStartX - startX) >= 1)
                        startX = newStartX;
                }
438 439
            }

440 441 442
            onSelectedItemChanged: {
                if (selectedItem !== -1) {
                    // display details
Christiaan Janssen's avatar
Christiaan Janssen committed
443 444
                    rangeDetails.showInfo(qmlProfilerModelProxy.getEventDetails(selectedModel, selectedItem));
                    rangeDetails.setLocation(qmlProfilerModelProxy.getEventLocation(selectedModel, selectedItem));
445

446
                    // center view (horizontally)
447
                    var windowLength = view.endTime - view.startTime;
Christiaan Janssen's avatar
Christiaan Janssen committed
448
                    var eventStartTime = qmlProfilerModelProxy.getStartTime(selectedModel, selectedItem);
Christiaan Janssen's avatar
Christiaan Janssen committed
449
                    var eventEndTime = eventStartTime +
Christiaan Janssen's avatar
Christiaan Janssen committed
450
                            qmlProfilerModelProxy.getDuration(selectedModel, selectedItem);
451

452 453
                    if (eventEndTime < view.startTime || eventStartTime > view.endTime) {
                        var center = (eventStartTime + eventEndTime)/2;
Christiaan Janssen's avatar
Christiaan Janssen committed
454
                        var from = Math.min(qmlProfilerModelProxy.traceEndTime()-windowLength,
455
                                            Math.max(0, Math.floor(center - windowLength/2)));
456

457
                        zoomControl.setRange(from, from + windowLength);
Christiaan Janssen's avatar
Christiaan Janssen committed
458

459
                    }
460 461

                    // center view (vertically)
Christiaan Janssen's avatar
Christiaan Janssen committed
462
                    var itemY = view.getYPosition(selectedModel, selectedItem);
463 464 465
                    if (itemY < root.scrollY) {
                        root.updateVerticalScroll(itemY);
                    } else
Christiaan Janssen's avatar
Christiaan Janssen committed
466 467 468 469
                        if (itemY + root.singleRowHeight >
                                root.scrollY + root.candidateHeight) {
                            root.updateVerticalScroll(itemY + root.singleRowHeight -
                                                      root.candidateHeight);
470
                    }
Christiaan Janssen's avatar
Christiaan Janssen committed
471

472
                } else {
473 474
                    root.hideRangeDetails();
                }
475
            }
476

477
            onItemPressed: {
Christiaan Janssen's avatar
Christiaan Janssen committed
478 479 480
                var location = qmlProfilerModelProxy.getEventLocation(modelIndex, pressedItem);
                if (location.hasOwnProperty("file")) // not empty
                    root.gotoSourceLocation(location.file, location.line, location.column);
481 482
            }

483
         // hack to pass mouse events to the other mousearea if enabled
Christiaan Janssen's avatar
Christiaan Janssen committed
484 485
            startDragArea: selectionRangeDrag.enabled ? selectionRangeDrag.x :
                                                        -flick.contentX
486
            endDragArea: selectionRangeDrag.enabled ?
Christiaan Janssen's avatar
Christiaan Janssen committed
487 488
                             selectionRangeDrag.x + selectionRangeDrag.width :
                             -flick.contentX-1
489 490 491 492 493 494 495 496 497
        }
        MouseArea {
            id: selectionRangeControl
            enabled: false
            width: flick.width
            height: root.height
            x: flick.contentX
            hoverEnabled: enabled
            z: 2
498

499 500 501 502 503 504 505 506
            onReleased:  {
                selectionRange.releasedOnCreation();
            }
            onPressed:  {
                selectionRange.pressedOnCreation();
            }
            onMousePositionChanged: {
                selectionRange.movedOnCreation();
507
            }
Christiaan Janssen's avatar
Christiaan Janssen committed
508 509
        }
    }
510

511 512 513 514 515 516 517 518 519
    SelectionRangeDetails {
        id: selectionRangeDetails
        visible: root.selectionRangeMode
        startTime: selectionRange.startTimeString
        duration: selectionRange.durationString
        endTime: selectionRange.endTimeString
        showDuration: selectionRange.width > 1
    }

Christiaan Janssen's avatar
Christiaan Janssen committed
520 521 522 523 524 525 526 527
    RangeDetails {
        id: rangeDetails
    }

    Rectangle {
        id: labels
        width: 150
        color: "#dcdcdc"
528
        height: col.height
Christiaan Janssen's avatar
Christiaan Janssen committed
529

Christiaan Janssen's avatar
Christiaan Janssen committed
530
        property int rowCount: qmlProfilerModelProxy.categories();
531

Christiaan Janssen's avatar
Christiaan Janssen committed
532
        Column {
533
            id: col
534 535
            Repeater {
                model: labels.rowCount
Christiaan Janssen's avatar
Christiaan Janssen committed
536
                delegate: Label { }
537
            }
Christiaan Janssen's avatar
Christiaan Janssen committed
538 539 540
        }
    }

541
    Rectangle {
542 543 544 545 546
        id: labelsTail
        anchors.top: labels.bottom
        anchors.bottom: root.bottom
        width: labels.width
        color: labels.color
547
    }
548

549 550 551 552 553 554 555 556 557 558 559 560 561
    // Gradient borders
    Item {
        anchors.left: labels.right
        width: 6
        anchors.top: root.top
        anchors.bottom: root.bottom
        Rectangle {
            x: parent.width
            transformOrigin: Item.TopLeft
            rotation: 90
            width: parent.height
            height: parent.width
            gradient: Gradient {
562 563
                GradientStop { position: 0.0; color: "#00000000"; }
                GradientStop { position: 1.0; color: "#86000000"; }
564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579
            }
        }
    }

    Item {
        anchors.right: root.right
        width: 6
        anchors.top: root.top
        anchors.bottom: root.bottom
        Rectangle {
            x: parent.width
            transformOrigin: Item.TopLeft
            rotation: 90
            width: parent.height
            height: parent.width
            gradient: Gradient {
580 581
                GradientStop { position: 0.0; color: "#86000000"; }
                GradientStop { position: 1.0; color: "#00000000"; }
582 583 584 585 586 587 588 589 590 591
            }
        }
    }

    Rectangle {
        y: root.scrollY + root.candidateHeight - height
        height: 6
        width: root.width
        x: 0
        gradient: Gradient {
592 593
            GradientStop { position: 0.0; color: "#00000000"; }
            GradientStop { position: 1.0; color: "#86000000"; }
594 595
        }
    }
Christiaan Janssen's avatar
Christiaan Janssen committed
596
}