Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/package/contents/ui/FolderView.qml
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 32 | Item { | |||
---|---|---|---|---|---|
56 | property alias scrollLeft: gridView.scrollLeft | 56 | property alias scrollLeft: gridView.scrollLeft | ||
57 | property alias scrollRight: gridView.scrollRight | 57 | property alias scrollRight: gridView.scrollRight | ||
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 bool listingCompleted: false | ||||
64 | 65 | | |||
65 | function rename() | 66 | function rename() | ||
66 | { | 67 | { | ||
67 | if (gridView.currentIndex != -1) { | 68 | if (gridView.currentIndex != -1) { | ||
68 | editor.targetItem = gridView.currentItem; | 69 | editor.targetItem = gridView.currentItem; | ||
69 | } | 70 | } | ||
70 | } | 71 | } | ||
71 | 72 | | |||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 143 | Connections { | |||
143 | target: dir | 144 | target: dir | ||
144 | onPopupMenuAboutToShow: { | 145 | onPopupMenuAboutToShow: { | ||
145 | if (!plasmoid.immutable) { | 146 | if (!plasmoid.immutable) { | ||
146 | plasmoid.processMimeData(mimeData, x, y, dropJob); | 147 | plasmoid.processMimeData(mimeData, x, y, dropJob); | ||
147 | } | 148 | } | ||
148 | } | 149 | } | ||
149 | } | 150 | } | ||
150 | 151 | | |||
152 | Connections { | ||||
153 | target: plasmoid | ||||
154 | onExpandedChanged: { | ||||
155 | if (plasmoid.expanded && main.listingCompleted && !gridView.model) { | ||||
156 | gridView.model = positioner; | ||||
157 | } | ||||
158 | } | ||||
159 | } | ||||
160 | | ||||
151 | // Lower the toolBox when an item is hovered, so it doesn't interfere with | 161 | // Lower the toolBox when an item is hovered, so it doesn't interfere with | ||
152 | // its interaction (e.g. the selection button in the top left, cf. Bug 337060) | 162 | // its interaction (e.g. the selection button in the top left, cf. Bug 337060) | ||
153 | Binding { | 163 | Binding { | ||
154 | target: toolBox | 164 | target: toolBox | ||
155 | property: "z" | 165 | property: "z" | ||
156 | // 999 is the default "z" for desktop ToolBoxRoot | 166 | // 999 is the default "z" for desktop ToolBoxRoot | ||
157 | value: main.hoveredItem ? -100 : 999 | 167 | value: main.hoveredItem ? -100 : 999 | ||
158 | when: toolBox | 168 | when: toolBox | ||
▲ Show 20 Lines • Show All 892 Lines • ▼ Show 20 Line(s) | 1057 | Folder.FolderModel { | |||
1051 | sortDesc: plasmoid.configuration.sortDesc | 1061 | sortDesc: plasmoid.configuration.sortDesc | ||
1052 | sortDirsFirst: plasmoid.configuration.sortDirsFirst | 1062 | sortDirsFirst: plasmoid.configuration.sortDirsFirst | ||
1053 | parseDesktopFiles: (plasmoid.configuration.url == "desktop:/") | 1063 | parseDesktopFiles: (plasmoid.configuration.url == "desktop:/") | ||
1054 | previews: plasmoid.configuration.previews | 1064 | previews: plasmoid.configuration.previews | ||
1055 | previewPlugins: plasmoid.configuration.previewPlugins | 1065 | previewPlugins: plasmoid.configuration.previewPlugins | ||
1056 | 1066 | | |||
1057 | onListingStarted: { | 1067 | onListingStarted: { | ||
1058 | if (!gridView.model) { | 1068 | if (!gridView.model) { | ||
1069 | main.listingCompleted = false; | ||||
1059 | plasmoid.busy = true; | 1070 | plasmoid.busy = true; | ||
1060 | } | 1071 | } | ||
1061 | } | 1072 | } | ||
1062 | 1073 | | |||
1063 | onListingCompleted: { | 1074 | onListingCompleted: { | ||
1064 | if (!gridView.model) { | 1075 | if (!gridView.model) { | ||
1065 | plasmoid.busy = false; | 1076 | plasmoid.busy = false; | ||
1077 | main.listingCompleted = true; | ||||
1078 | // Delay delegate creation until applet is opened for the first time. | ||||
1079 | if (plasmoid.expanded) { | ||||
1066 | gridView.model = positioner; | 1080 | gridView.model = positioner; | ||
1067 | } | 1081 | } | ||
1068 | } | 1082 | } | ||
1083 | } | ||||
1069 | 1084 | | |||
1070 | onListingCanceled: plasmoid.busy = false; | 1085 | onListingCanceled: plasmoid.busy = false; | ||
1071 | 1086 | | |||
1072 | onMove: { | 1087 | onMove: { | ||
1073 | var rows = (gridView.flow == GridView.FlowLeftToRight); | 1088 | var rows = (gridView.flow == GridView.FlowLeftToRight); | ||
1074 | var axis = rows ? gridView.width : gridView.height; | 1089 | var axis = rows ? gridView.width : gridView.height; | ||
1075 | var step = rows ? cellWidth : cellHeight; | 1090 | var step = rows ? cellWidth : cellHeight; | ||
1076 | var perStripe = Math.floor(axis / step); | 1091 | var perStripe = Math.floor(axis / step); | ||
▲ Show 20 Lines • Show All 243 Lines • Show Last 20 Lines |