Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/package/contents/ui/FolderView.qml
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 32 | FocusScope { | |||
---|---|---|---|---|---|
58 | property alias scrollUp: gridView.scrollUp | 58 | property alias scrollUp: gridView.scrollUp | ||
59 | property alias scrollDown: gridView.scrollDown | 59 | property alias scrollDown: gridView.scrollDown | ||
60 | property alias hoveredItem: gridView.hoveredItem | 60 | property alias hoveredItem: gridView.hoveredItem | ||
61 | property var history: [] | 61 | property var history: [] | ||
62 | property Item backButton: null | 62 | property Item backButton: null | ||
63 | property var dialog: null | 63 | property var dialog: null | ||
64 | property Item editor: null | 64 | property Item editor: null | ||
65 | 65 | | |||
66 | function positionViewAtBeginning() { | ||||
67 | gridView.positionViewAtBeginning(); | ||||
68 | } | ||||
69 | | ||||
66 | function rename() { | 70 | function rename() { | ||
67 | if (gridView.currentIndex != -1) { | 71 | if (gridView.currentIndex != -1) { | ||
68 | var renameAction = folderView.model.action("rename"); | 72 | var renameAction = folderView.model.action("rename"); | ||
69 | if (renameAction && !renameAction.enabled) { | 73 | if (renameAction && !renameAction.enabled) { | ||
70 | return; | 74 | return; | ||
71 | } | 75 | } | ||
72 | 76 | | |||
73 | if (!editor) { | 77 | if (!editor) { | ||
▲ Show 20 Lines • Show All 200 Lines • ▼ Show 20 Line(s) | 277 | if (editor && childAt(mouse.x, mouse.y) != editor) { | |||
274 | editor.commit(); | 278 | editor.commit(); | ||
275 | } | 279 | } | ||
276 | 280 | | |||
277 | pressX = mouse.x; | 281 | pressX = mouse.x; | ||
278 | pressY = mouse.y; | 282 | pressY = mouse.y; | ||
279 | 283 | | |||
280 | if (!hoveredItem || hoveredItem.blank) { | 284 | if (!hoveredItem || hoveredItem.blank) { | ||
281 | if (!gridView.ctrlPressed) { | 285 | if (!gridView.ctrlPressed) { | ||
286 | gridView.currentIndex = -1; | ||||
282 | dir.clearSelection(); | 287 | dir.clearSelection(); | ||
283 | } | 288 | } | ||
284 | 289 | | |||
285 | if (mouse.buttons & Qt.RightButton) { | 290 | if (mouse.buttons & Qt.RightButton) { | ||
286 | clearPressState(); | 291 | clearPressState(); | ||
287 | dir.openContextMenu(null, mouse.modifiers); | 292 | dir.openContextMenu(null, mouse.modifiers); | ||
288 | mouse.accepted = true; | 293 | mouse.accepted = true; | ||
289 | } | 294 | } | ||
▲ Show 20 Lines • Show All 811 Lines • ▼ Show 20 Line(s) | 1100 | Folder.FolderModel { | |||
1101 | parseDesktopFiles: (plasmoid.configuration.url == "desktop:/") | 1106 | parseDesktopFiles: (plasmoid.configuration.url == "desktop:/") | ||
1102 | previews: plasmoid.configuration.previews | 1107 | previews: plasmoid.configuration.previews | ||
1103 | previewPlugins: plasmoid.configuration.previewPlugins | 1108 | previewPlugins: plasmoid.configuration.previewPlugins | ||
1104 | appletInterface: plasmoid | 1109 | appletInterface: plasmoid | ||
1105 | 1110 | | |||
1106 | onListingCompleted: { | 1111 | onListingCompleted: { | ||
1107 | if (!gridView.model && plasmoid.expanded) { | 1112 | if (!gridView.model && plasmoid.expanded) { | ||
1108 | gridView.model = positioner; | 1113 | gridView.model = positioner; | ||
1114 | gridView.currentIndex = isPopup ? 0 : -1; | ||||
1109 | } | 1115 | } | ||
1110 | } | 1116 | } | ||
1111 | 1117 | | |||
1112 | onMove: { | 1118 | onMove: { | ||
1113 | var rows = (gridView.flow == GridView.FlowLeftToRight); | 1119 | var rows = (gridView.flow == GridView.FlowLeftToRight); | ||
1114 | var axis = rows ? gridView.width : gridView.height; | 1120 | var axis = rows ? gridView.width : gridView.height; | ||
1115 | var step = rows ? cellWidth : cellHeight; | 1121 | var step = rows ? cellWidth : cellHeight; | ||
1116 | var perStripe = Math.floor(axis / step); | 1122 | var perStripe = Math.floor(axis / step); | ||
▲ Show 20 Lines • Show All 258 Lines • Show Last 20 Lines |