Changeset View
Changeset View
Standalone View
Standalone View
src/qml/MediaPlayListView.qml
Show All 34 Lines | 29 | FocusScope { | |||
---|---|---|---|---|---|
35 | signal startPlayback() | 35 | signal startPlayback() | ||
36 | signal pausePlayback() | 36 | signal pausePlayback() | ||
37 | signal displayError(var errorText) | 37 | signal displayError(var errorText) | ||
38 | 38 | | |||
39 | id: topItem | 39 | id: topItem | ||
40 | 40 | | |||
41 | Controls1.Action { | 41 | Controls1.Action { | ||
42 | id: clearPlayList | 42 | id: clearPlayList | ||
43 | text: i18nc("Remove all tracks from play list", "Clear Play List") | 43 | text: i18nc("Remove all tracks from play list", "Clear Playlist") | ||
44 | iconName: "list-remove" | 44 | iconName: "list-remove" | ||
45 | enabled: playListModelDelegate.items.count > 0 | 45 | enabled: playListModelDelegate.items.count > 0 | ||
46 | onTriggered: playListModel.clearPlayList() | 46 | onTriggered: playListModel.clearPlayList() | ||
47 | } | 47 | } | ||
48 | 48 | | |||
49 | Controls1.Action { | 49 | Controls1.Action { | ||
50 | id: showCurrentTrack | 50 | id: showCurrentTrack | ||
51 | text: i18nc("Show currently played track inside playlist", "Show Current Track") | 51 | text: i18nc("Show currently played track inside playlist", "Show Current Track") | ||
52 | iconName: 'media-show-active-track-amarok' | 52 | iconName: 'media-show-active-track-amarok' | ||
53 | enabled: playListModelDelegate.items.count > 0 | 53 | enabled: playListModelDelegate.items.count > 0 | ||
54 | onTriggered: { | 54 | onTriggered: { | ||
55 | playListView.positionViewAtIndex(playListModel.currentTrackRow, ListView.Contain) | 55 | playListView.positionViewAtIndex(playListModel.currentTrackRow, ListView.Contain) | ||
56 | playListView.currentIndex = playListModel.currentTrackRow | 56 | playListView.currentIndex = playListModel.currentTrackRow | ||
57 | playListView.currentItem.forceActiveFocus() | 57 | playListView.currentItem.forceActiveFocus() | ||
58 | } | 58 | } | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | Controls1.Action { | 61 | Controls1.Action { | ||
62 | id: loadPlaylist | 62 | id: loadPlaylist | ||
63 | text: i18nc("Load a playlist file", "Load a Playlist") | 63 | text: i18nc("Load a playlist file", "Load Playlist...") | ||
64 | iconName: 'document-open' | 64 | iconName: 'document-open' | ||
65 | onTriggered: | 65 | onTriggered: | ||
66 | { | 66 | { | ||
67 | fileDialog.fileMode = PlatformDialog.FileDialog.OpenFile | 67 | fileDialog.fileMode = PlatformDialog.FileDialog.OpenFile | ||
68 | fileDialog.file = '' | 68 | fileDialog.file = '' | ||
69 | fileDialog.open() | 69 | fileDialog.open() | ||
70 | } | 70 | } | ||
71 | } | 71 | } | ||
72 | 72 | | |||
73 | Controls1.Action { | 73 | Controls1.Action { | ||
74 | id: savePlaylist | 74 | id: savePlaylist | ||
75 | text: i18nc("Save a playlist file", "Save a Playlist") | 75 | text: i18nc("Save a playlist file", "Save Playlist...") | ||
76 | iconName: 'document-save' | 76 | iconName: 'document-save' | ||
77 | enabled: playListModelDelegate.items.count > 0 | 77 | enabled: playListModelDelegate.items.count > 0 | ||
78 | onTriggered: | 78 | onTriggered: | ||
79 | { | 79 | { | ||
80 | fileDialog.fileMode = PlatformDialog.FileDialog.SaveFile | 80 | fileDialog.fileMode = PlatformDialog.FileDialog.SaveFile | ||
81 | fileDialog.file = '' | 81 | fileDialog.file = '' | ||
82 | fileDialog.open() | 82 | fileDialog.open() | ||
83 | } | 83 | } | ||
Show All 24 Lines | 105 | ColumnLayout { | |||
108 | 108 | | |||
109 | ColumnLayout { | 109 | ColumnLayout { | ||
110 | height: elisaTheme.navigationBarHeight | 110 | height: elisaTheme.navigationBarHeight | ||
111 | Layout.preferredHeight: elisaTheme.navigationBarHeight | 111 | Layout.preferredHeight: elisaTheme.navigationBarHeight | ||
112 | Layout.minimumHeight: elisaTheme.navigationBarHeight | 112 | Layout.minimumHeight: elisaTheme.navigationBarHeight | ||
113 | Layout.maximumHeight: elisaTheme.navigationBarHeight | 113 | Layout.maximumHeight: elisaTheme.navigationBarHeight | ||
114 | spacing: 0 | 114 | spacing: 0 | ||
115 | 115 | | |||
116 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | 116 | Layout.leftMargin: elisaTheme.layoutHorizontalMargin | ||
117 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | 117 | Layout.rightMargin: elisaTheme.layoutHorizontalMargin | ||
118 | 118 | | |||
119 | TextMetrics { | 119 | TextMetrics { | ||
120 | id: titleHeight | 120 | id: titleHeight | ||
121 | text: viewTitleHeight.text | 121 | text: viewTitleHeight.text | ||
122 | font | 122 | font | ||
123 | { | 123 | { | ||
124 | pointSize: viewTitleHeight.font.pointSize | 124 | pointSize: viewTitleHeight.font.pointSize | ||
125 | bold: viewTitleHeight.font.bold | 125 | bold: viewTitleHeight.font.bold | ||
126 | } | 126 | } | ||
127 | } | 127 | } | ||
128 | 128 | | |||
129 | LabelWithToolTip { | 129 | LabelWithToolTip { | ||
130 | id: viewTitleHeight | 130 | id: viewTitleHeight | ||
131 | text: i18nc("Title of the view of the playlist", "Now Playing") | 131 | text: i18nc("Title of the view of the playlist", "Playlist") | ||
132 | 132 | | |||
133 | color: myPalette.text | 133 | color: myPalette.text | ||
134 | font.pointSize: elisaTheme.defaultFontPointSize * 2 | 134 | font.pointSize: elisaTheme.defaultFontPointSize * 2 | ||
135 | Layout.topMargin: elisaTheme.layoutVerticalMargin | 135 | Layout.alignment: Qt.AlignLeft | Qt.AlignTop | ||
136 | Layout.topMargin: elisaTheme.layoutVerticalMargin * 3 | ||||
136 | } | 137 | } | ||
137 | 138 | | |||
139 | | ||||
140 | RowLayout { | ||||
141 | Layout.fillWidth: true | ||||
142 | | ||||
138 | LabelWithToolTip { | 143 | LabelWithToolTip { | ||
139 | id: playListInfo | 144 | id: playListInfo | ||
140 | 145 | | |||
141 | text: i18np("1 track", "%1 tracks", playListModel.tracksCount) | 146 | text: i18np("1 track", "%1 tracks", playListModel.tracksCount) | ||
142 | | ||||
143 | color: myPalette.text | 147 | color: myPalette.text | ||
144 | | ||||
145 | Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter | 148 | Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter | ||
146 | } | 149 | } | ||
147 | 150 | | |||
148 | Item { | 151 | Item { Layout.fillWidth: true } | ||
149 | Layout.fillHeight: true | 152 | | ||
153 | Controls1.ToolButton { action: showCurrentTrack } | ||||
154 | Controls1.ToolButton { action: savePlaylist } | ||||
155 | Controls1.ToolButton { action: loadPlaylist } | ||||
156 | Controls1.ToolButton { action: clearPlayList } | ||||
150 | } | 157 | } | ||
158 | | ||||
159 | Item { Layout.fillHeight: true } | ||||
160 | | ||||
151 | } | 161 | } | ||
152 | 162 | | |||
163 | | ||||
153 | ListView { | 164 | ListView { | ||
154 | id: playListView | 165 | id: playListView | ||
155 | Layout.fillWidth: true | 166 | Layout.fillWidth: true | ||
156 | Layout.fillHeight: true | 167 | Layout.fillHeight: true | ||
168 | Layout.topMargin: elisaTheme.layoutVerticalMargin | ||||
157 | 169 | | |||
158 | focus: true | 170 | focus: true | ||
159 | 171 | | |||
160 | ScrollBar.vertical: ScrollBar { | 172 | ScrollBar.vertical: ScrollBar { | ||
161 | id: scrollBar | 173 | id: scrollBar | ||
162 | } | 174 | } | ||
163 | boundsBehavior: Flickable.StopAtBounds | 175 | boundsBehavior: Flickable.StopAtBounds | ||
164 | clip: true | 176 | clip: true | ||
▲ Show 20 Lines • Show All 118 Lines • ▼ Show 20 Line(s) | 232 | delegate: DraggableItem { | |||
283 | 295 | | |||
284 | onMoveItemRequested: { | 296 | onMoveItemRequested: { | ||
285 | playListModel.move(from, to, 1); | 297 | playListModel.move(from, to, 1); | ||
286 | } | 298 | } | ||
287 | } | 299 | } | ||
288 | } | 300 | } | ||
289 | } | 301 | } | ||
290 | 302 | | |||
291 | Rectangle { | | |||
292 | id: actionBar | | |||
293 | 303 | | |||
294 | Layout.fillWidth: true | | |||
295 | Layout.topMargin: elisaTheme.layoutVerticalMargin | | |||
296 | Layout.preferredHeight: elisaTheme.delegateToolButtonSize | | |||
297 | | ||||
298 | color: myPalette.mid | | |||
299 | | ||||
300 | RowLayout { | | |||
301 | id: actionBarLayout | | |||
302 | | ||||
303 | anchors.fill: parent | | |||
304 | | ||||
305 | Controls1.ToolButton { | | |||
306 | action: clearPlayList | | |||
307 | Layout.bottomMargin: elisaTheme.layoutVerticalMargin | | |||
308 | } | | |||
309 | Controls1.ToolButton { | | |||
310 | action: showCurrentTrack | | |||
311 | Layout.bottomMargin: elisaTheme.layoutVerticalMargin | | |||
312 | } | | |||
313 | Controls1.ToolButton { | | |||
314 | action: loadPlaylist | | |||
315 | Layout.bottomMargin: elisaTheme.layoutVerticalMargin | | |||
316 | } | | |||
317 | Controls1.ToolButton { | | |||
318 | action: savePlaylist | | |||
319 | Layout.bottomMargin: elisaTheme.layoutVerticalMargin | | |||
320 | } | | |||
321 | Item { | | |||
322 | Layout.fillWidth: true | | |||
323 | } | | |||
324 | } | | |||
325 | } | | |||
326 | } | 304 | } | ||
327 | } | 305 | } | ||
328 | 306 | | |||
329 | 307 | |