Changeset View
Changeset View
Standalone View
Standalone View
src/qml/NavigationActionBar.qml
Show All 15 Lines | |||||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | import QtQml 2.2 | 18 | import QtQml 2.2 | ||
19 | import QtQuick 2.7 | 19 | import QtQuick 2.7 | ||
20 | import QtQuick.Layouts 1.3 | 20 | import QtQuick.Layouts 1.3 | ||
21 | import QtQuick.Controls 2.2 | 21 | import QtQuick.Controls 2.2 | ||
22 | import QtQuick.Controls 1.4 as Controls1 | 22 | import QtQuick.Controls 1.4 as Controls1 | ||
23 | 23 | | |||
24 | FocusScope { | 24 | ColumnLayout { | ||
25 | id: navigationBar | 25 | id: navigationBar | ||
26 | 26 | | |||
27 | spacing: 0 | ||||
28 | | ||||
29 | anchors.topMargin: elisaTheme.layoutVerticalMargin | ||||
30 | anchors.bottomMargin: elisaTheme.layoutVerticalMargin | ||||
31 | | ||||
27 | property string mainTitle | 32 | property string mainTitle | ||
28 | property string secondaryTitle | 33 | property string secondaryTitle | ||
29 | property url image | 34 | property url image | ||
30 | property bool allowArtistNavigation: false | 35 | property bool allowArtistNavigation: false | ||
31 | 36 | | |||
32 | property string labelText | 37 | property string labelText | ||
33 | property bool showRating: true | 38 | property bool showRating: true | ||
34 | property alias filterText: filterTextInput.text | 39 | property alias filterText: filterTextInput.text | ||
Show All 33 Lines | |||||
68 | 73 | | |||
69 | Controls1.Action { | 74 | Controls1.Action { | ||
70 | id: sortAction | 75 | id: sortAction | ||
71 | text: i18nc("Toggle between ascending and descending order", "Toggle sort order") | 76 | text: i18nc("Toggle between ascending and descending order", "Toggle sort order") | ||
72 | iconName: sortOrder ? "view-sort-ascending" : "view-sort-descending" | 77 | iconName: sortOrder ? "view-sort-ascending" : "view-sort-descending" | ||
73 | onTriggered: sortOrder ? sort(Qt.DescendingOrder) : sort(Qt.AscendingOrder) | 78 | onTriggered: sortOrder ? sort(Qt.DescendingOrder) : sort(Qt.AscendingOrder) | ||
74 | } | 79 | } | ||
75 | 80 | | |||
76 | ColumnLayout { | | |||
77 | anchors.fill: parent | | |||
78 | spacing: 0 | | |||
79 | | ||||
80 | anchors.topMargin: elisaTheme.layoutVerticalMargin | | |||
81 | anchors.bottomMargin: elisaTheme.layoutVerticalMargin | | |||
82 | | ||||
83 | RowLayout { | 81 | RowLayout { | ||
84 | spacing: 0 | 82 | spacing: 0 | ||
85 | Layout.alignment: Qt.AlignTop | 83 | Layout.alignment: Qt.AlignTop | ||
86 | Layout.preferredHeight: elisaTheme.navigationBarHeight | 84 | Layout.preferredHeight: elisaTheme.navigationBarHeight | ||
87 | Layout.minimumHeight: elisaTheme.navigationBarHeight | 85 | Layout.minimumHeight: elisaTheme.navigationBarHeight | ||
88 | Layout.maximumHeight: elisaTheme.navigationBarHeight | 86 | Layout.maximumHeight: elisaTheme.navigationBarHeight | ||
89 | 87 | | |||
90 | Controls1.ToolButton { | 88 | Controls1.ToolButton { | ||
91 | action: goPreviousAction | 89 | action: goPreviousAction | ||
92 | objectName: 'goPreviousButton' | 90 | objectName: 'goPreviousButton' | ||
93 | 91 | | |||
94 | Keys.onReturnPressed: action.trigger() | 92 | Keys.onReturnPressed: action.trigger() | ||
95 | 93 | | |||
94 | activeFocusOnTab: true | ||||
95 | focus: enableGoBack | ||||
96 | | ||||
96 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | 97 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | ||
97 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | 98 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | ||
98 | visible: enableGoBack | 99 | visible: enableGoBack | ||
99 | } | 100 | } | ||
100 | 101 | | |||
101 | Image { | 102 | Image { | ||
102 | id: mainIcon | 103 | id: mainIcon | ||
103 | source: image | 104 | source: image | ||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Line(s) | 178 | RowLayout { | |||
179 | spacing: 0 | 180 | spacing: 0 | ||
180 | Layout.bottomMargin: secondaryTitle !== "" ? 0 : 14 | 181 | Layout.bottomMargin: secondaryTitle !== "" ? 0 : 14 | ||
181 | 182 | | |||
182 | Controls1.Button { | 183 | Controls1.Button { | ||
183 | objectName: 'enqueueButton' | 184 | objectName: 'enqueueButton' | ||
184 | text: i18nc("Add current list to playlist", "Enqueue") | 185 | text: i18nc("Add current list to playlist", "Enqueue") | ||
185 | iconName: "media-track-add-amarok" | 186 | iconName: "media-track-add-amarok" | ||
186 | 187 | | |||
188 | activeFocusOnTab: true | ||||
189 | focus: true | ||||
190 | | ||||
187 | onClicked: enqueue() | 191 | onClicked: enqueue() | ||
188 | Keys.onReturnPressed: enqueue() | 192 | Keys.onReturnPressed: enqueue() | ||
189 | 193 | | |||
190 | Layout.leftMargin: 0 | 194 | Layout.leftMargin: 0 | ||
191 | Layout.rightMargin: 0 | 195 | Layout.rightMargin: 0 | ||
192 | } | 196 | } | ||
193 | 197 | | |||
194 | Controls1.Button { | 198 | Controls1.Button { | ||
195 | objectName: 'replaceAndPlayButton' | 199 | objectName: 'replaceAndPlayButton' | ||
196 | text: i18nc("Clear playlist and play", "Replace and Play") | 200 | text: i18nc("Clear playlist and play", "Replace and Play") | ||
197 | tooltip: i18nc("Clear playlist and add current list to it", "Replace PlayList and Play Now") | 201 | tooltip: i18nc("Clear playlist and add current list to it", "Replace PlayList and Play Now") | ||
198 | iconName: "media-playback-start" | 202 | iconName: "media-playback-start" | ||
199 | 203 | | |||
204 | activeFocusOnTab: true | ||||
205 | | ||||
200 | onClicked: replaceAndPlay() | 206 | onClicked: replaceAndPlay() | ||
201 | Keys.onReturnPressed: replaceAndPlay() | 207 | Keys.onReturnPressed: replaceAndPlay() | ||
202 | 208 | | |||
203 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | 209 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | ||
204 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | 210 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | ||
205 | } | 211 | } | ||
206 | 212 | | |||
207 | Controls1.Button { | 213 | Controls1.Button { | ||
208 | objectName: 'showArtistButton' | 214 | objectName: 'showArtistButton' | ||
209 | id: showArtistButton | 215 | id: showArtistButton | ||
210 | 216 | | |||
211 | visible: allowArtistNavigation | 217 | visible: allowArtistNavigation | ||
212 | text: i18nc("Button to navigate to the artist of the album", "Display Artist") | 218 | text: i18nc("Button to navigate to the artist of the album", "Display Artist") | ||
213 | iconName: "view-media-artist" | 219 | iconName: "view-media-artist" | ||
214 | 220 | | |||
221 | activeFocusOnTab: true | ||||
222 | | ||||
215 | onClicked: showArtist() | 223 | onClicked: showArtist() | ||
216 | Keys.onReturnPressed: showArtist() | 224 | Keys.onReturnPressed: showArtist() | ||
217 | 225 | | |||
218 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | 226 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | ||
219 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | 227 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | ||
220 | } | 228 | } | ||
221 | 229 | | |||
222 | Item { | 230 | Item { | ||
223 | Layout.fillWidth: true | 231 | Layout.fillWidth: true | ||
224 | } | 232 | } | ||
225 | 233 | | |||
226 | Controls1.ToolButton { | 234 | Controls1.ToolButton { | ||
227 | action: showFilterAction | 235 | action: showFilterAction | ||
228 | objectName: 'showFilterButton' | 236 | objectName: 'showFilterButton' | ||
229 | 237 | | |||
238 | activeFocusOnTab: true | ||||
239 | | ||||
230 | Keys.onReturnPressed: action.trigger() | 240 | Keys.onReturnPressed: action.trigger() | ||
231 | 241 | | |||
232 | Layout.alignment: Qt.AlignRight | 242 | Layout.alignment: Qt.AlignRight | ||
233 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | 243 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | ||
234 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | 244 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | ||
235 | } | 245 | } | ||
236 | } | 246 | } | ||
237 | } | 247 | } | ||
▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Line(s) | 354 | Item { | |||
345 | Layout.fillWidth: true | 355 | Layout.fillWidth: true | ||
346 | implicitWidth: elisaTheme.layoutHorizontalMargin * 4 | 356 | implicitWidth: elisaTheme.layoutHorizontalMargin * 4 | ||
347 | } | 357 | } | ||
348 | 358 | | |||
349 | Controls1.ToolButton { | 359 | Controls1.ToolButton { | ||
350 | action: sortAction | 360 | action: sortAction | ||
351 | objectName: 'sortAscendingButton' | 361 | objectName: 'sortAscendingButton' | ||
352 | 362 | | |||
363 | activeFocusOnTab: true | ||||
364 | | ||||
353 | Keys.onReturnPressed: action.trigger() | 365 | Keys.onReturnPressed: action.trigger() | ||
354 | 366 | | |||
355 | Layout.alignment: Qt.AlignRight | 367 | Layout.alignment: Qt.AlignRight | ||
356 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | 368 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | ||
357 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | 369 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | ||
358 | visible: enableSorting | 370 | visible: enableSorting | ||
359 | } | 371 | } | ||
360 | } | 372 | } | ||
361 | } | | |||
362 | 373 | | |||
363 | states: [ | 374 | states: [ | ||
364 | State { | 375 | State { | ||
365 | name: 'collapsed' | 376 | name: 'collapsed' | ||
366 | when: !expandedFilterView | 377 | when: !expandedFilterView | ||
367 | PropertyChanges { | 378 | PropertyChanges { | ||
368 | target: navigationBar | 379 | target: navigationBar | ||
369 | height: elisaTheme.navigationBarHeight + elisaTheme.layoutVerticalMargin * 2 | 380 | height: elisaTheme.navigationBarHeight + elisaTheme.layoutVerticalMargin * 2 | ||
Show All 33 Lines |