aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/components/stateseditor/stateslist.qml
diff options
context:
space:
mode:
authorChristiaan Janssen <christiaan.janssen@nokia.com>2010-02-16 11:26:20 +0100
committerChristiaan Janssen <christiaan.janssen@nokia.com>2010-02-16 11:26:32 +0100
commitaec39f557cfc8b10961a7077e49e2379b39aac20 (patch)
treea78cd38549ca3535c453ba641ccf6f2ae5eba030 /src/plugins/qmldesigner/components/stateseditor/stateslist.qml
parent1aa3ec58a9b846ce62671ac3000ac849ca99b5ad (diff)
QmlDesigner.StatesEditor: State name text is elided if too long
Diffstat (limited to 'src/plugins/qmldesigner/components/stateseditor/stateslist.qml')
-rw-r--r--src/plugins/qmldesigner/components/stateseditor/stateslist.qml24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/plugins/qmldesigner/components/stateseditor/stateslist.qml b/src/plugins/qmldesigner/components/stateseditor/stateslist.qml
index 640fb695a3..bcc6300ee1 100644
--- a/src/plugins/qmldesigner/components/stateseditor/stateslist.qml
+++ b/src/plugins/qmldesigner/components/stateseditor/stateslist.qml
@@ -200,8 +200,6 @@ Rectangle {
anchors.centerIn:parent
}
-
-
MouseRegion {
anchors.fill:parent
onClicked: {
@@ -235,28 +233,16 @@ Rectangle {
anchors.leftMargin:4
height: txt.height
clip: false
-
- onWidthChanged: txt.updateText();
-
- Text{
+ Text {
anchors.top: parent.top
anchors.topMargin: 2
anchors.horizontalCenter: textLimits.horizontalCenter
id: txt
color: "#E1E1E1";
- property string candidateText: stateName
- onCandidateTextChanged: updateText();
- function updateText() {
- var cut=Math.floor(candidateText.length/2);
- text=candidateText;
- if (parent.width<=0) return;
- while (width > parent.width) {
- cut = cut-1;
- text = candidateText.substring(0,cut)+"..."+
- candidateText.substring(candidateText.length-cut,candidateText.length);
- }
- }
-
+ text: stateName
+ width:parent.width
+ elide:Qt.ElideMiddle
+ horizontalAlignment:Qt.AlignHCenter
}
MouseRegion {
id: txtRegion