2016-12-19 19:34:24 -08:00
|
|
|
//
|
2016-12-20 10:45:36 -08:00
|
|
|
// debugWindow.qml
|
2016-12-19 19:34:24 -08:00
|
|
|
//
|
2016-12-20 10:45:36 -08:00
|
|
|
// Brad Hefta-Gaub, created on 12/19/2016.
|
|
|
|
// Copyright 2016 High Fidelity, Inc.
|
2016-12-19 19:34:24 -08:00
|
|
|
//
|
|
|
|
// Distributed under the Apache License, Version 2.0.
|
|
|
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
|
|
//
|
|
|
|
|
|
|
|
import QtQuick 2.5
|
|
|
|
import QtQuick.Controls 1.4
|
|
|
|
import Hifi 1.0 as Hifi
|
|
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: root
|
|
|
|
width: parent ? parent.width : 100
|
|
|
|
height: parent ? parent.height : 100
|
|
|
|
|
2017-04-04 16:59:09 +02:00
|
|
|
signal moved(vector2d position);
|
|
|
|
signal resized(size size);
|
|
|
|
|
2016-12-19 19:34:24 -08:00
|
|
|
property var channel;
|
|
|
|
|
|
|
|
TextArea {
|
|
|
|
id: textArea
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
|
|
|
text:""
|
|
|
|
}
|
|
|
|
|
|
|
|
function fromScript(message) {
|
2016-12-20 14:14:28 -08:00
|
|
|
var MAX_LINE_COUNT = 2000;
|
|
|
|
var TRIM_LINES = 500;
|
|
|
|
if (textArea.lineCount > MAX_LINE_COUNT) {
|
|
|
|
var lines = textArea.text.split('\n');
|
|
|
|
lines.splice(0, TRIM_LINES);
|
|
|
|
textArea.text = lines.join('\n');
|
|
|
|
}
|
2016-12-20 11:27:18 -08:00
|
|
|
textArea.append(message);
|
2016-12-19 19:34:24 -08:00
|
|
|
}
|
2017-06-13 20:25:01 +05:30
|
|
|
|
|
|
|
function clearWindow() {
|
|
|
|
textArea.remove(0,textArea.length);
|
|
|
|
}
|
2016-12-19 19:34:24 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|