forked from qt-creator/qt-creator
QmlProfiler: minor improvements in rangedetails display
Change-Id: I7a4c85443d99425f5b15eda424745b83526ebb3f Reviewed-on: http://codereview.qt.nokia.com/754 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -51,17 +51,23 @@ Item {
|
||||
}
|
||||
Text {
|
||||
id: lbl
|
||||
text: label + ":"
|
||||
text: label
|
||||
font.pixelSize: 12
|
||||
font.bold: true
|
||||
anchors.right: guideline.left
|
||||
}
|
||||
Text {
|
||||
text:":"
|
||||
font.pixelSize: 12
|
||||
font.bold: true
|
||||
anchors.right: baseline.left
|
||||
anchors.baseline: lbl.baseline
|
||||
}
|
||||
Text {
|
||||
text: content
|
||||
font.pixelSize: 12
|
||||
anchors.baseline: lbl.baseline
|
||||
anchors.left: guideline.right
|
||||
// maximumLineCount: maxLines
|
||||
maximumLineCount: maxLines
|
||||
onLinkActivated: detail.linkActivated(link)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,12 +73,26 @@ BorderImage {
|
||||
label: "Duration"
|
||||
content: rangeDetails.duration < 1000 ?
|
||||
rangeDetails.duration + "μs" :
|
||||
Math.floor(rangeDetails.duration/1000) + "ms"
|
||||
Math.floor(rangeDetails.duration/10)/100 + "ms"
|
||||
}
|
||||
Detail {
|
||||
opacity: content.length !== 0 ? 1 : 0
|
||||
label: "Details"
|
||||
content: rangeDetails.label
|
||||
content: {
|
||||
var inputString = rangeDetails.label;
|
||||
if (inputString.length > 7 && inputString.substring(0,7) == "file://") {
|
||||
var pos = inputString.lastIndexOf("/");
|
||||
return inputString.substr(pos+1);
|
||||
}
|
||||
// transform code blocks into oneliners
|
||||
inputString = inputString.replace("\n", " ");
|
||||
|
||||
var maxLen = 40;
|
||||
if (inputString.length > maxLen)
|
||||
inputString = inputString.substring(0,maxLen)+"...";
|
||||
|
||||
return inputString;
|
||||
}
|
||||
}
|
||||
Detail {
|
||||
opacity: content.length !== 0 ? 1 : 0
|
||||
|
||||
Reference in New Issue
Block a user