forked from qt-creator/qt-creator
QmlProfiler: revert to fixed layout for detail windows
The dynamic layout creates more problems than it solves. A fixed layout with proper elision and fixed window width certainly looks better. Also, the view has to add the colons after the labels now. Change-Id: I649351a742bd129ea9738359bac27e55e29d6a93 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -30,8 +30,11 @@
|
|||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
|
property bool isLabel: false
|
||||||
font.pixelSize: 12
|
font.pixelSize: 12
|
||||||
font.bold: index % 2 === 0
|
font.bold: isLabel
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
|
elide: Text.ElideRight
|
||||||
|
width: text === "" ? 0 : (isLabel ? 85 : 170)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ Item {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
color: "white"
|
color: "white"
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
|
|
||||||
// Details area
|
// Details area
|
||||||
@@ -174,7 +175,8 @@ Item {
|
|||||||
Repeater {
|
Repeater {
|
||||||
model: eventInfo
|
model: eventInfo
|
||||||
Detail {
|
Detail {
|
||||||
text: content
|
isLabel: index % 2 === 0
|
||||||
|
text: (content === undefined) ? "" : (isLabel ? (content + ":") : content)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,14 +136,15 @@ Item {
|
|||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: [
|
model: [
|
||||||
qsTr("Start"),
|
qsTr("Start") + ":",
|
||||||
startTime,
|
startTime,
|
||||||
showDuration ? qsTr("End") : "",
|
showDuration ? (qsTr("End") + ":") : "",
|
||||||
showDuration ? endTime : "",
|
showDuration ? endTime : "",
|
||||||
showDuration ? qsTr("Duration") : "",
|
showDuration ? (qsTr("Duration") + ":") : "",
|
||||||
showDuration ? duration : ""
|
showDuration ? duration : ""
|
||||||
]
|
]
|
||||||
Detail {
|
Detail {
|
||||||
|
isLabel: index % 2 === 0
|
||||||
text: modelData
|
text: modelData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,10 +294,7 @@ QVariantMap RangeTimelineModel::details(int index) const
|
|||||||
result.insert(QStringLiteral("displayName"), categoryLabel(d->rangeType));
|
result.insert(QStringLiteral("displayName"), categoryLabel(d->rangeType));
|
||||||
result.insert(tr("Duration"), QmlProfilerBaseModel::formatTime(range(index).duration));
|
result.insert(tr("Duration"), QmlProfilerBaseModel::formatTime(range(index).duration));
|
||||||
|
|
||||||
QString detailsString = types[id].data;
|
result.insert(tr("Details"), types[id].data);
|
||||||
if (detailsString.length() > 40)
|
|
||||||
detailsString = detailsString.left(40) + QLatin1String("...");
|
|
||||||
result.insert(tr("Details"), detailsString);
|
|
||||||
result.insert(tr("Location"), types[id].displayName);
|
result.insert(tr("Location"), types[id].displayName);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user