Changeset View
Changeset View
Standalone View
Standalone View
desktoppackage/contents/explorer/WidgetExplorer.qml
Show First 20 Lines • Show All 286 Lines • ▼ Show 20 Line(s) | 267 | PlasmaExtras.ScrollArea { | |||
---|---|---|---|---|---|
287 | 287 | | |||
288 | GridView { | 288 | GridView { | ||
289 | id: list | 289 | id: list | ||
290 | 290 | | |||
291 | // model set delayed by Timer above | 291 | // model set delayed by Timer above | ||
292 | 292 | | |||
293 | activeFocusOnTab: true | 293 | activeFocusOnTab: true | ||
294 | keyNavigationWraps: true | 294 | keyNavigationWraps: true | ||
295 | cellWidth: (width - units.smallSpacing) / 2 | 295 | cellWidth: Math.floor((width - units.smallSpacing) / 2) | ||
ngraham: In general it's best to use `floor` rather than `round` for this kind of thing to prevent… | |||||
296 | cellHeight: cellWidth + units.gridUnit * 4 + units.smallSpacing * 2 | 296 | cellHeight: cellWidth + units.gridUnit * 4 + units.smallSpacing * 2 | ||
297 | 297 | | |||
298 | delegate: AppletDelegate {} | 298 | delegate: AppletDelegate {} | ||
299 | highlight: PlasmaComponents.Highlight {} | 299 | highlight: PlasmaComponents.Highlight {} | ||
300 | highlightMoveDuration: 0 | 300 | highlightMoveDuration: 0 | ||
301 | //highlightResizeDuration: 0 | 301 | //highlightResizeDuration: 0 | ||
302 | 302 | | |||
303 | //slide in to view from the left | 303 | //slide in to view from the left | ||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |
In general it's best to use floor rather than round for this kind of thing to prevent everything from getting rounded up and potentially overflowing the bounds.