Changeset View
Changeset View
Standalone View
Standalone View
src/qml/PlayListEntry.qml
Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Line(s) | 118 | Rectangle { | |||
---|---|---|---|---|---|
122 | anchors.rightMargin: LayoutMirroring.enabled ? scrollBarWidth : 0 | 122 | anchors.rightMargin: LayoutMirroring.enabled ? scrollBarWidth : 0 | ||
123 | z: 1 | 123 | z: 1 | ||
124 | 124 | | |||
125 | color: myPalette.base | 125 | color: myPalette.base | ||
126 | 126 | | |||
127 | height: elisaTheme.playListDelegateHeight | 127 | height: elisaTheme.playListDelegateHeight | ||
128 | } | 128 | } | ||
129 | 129 | | |||
130 | ColumnLayout { | | |||
131 | spacing: 0 | | |||
132 | | ||||
133 | anchors.fill: parent | | |||
134 | anchors.rightMargin: LayoutMirroring.enabled ? scrollBarWidth : 0 | | |||
135 | z: 2 | | |||
136 | | ||||
137 | Item { | | |||
138 | Layout.fillWidth: true | | |||
139 | Layout.fillHeight: true | | |||
140 | | ||||
141 | RowLayout { | 130 | RowLayout { | ||
142 | id: trackRow | 131 | id: trackRow | ||
132 | z: 2 | ||||
143 | 133 | | |||
144 | anchors.fill: parent | 134 | anchors.fill: parent | ||
145 | anchors.leftMargin: elisaTheme.layoutHorizontalMargin | 135 | anchors.leftMargin: elisaTheme.layoutHorizontalMargin | ||
136 | anchors.rightMargin: LayoutMirroring.enabled ? scrollBarWidth : 0 | ||||
146 | 137 | | |||
147 | spacing: elisaTheme.layoutHorizontalMargin / 4 | 138 | spacing: elisaTheme.layoutHorizontalMargin / 4 | ||
148 | 139 | | |||
149 | Item { | 140 | Item { | ||
150 | id: playIconItem | 141 | id: playIconItem | ||
151 | 142 | | |||
152 | implicitHeight: elisaTheme.smallDelegateToolButtonSize | 143 | implicitHeight: elisaTheme.playListDelegateHeight | ||
153 | implicitWidth: elisaTheme.smallDelegateToolButtonSize | 144 | implicitWidth: elisaTheme.playListDelegateHeight | ||
154 | Layout.maximumWidth: elisaTheme.smallDelegateToolButtonSize | 145 | Layout.maximumWidth: elisaTheme.playListDelegateHeight | ||
155 | Layout.maximumHeight: elisaTheme.smallDelegateToolButtonSize | 146 | Layout.maximumHeight: elisaTheme.playListDelegateHeight | ||
156 | Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | 147 | Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
157 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin / 2 : 0 | 148 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin / 2 : 0 | ||
158 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin / 2 : 0 | 149 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin / 2 : 0 | ||
159 | 150 | | |||
160 | Image { | 151 | Image { | ||
161 | id: playIcon | 152 | id: playIcon | ||
162 | 153 | | |||
163 | anchors.fill: parent | 154 | anchors.centerIn: parent | ||
164 | 155 | | |||
165 | opacity: 0 | 156 | opacity: 0 | ||
166 | 157 | | |||
167 | source: (isPlaying === MediaPlayList.IsPlaying ? | 158 | source: (isPlaying === MediaPlayList.IsPlaying ? | ||
168 | Qt.resolvedUrl(elisaTheme.playingIndicatorIcon) : Qt.resolvedUrl(elisaTheme.pausedIndicatorIcon)) | 159 | Qt.resolvedUrl(elisaTheme.playingIndicatorIcon) : Qt.resolvedUrl(elisaTheme.pausedIndicatorIcon)) | ||
169 | 160 | | |||
170 | width: parent.height * 1. | 161 | width: elisaTheme.smallControlButtonSize | ||
171 | height: parent.height * 1. | 162 | height: elisaTheme.smallControlButtonSize | ||
172 | 163 | | |||
173 | sourceSize.width: parent.height * 1. | 164 | sourceSize.width: elisaTheme.smallControlButtonSize | ||
174 | sourceSize.height: parent.height * 1. | 165 | sourceSize.height: elisaTheme.smallControlButtonSize | ||
175 | fillMode: Image.PreserveAspectFit | 166 | fillMode: Image.PreserveAspectFit | ||
176 | mirror: LayoutMirroring.enabled | 167 | mirror: LayoutMirroring.enabled | ||
177 | visible: opacity > 0.0 | 168 | visible: opacity > 0.0 | ||
178 | } | 169 | } | ||
179 | } | 170 | } | ||
180 | 171 | | |||
181 | Item { | 172 | Item { | ||
182 | id: fakeDiscNumberItem | 173 | id: fakeDiscNumberItem | ||
Show All 11 Lines | |||||
194 | } | 185 | } | ||
195 | } | 186 | } | ||
196 | 187 | | |||
197 | Label { | 188 | Label { | ||
198 | id: trackNumberLabel | 189 | id: trackNumberLabel | ||
199 | 190 | | |||
200 | horizontalAlignment: Text.AlignRight | 191 | horizontalAlignment: Text.AlignRight | ||
201 | 192 | | |||
202 | text: trackNumber !== 0 && trackNumber !== -1 ? Number(trackNumber).toLocaleString(Qt.locale(), 'f', 0) : '' | 193 | text: trackNumber !== -1 ? Number(trackNumber).toLocaleString(Qt.locale(), 'f', 0) : '' | ||
203 | 194 | | |||
204 | font.weight: (isPlaying ? Font.Bold : Font.Light) | 195 | font.weight: (isPlaying ? Font.Bold : Font.Light) | ||
205 | color: myPalette.text | 196 | color: myPalette.text | ||
206 | 197 | | |||
207 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | 198 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||
208 | 199 | | |||
209 | visible: isValid | 200 | visible: isValid | ||
210 | 201 | | |||
▲ Show 20 Lines • Show All 118 Lines • ▼ Show 20 Line(s) | 319 | Item { | |||
329 | Layout.fillWidth: true | 320 | Layout.fillWidth: true | ||
330 | Layout.preferredWidth: 0 | 321 | Layout.preferredWidth: 0 | ||
331 | } | 322 | } | ||
332 | 323 | | |||
333 | FlatButtonWithToolTip { | 324 | FlatButtonWithToolTip { | ||
334 | id: infoButton | 325 | id: infoButton | ||
335 | objectName: 'infoButton' | 326 | objectName: 'infoButton' | ||
336 | 327 | | |||
337 | implicitHeight: elisaTheme.smallDelegateToolButtonSize | 328 | implicitHeight: elisaTheme.playListDelegateHeight | ||
338 | implicitWidth: elisaTheme.smallDelegateToolButtonSize | 329 | implicitWidth: elisaTheme.playListDelegateHeight | ||
339 | icon.height: elisaTheme.smallControlButtonSize | 330 | icon.height: elisaTheme.smallControlButtonSize | ||
340 | icon.width: elisaTheme.smallControlButtonSize | 331 | icon.width: elisaTheme.smallControlButtonSize | ||
341 | 332 | | |||
342 | opacity: 0 | 333 | opacity: 0 | ||
343 | 334 | | |||
344 | visible: opacity > 0.1 | 335 | visible: opacity > 0.1 | ||
345 | 336 | | |||
346 | action: showInfo | 337 | action: showInfo | ||
347 | Accessible.onPressAction: action.trigger() | | |||
348 | 338 | | |||
349 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | 339 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||
350 | } | 340 | } | ||
351 | 341 | | |||
352 | FlatButtonWithToolTip { | 342 | FlatButtonWithToolTip { | ||
353 | id: playPauseButton | 343 | id: playPauseButton | ||
354 | objectName: 'playPauseButton' | 344 | objectName: 'playPauseButton' | ||
355 | 345 | | |||
356 | implicitHeight: elisaTheme.smallDelegateToolButtonSize | 346 | implicitHeight: elisaTheme.playListDelegateHeight | ||
357 | implicitWidth: elisaTheme.smallDelegateToolButtonSize | 347 | implicitWidth: elisaTheme.playListDelegateHeight | ||
358 | icon.height: elisaTheme.smallControlButtonSize | 348 | icon.height: elisaTheme.smallControlButtonSize | ||
359 | icon.width: elisaTheme.smallControlButtonSize | 349 | icon.width: elisaTheme.smallControlButtonSize | ||
360 | 350 | | |||
361 | opacity: 0 | 351 | opacity: 0 | ||
362 | 352 | | |||
363 | scale: LayoutMirroring.enabled ? -1 : 1 // We can mirror the symmetrical pause icon | 353 | scale: LayoutMirroring.enabled ? -1 : 1 // We can mirror the symmetrical pause icon | ||
364 | 354 | | |||
365 | visible: opacity > 0.1 | 355 | visible: opacity > 0.1 | ||
366 | action: !(isPlaying === MediaPlayList.IsPlaying) ? playNow : pauseNow | 356 | action: !(isPlaying === MediaPlayList.IsPlaying) ? playNow : pauseNow | ||
367 | Accessible.onPressAction: action.trigger() | | |||
368 | 357 | | |||
369 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | 358 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||
370 | } | 359 | } | ||
371 | 360 | | |||
372 | FlatButtonWithToolTip { | 361 | FlatButtonWithToolTip { | ||
373 | id: removeButton | 362 | id: removeButton | ||
374 | objectName: 'removeButton' | 363 | objectName: 'removeButton' | ||
375 | 364 | | |||
376 | opacity: 0 | 365 | opacity: 0 | ||
377 | 366 | | |||
378 | visible: opacity > 0.1 | 367 | visible: opacity > 0.1 | ||
379 | action: removeFromPlayList | 368 | action: removeFromPlayList | ||
380 | Accessible.onPressAction: action.trigger() | | |||
381 | 369 | | |||
382 | implicitHeight: elisaTheme.smallDelegateToolButtonSize | 370 | implicitHeight: elisaTheme.playListDelegateHeight | ||
383 | implicitWidth: elisaTheme.smallDelegateToolButtonSize | 371 | implicitWidth: elisaTheme.playListDelegateHeight | ||
384 | icon.height: elisaTheme.smallControlButtonSize | 372 | icon.height: elisaTheme.smallControlButtonSize | ||
385 | icon.width: elisaTheme.smallControlButtonSize | 373 | icon.width: elisaTheme.smallControlButtonSize | ||
386 | } | 374 | } | ||
387 | 375 | | |||
388 | RatingStar { | 376 | RatingStar { | ||
389 | id: ratingWidget | 377 | id: ratingWidget | ||
390 | 378 | | |||
391 | starRating: rating | 379 | starRating: rating | ||
Show All 13 Lines | 386 | LabelWithToolTip { | |||
405 | 393 | | |||
406 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | 394 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight | ||
407 | Layout.leftMargin: elisaTheme.layoutHorizontalMargin | 395 | Layout.leftMargin: elisaTheme.layoutHorizontalMargin | ||
408 | Layout.rightMargin: elisaTheme.layoutHorizontalMargin | 396 | Layout.rightMargin: elisaTheme.layoutHorizontalMargin | ||
409 | 397 | | |||
410 | horizontalAlignment: Text.AlignRight | 398 | horizontalAlignment: Text.AlignRight | ||
411 | } | 399 | } | ||
412 | } | 400 | } | ||
413 | } | | |||
414 | } | | |||
415 | 401 | | |||
416 | states: [ | 402 | states: [ | ||
417 | State { | 403 | State { | ||
418 | name: 'notSelected' | 404 | name: 'notSelected' | ||
419 | when: !containsMouse && !isSelected && !playListEntry.activeFocus | 405 | when: !containsMouse && !isSelected && !playListEntry.activeFocus | ||
420 | PropertyChanges { | 406 | PropertyChanges { | ||
421 | target: removeButton | 407 | target: removeButton | ||
422 | opacity: 0 | 408 | opacity: 0 | ||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |