Changeset View
Changeset View
Standalone View
Standalone View
src/qml/FileBrowserView.qml
Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Line(s) | 95 | Rectangle { | |||
---|---|---|---|---|---|
99 | Layout.fillWidth: true | 99 | Layout.fillWidth: true | ||
100 | clip: true | 100 | clip: true | ||
101 | 101 | | |||
102 | GridView { | 102 | GridView { | ||
103 | id: contentDirectoryView | 103 | id: contentDirectoryView | ||
104 | anchors.topMargin: 20 | 104 | anchors.topMargin: 20 | ||
105 | anchors.fill: parent | 105 | anchors.fill: parent | ||
106 | 106 | | |||
107 | focus: true | 107 | activeFocusOnTab: true | ||
108 | keyNavigationEnabled: true | ||||
108 | 109 | | |||
109 | ScrollBar.vertical: ScrollBar { | 110 | ScrollBar.vertical: ScrollBar { | ||
110 | id: scrollBar | 111 | id: scrollBar | ||
111 | } | 112 | } | ||
112 | boundsBehavior: Flickable.StopAtBounds | 113 | boundsBehavior: Flickable.StopAtBounds | ||
113 | 114 | | |||
115 | currentIndex: -1 | ||||
116 | | ||||
114 | model: proxyModel | 117 | model: proxyModel | ||
115 | 118 | | |||
116 | ScrollHelper { | 119 | ScrollHelper { | ||
117 | id: scrollHelper | 120 | id: scrollHelper | ||
118 | flickable: contentDirectoryView | 121 | flickable: contentDirectoryView | ||
119 | anchors.fill: contentDirectoryView | 122 | anchors.fill: contentDirectoryView | ||
120 | } | 123 | } | ||
121 | 124 | | |||
Show All 16 Lines | |||||
138 | } | 141 | } | ||
139 | 142 | | |||
140 | cellWidth: elisaTheme.gridDelegateWidth | 143 | cellWidth: elisaTheme.gridDelegateWidth | ||
141 | cellHeight:elisaTheme.gridDelegateHeight | 144 | cellHeight:elisaTheme.gridDelegateHeight | ||
142 | 145 | | |||
143 | delegate: FileBrowserDelegate { | 146 | delegate: FileBrowserDelegate { | ||
144 | width: contentDirectoryView.cellWidth | 147 | width: contentDirectoryView.cellWidth | ||
145 | height: contentDirectoryView.cellHeight | 148 | height: contentDirectoryView.cellHeight | ||
149 | | ||||
146 | focus: true | 150 | focus: true | ||
147 | 151 | | |||
152 | isSelected: contentDirectoryView.currentIndex === index | ||||
153 | | ||||
148 | isDirectory: model.directory | 154 | isDirectory: model.directory | ||
149 | isPlayList: model.isPlaylist | 155 | isPlayList: model.isPlaylist | ||
150 | fileName: model.name | 156 | fileName: model.name | ||
151 | fileUrl: model.containerData | 157 | fileUrl: model.containerData | ||
152 | imageUrl: model.imageUrl | 158 | imageUrl: model.imageUrl | ||
153 | contentModel: proxyModel | 159 | contentModel: proxyModel | ||
154 | 160 | | |||
155 | onEnqueue: elisa.mediaPlayList.enqueue(0, data, ElisaUtils.FileName, ElisaUtils.AppendPlayList, ElisaUtils.DoNotTriggerPlay) | 161 | onEnqueue: elisa.mediaPlayList.enqueue(0, data, ElisaUtils.FileName, ElisaUtils.AppendPlayList, ElisaUtils.DoNotTriggerPlay) | ||
156 | onReplaceAndPlay: elisa.mediaPlayList.enqueue(0, data, ElisaUtils.FileName, ElisaUtils.ReplacePlayList, ElisaUtils.TriggerPlay) | 162 | onReplaceAndPlay: elisa.mediaPlayList.enqueue(0, data, ElisaUtils.FileName, ElisaUtils.ReplacePlayList, ElisaUtils.TriggerPlay) | ||
157 | onSelected: { | 163 | onSelected: { | ||
158 | forceActiveFocus() | 164 | forceActiveFocus() | ||
159 | contentDirectoryView.currentIndex = model.index | 165 | contentDirectoryView.currentIndex = model.index | ||
160 | } | 166 | } | ||
167 | | ||||
168 | onActiveFocusChanged: { | ||||
169 | if (activeFocus && contentDirectoryView.currentIndex !== model.index) { | ||||
170 | contentDirectoryView.currentIndex = model.index | ||||
171 | } | ||||
172 | } | ||||
173 | | ||||
161 | onOpen: loadFolderAndClear(data) | 174 | onOpen: loadFolderAndClear(data) | ||
162 | } | 175 | } | ||
163 | } | 176 | } | ||
164 | } | 177 | } | ||
165 | } | 178 | } | ||
166 | } | 179 | } |