Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/package/contents/ui/main.qml
Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Line(s) | 152 | function preferredHeight(minimum) { | |||
---|---|---|---|---|---|
165 | return height; | 165 | return height; | ||
166 | } | 166 | } | ||
167 | 167 | | |||
168 | function isDrag(fromX, fromY, toX, toY) { | 168 | function isDrag(fromX, fromY, toX, toY) { | ||
169 | var length = Math.abs(fromX - toX) + Math.abs(fromY - toY); | 169 | var length = Math.abs(fromX - toX) + Math.abs(fromY - toY); | ||
170 | return length >= Qt.styleHints.startDragDistance; | 170 | return length >= Qt.styleHints.startDragDistance; | ||
171 | } | 171 | } | ||
172 | 172 | | |||
173 | function action_kscreenkcm() { | ||||
174 | KQuickControlsAddons.KCMShell.open("kscreen"); | ||||
175 | } | ||||
176 | | ||||
173 | onFocusChanged: { | 177 | onFocusChanged: { | ||
174 | if (focus && isFolder) { | 178 | if (focus && isFolder) { | ||
175 | folderViewLayer.item.forceActiveFocus(); | 179 | folderViewLayer.item.forceActiveFocus(); | ||
176 | } | 180 | } | ||
177 | } | 181 | } | ||
178 | 182 | | |||
179 | onDragEnter: { | 183 | onDragEnter: { | ||
180 | if (isContainment && plasmoid.immutable && !(isFolder && FolderTools.isFileDrag(event))) { | 184 | if (isContainment && plasmoid.immutable && !(isFolder && FolderTools.isFileDrag(event))) { | ||
▲ Show 20 Lines • Show All 213 Lines • ▼ Show 20 Line(s) | 328 | ContainmentLayoutManager.AppletsLayout { | |||
394 | } | 398 | } | ||
395 | } | 399 | } | ||
396 | 400 | | |||
397 | Component.onCompleted: { | 401 | Component.onCompleted: { | ||
398 | if (!isContainment) { | 402 | if (!isContainment) { | ||
399 | return; | 403 | return; | ||
400 | } | 404 | } | ||
401 | 405 | | |||
406 | plasmoid.setAction("kscreenkcm", i18n("Manage Displays..."), "preferences-desktop-display"); | ||||
407 | | ||||
402 | // Customize the icon and text to improve discoverability | 408 | // Customize the icon and text to improve discoverability | ||
403 | plasmoid.setAction("configure", i18n("Configure Desktop..."), "preferences-desktop-wallpaper") | 409 | plasmoid.setAction("configure", i18n("Configure Desktop..."), "preferences-desktop-wallpaper") | ||
404 | 410 | | |||
405 | // WORKAROUND: that's the only place where we can inject a sensible size. | 411 | // WORKAROUND: that's the only place where we can inject a sensible size. | ||
406 | // if root has width defined, it will override the value we set before | 412 | // if root has width defined, it will override the value we set before | ||
407 | // the component completes | 413 | // the component completes | ||
408 | root.width = plasmoid.width; | 414 | root.width = plasmoid.width; | ||
409 | 415 | | |||
410 | updateGridSize(); | 416 | updateGridSize(); | ||
411 | } | 417 | } | ||
412 | } | 418 | } |