on xenial help sign in
Enable wrapping and eliding in dash navigation
d5ca82cMichał Sawicz
qml/Dash/DashNavigationList.qml+16
@@ -87,10 +87,15 @@ Item {
87 anchors {
87 anchors {
88 verticalCenter: parent.verticalCenter
88 verticalCenter: parent.verticalCenter
89 left: backImage.right
89 left: backImage.right
90+ right: parent.right
90 leftMargin: units.gu(0.5)
91 leftMargin: units.gu(0.5)
92+ rightMargin: units.gu(2)
91 }
93 }
92 text: navigation ? navigation.parentLabel : ""
94 text: navigation ? navigation.parentLabel : ""
93 color: root.foregroundColor
95 color: root.foregroundColor
96+ wrapMode: Text.Wrap
97+ maximumLineCount: 2
98+ elide: Text.ElideMiddle
94 }
99 }
95
100
96 Rectangle {
101 Rectangle {
@@ -118,11 +123,16 @@ Item {
118 anchors {
123 anchors {
119 verticalCenter: parent.verticalCenter
124 verticalCenter: parent.verticalCenter
120 left: parent.left
125 left: parent.left
126+ right: parent.right
121 leftMargin: units.gu(2)
127 leftMargin: units.gu(2)
128+ rightMargin: units.gu(2)
122 }
129 }
123 text: navigation ? (navigation.allLabel != "" ? navigation.allLabel : navigation.label) : ""
130 text: navigation ? (navigation.allLabel != "" ? navigation.allLabel : navigation.label) : ""
124 font.bold: true
131 font.bold: true
125 color: root.foregroundColor
132 color: root.foregroundColor
133+ wrapMode: Text.Wrap
134+ maximumLineCount: 2
135+ elide: Text.ElideMiddle
126 }
136 }
127
137
128 Rectangle {
138 Rectangle {
@@ -156,12 +166,18 @@ Item {
156 verticalCenter: parent.verticalCenter
166 verticalCenter: parent.verticalCenter
157 left: parent.left
167 left: parent.left
158 leftMargin: units.gu(2)
168 leftMargin: units.gu(2)
169+ right: rightIcon.visible ? rightIcon.left : parent.right
170+ rightMargin: rightIcon.visible ? units.gu(0.5) : units.gu(2)
159 }
171 }
160 text: label
172 text: label
161 color: root.foregroundColor
173 color: root.foregroundColor
174+ wrapMode: Text.Wrap
175+ maximumLineCount: 2
176+ elide: Text.ElideMiddle
162 }
177 }
163
178
164 Icon {
179 Icon {
180+ id: rightIcon
165 anchors {
181 anchors {
166 verticalCenter: parent.verticalCenter
182 verticalCenter: parent.verticalCenter
167 right: parent.right
183 right: parent.right