Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/package/contents/ui/FolderItemDelegate.qml
Show First 20 Lines • Show All 189 Lines • ▼ Show 20 Line(s) | 167 | Loader { | |||
---|---|---|---|---|---|
190 | } | 190 | } | ||
191 | 191 | | |||
192 | height: { | 192 | height: { | ||
193 | if (root.useListViewMode) { | 193 | if (root.useListViewMode) { | ||
194 | return parent.height; | 194 | return parent.height; | ||
195 | } | 195 | } | ||
196 | 196 | | |||
197 | return (icon.height + (2 * units.smallSpacing) + (label.lineCount | 197 | return (icon.height + (2 * units.smallSpacing) + (label.lineCount | ||
198 | * theme.mSize(theme.defaultFont).height) + (2 * units.largeSpacing)); | 198 | * theme.mSize(theme.defaultFont).height) + (3 * units.smallSpacing)); | ||
davidedmundson: you have 3*INT being added to the height
then have an icon centre aligned inside it… | |||||
199 | } | 199 | } | ||
200 | 200 | | |||
201 | PlasmaCore.IconItem { | 201 | PlasmaCore.IconItem { | ||
202 | id: icon | 202 | id: icon | ||
203 | 203 | | |||
204 | z: 2 | 204 | z: 2 | ||
205 | 205 | | |||
206 | states: [ | 206 | states: [ | ||
Show All 13 Lines | 219 | AnchorChanges { | |||
220 | target: icon | 220 | target: icon | ||
221 | anchors.left: parent.left | 221 | anchors.left: parent.left | ||
222 | anchors.verticalCenter: parent.verticalCenter | 222 | anchors.verticalCenter: parent.verticalCenter | ||
223 | } | 223 | } | ||
224 | } | 224 | } | ||
225 | ] | 225 | ] | ||
226 | 226 | | |||
227 | anchors { | 227 | anchors { | ||
228 | topMargin: units.largeSpacing | 228 | topMargin: (2 * units.smallSpacing) | ||
229 | leftMargin: units.smallSpacing | 229 | leftMargin: units.smallSpacing | ||
230 | } | 230 | } | ||
231 | 231 | | |||
232 | width: root.useListViewMode ? main.GridView.view.iconSize : (parent.width - 2 * units.smallSpacing) | 232 | width: root.useListViewMode ? main.GridView.view.iconSize : (parent.width - 2 * units.smallSpacing) | ||
233 | height: main.GridView.view.iconSize | 233 | height: main.GridView.view.iconSize | ||
234 | 234 | | |||
235 | opacity: root.useListViewMode && selectionButton ? 0.3 : 1.0 | 235 | opacity: root.useListViewMode && selectionButton ? 0.3 : 1.0 | ||
236 | 236 | | |||
Show All 15 Lines | 250 | State { // icon view | |||
252 | 252 | | |||
253 | AnchorChanges { | 253 | AnchorChanges { | ||
254 | target: label | 254 | target: label | ||
255 | anchors.top: icon.bottom | 255 | anchors.top: icon.bottom | ||
256 | anchors.horizontalCenter: parent.horizontalCenter | 256 | anchors.horizontalCenter: parent.horizontalCenter | ||
257 | } | 257 | } | ||
258 | PropertyChanges { | 258 | PropertyChanges { | ||
259 | target: label | 259 | target: label | ||
260 | anchors.topMargin: 2 * units.smallSpacing | 260 | anchors.topMargin: units.smallSpacing | ||
261 | width: Math.min(label.implicitWidth + units.smallSpacing, parent.width - units.smallSpacing * 8) | 261 | width: Math.min(label.implicitWidth + units.smallSpacing, parent.width - units.smallSpacing * 4) | ||
262 | maximumLineCount: plasmoid.configuration.textLines | 262 | maximumLineCount: plasmoid.configuration.textLines | ||
263 | horizontalAlignment: Text.AlignHCenter | 263 | horizontalAlignment: Text.AlignHCenter | ||
264 | } | 264 | } | ||
265 | }, | 265 | }, | ||
266 | State { // list view | 266 | State { // list view | ||
267 | when: root.useListViewMode | 267 | when: root.useListViewMode | ||
268 | 268 | | |||
269 | AnchorChanges { | 269 | AnchorChanges { | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 303 | visible: { | |||
311 | 311 | | |||
312 | if (popupDialog) { | 312 | if (popupDialog) { | ||
313 | return false; | 313 | return false; | ||
314 | } | 314 | } | ||
315 | 315 | | |||
316 | return true; | 316 | return true; | ||
317 | } | 317 | } | ||
318 | 318 | | |||
319 | x: units.smallSpacing * 3 | | |||
320 | y: units.smallSpacing * 3 | | |||
321 | | ||||
322 | z: 3 | 319 | z: 3 | ||
323 | 320 | | |||
324 | anchors { | 321 | anchors { | ||
325 | centerIn: root.useListViewMode ? icon : undefined | 322 | centerIn: root.useListViewMode ? icon : undefined | ||
326 | } | 323 | } | ||
327 | 324 | | |||
328 | width: implicitWidth | 325 | width: implicitWidth | ||
329 | height: implicitHeight | 326 | height: implicitHeight | ||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |
you have 3*INT being added to the height
then have an icon centre aligned inside it
gridUnit/largeSpacing will always be even. smallSpacing might not be.