Changeset View
Changeset View
Standalone View
Standalone View
src/qml/MediaPlayerControl.qml
Show All 14 Lines | |||||
15 | * along with this library; see the file COPYING.LIB. If not, write to | 15 | * along with this library; see the file COPYING.LIB. If not, write to | ||
16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | * Boston, MA 02110-1301, USA. | 17 | * Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.7 | 20 | import QtQuick 2.7 | ||
21 | import QtQuick.Layouts 1.2 | 21 | import QtQuick.Layouts 1.2 | ||
22 | import QtGraphicalEffects 1.0 | 22 | import QtGraphicalEffects 1.0 | ||
23 | import QtQuick.Controls 2.2 | 23 | import QtQuick.Controls 2.3 | ||
24 | import org.kde.elisa 1.0 | 24 | import org.kde.elisa 1.0 | ||
25 | 25 | | |||
26 | import QtQuick.Controls 1.4 as Controls1 | | |||
27 | | ||||
28 | FocusScope { | 26 | FocusScope { | ||
29 | property double volume | 27 | property double volume | ||
30 | property int position | 28 | property int position | ||
31 | property int duration | 29 | property int duration | ||
32 | property bool muted | 30 | property bool muted | ||
33 | property bool isPlaying | 31 | property bool isPlaying | ||
34 | property bool seekable | 32 | property bool seekable | ||
35 | property bool playEnabled | 33 | property bool playEnabled | ||
36 | property bool skipForwardEnabled | 34 | property bool skipForwardEnabled | ||
37 | property bool skipBackwardEnabled | 35 | property bool skipBackwardEnabled | ||
38 | property bool isMaximized | 36 | property bool isMaximized | ||
39 | 37 | | |||
40 | property bool shuffle | 38 | property bool shuffle | ||
41 | property bool repeat | 39 | property bool repeat | ||
42 | 40 | | |||
43 | signal play() | 41 | signal play() | ||
44 | signal pause() | 42 | signal pause() | ||
45 | signal playPrevious() | 43 | signal playPrevious() | ||
46 | signal playNext() | 44 | signal playNext() | ||
47 | signal seek(int position) | 45 | signal seek(int position) | ||
46 | signal openMenu() | ||||
48 | 47 | | |||
49 | signal maximize() | 48 | signal maximize() | ||
50 | signal minimize() | 49 | signal minimize() | ||
51 | 50 | | |||
52 | id: musicWidget | 51 | id: musicWidget | ||
53 | 52 | | |||
54 | SystemPalette { | 53 | SystemPalette { | ||
55 | id: myPalette | 54 | id: myPalette | ||
56 | colorGroup: SystemPalette.Active | 55 | colorGroup: SystemPalette.Active | ||
57 | } | 56 | } | ||
58 | 57 | | |||
59 | Theme { | 58 | Theme { | ||
60 | id: elisaTheme | 59 | id: elisaTheme | ||
61 | } | 60 | } | ||
62 | 61 | | |||
62 | Action { | ||||
63 | id: applicationMenuAction | ||||
64 | text: i18nc("open application menu", "Application Menu") | ||||
65 | icon.name: "application-menu" | ||||
66 | onTriggered: openMenu() | ||||
67 | } | ||||
68 | | ||||
69 | Action { | ||||
70 | id: repeatAction | ||||
71 | text: i18nc("toggle repeat mode for playlist", "Toggle Repeat") | ||||
72 | icon.name: musicWidget.repeat ? "media-repeat-all" : "media-repeat-none" | ||||
73 | onTriggered: musicWidget.repeat = !musicWidget.repeat | ||||
74 | } | ||||
75 | | ||||
76 | Action { | ||||
77 | id: shuffleAction | ||||
78 | text: i18nc("toggle shuffle mode for playlist", "Toggle Shuffle") | ||||
79 | icon.name: musicWidget.shuffle ? "media-playlist-shuffle" : "media-playlist-normal" | ||||
80 | onTriggered: musicWidget.shuffle = !musicWidget.shuffle | ||||
81 | } | ||||
82 | | ||||
83 | Action { | ||||
84 | id: muteAction | ||||
85 | text: i18nc("toggle mute mode for player", "Toggle Mute") | ||||
86 | icon.name: musicWidget.muted ? "player-volume-muted" : "player-volume" | ||||
87 | onTriggered: musicWidget.muted = !musicWidget.muted | ||||
88 | } | ||||
89 | | ||||
90 | Action { | ||||
91 | id: playPauseAction | ||||
92 | text: i18nc("toggle play and pause for the audio player", "Toggle Play and Pause") | ||||
93 | icon.name: musicWidget.isPlaying? "media-playback-pause" : "media-playback-start" | ||||
94 | onTriggered: musicWidget.isPlaying ? musicWidget.pause() : musicWidget.play() | ||||
95 | enabled: playEnabled | ||||
96 | } | ||||
97 | | ||||
98 | Action { | ||||
99 | id: skipBackwardAction | ||||
100 | text: i18nc("skip backward in playlists", "Skip Backward") | ||||
101 | icon.name: musicWidget.LayoutMirroring.enabled ? "media-skip-forward" : "media-skip-backward" | ||||
102 | onTriggered: musicWidget.playPrevious() | ||||
103 | enabled: skipBackwardEnabled | ||||
104 | } | ||||
105 | | ||||
106 | Action { | ||||
107 | id: skipForwardAction | ||||
108 | text: i18nc("skip forward in playlists", "Skip Forward") | ||||
109 | icon.name: musicWidget.LayoutMirroring.enabled ? "media-skip-backward" : "media-skip-forward" | ||||
110 | onTriggered: musicWidget.playNext() | ||||
111 | enabled: skipForwardEnabled | ||||
112 | } | ||||
113 | | ||||
114 | Action { | ||||
115 | id: minimizeMaximizeAction | ||||
116 | text: i18nc("skip forward in playlists", "Skip Forward") | ||||
117 | icon.name: musicWidget.isMaximized ? "draw-arrow-up" : "draw-arrow-down" | ||||
118 | onTriggered: musicWidget.isMaximized = !musicWidget.isMaximized | ||||
119 | } | ||||
120 | | ||||
63 | Rectangle { | 121 | Rectangle { | ||
64 | anchors.fill: parent | 122 | anchors.fill: parent | ||
65 | 123 | | |||
66 | color: myPalette.midlight | 124 | color: myPalette.midlight | ||
67 | opacity: elisaTheme.mediaPlayerControlOpacity | 125 | opacity: elisaTheme.mediaPlayerControlOpacity | ||
68 | } | 126 | } | ||
69 | 127 | | |||
70 | RowLayout { | 128 | RowLayout { | ||
71 | anchors.fill: parent | 129 | anchors.fill: parent | ||
72 | spacing: 5 | 130 | spacing: 5 | ||
73 | 131 | | |||
74 | Button { | 132 | ElisaToolButton { | ||
133 | id: minimzeMaximizeAction | ||||
134 | action: minimizeMaximizeAction | ||||
135 | | ||||
75 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | 136 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | ||
76 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | 137 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | ||
77 | Layout.alignment: Qt.AlignVCenter | 138 | Layout.alignment: Qt.AlignVCenter | ||
78 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | 139 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | ||
79 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | 140 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | ||
80 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | 141 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | ||
81 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | 142 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | ||
82 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.mediaPlayerHorizontalMargin : 0 | 143 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.mediaPlayerHorizontalMargin : 0 | ||
83 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.mediaPlayerHorizontalMargin : 0 | 144 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.mediaPlayerHorizontalMargin : 0 | ||
84 | | ||||
85 | contentItem: Image { | | |||
86 | anchors.fill: parent | | |||
87 | source: Qt.resolvedUrl(musicWidget.isMaximized ? elisaTheme.minimizeIcon : elisaTheme.maximizeIcon) | | |||
88 | | ||||
89 | width: elisaTheme.smallControlButtonSize | | |||
90 | height: elisaTheme.smallControlButtonSize | | |||
91 | | ||||
92 | sourceSize.width: elisaTheme.smallControlButtonSize | | |||
93 | sourceSize.height: elisaTheme.smallControlButtonSize | | |||
94 | | ||||
95 | fillMode: Image.PreserveAspectFit | | |||
96 | opacity: 1.0 | | |||
97 | } | 145 | } | ||
98 | 146 | | |||
99 | background: Rectangle { | 147 | ElisaToolButton { | ||
100 | border.width: 0 | 148 | id: skipBackwardButton | ||
101 | opacity: 0.0 | 149 | action: skipBackwardAction | ||
102 | } | | |||
103 | | ||||
104 | onClicked: { | | |||
105 | musicWidget.isMaximized = !musicWidget.isMaximized | | |||
106 | } | | |||
107 | } | | |||
108 | | ||||
109 | RoundButton { | | |||
110 | focus: skipBackwardEnabled | 150 | focus: skipBackwardEnabled | ||
111 | 151 | | |||
112 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | 152 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | ||
113 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | 153 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | ||
114 | Layout.alignment: Qt.AlignVCenter | 154 | Layout.alignment: Qt.AlignVCenter | ||
115 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | 155 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | ||
116 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | 156 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | ||
117 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | 157 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | ||
118 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | 158 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | ||
119 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.mediaPlayerHorizontalMargin : 0 | | |||
120 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.mediaPlayerHorizontalMargin : 0 | | |||
121 | | ||||
122 | enabled: skipBackwardEnabled | | |||
123 | hoverEnabled: true | | |||
124 | | ||||
125 | onClicked: { | | |||
126 | musicWidget.playPrevious() | | |||
127 | } | | |||
128 | | ||||
129 | contentItem: Image { | | |||
130 | anchors.fill: parent | | |||
131 | | ||||
132 | source: Qt.resolvedUrl(LayoutMirroring.enabled ? elisaTheme.skipForwardIcon : elisaTheme.skipBackwardIcon) | | |||
133 | | ||||
134 | width: elisaTheme.smallControlButtonSize | | |||
135 | height: elisaTheme.smallControlButtonSize | | |||
136 | | ||||
137 | sourceSize.width: elisaTheme.smallControlButtonSize | | |||
138 | sourceSize.height: elisaTheme.smallControlButtonSize | | |||
139 | | ||||
140 | fillMode: Image.PreserveAspectFit | | |||
141 | | ||||
142 | opacity: skipBackwardEnabled ? 1.0 : 0.6 | | |||
143 | } | 159 | } | ||
144 | 160 | | |||
145 | background: Rectangle { | 161 | ElisaToolButton { | ||
146 | color: "transparent" | 162 | id: playPauseButton | ||
147 | 163 | action: playPauseAction | |||
148 | border.color: (parent.hovered || parent.activeFocus) ? myPalette.highlight : "transparent" | | |||
149 | border.width: 1 | | |||
150 | | ||||
151 | radius: elisaTheme.smallControlButtonSize | | |||
152 | | ||||
153 | Behavior on border.color { | | |||
154 | ColorAnimation { | | |||
155 | duration: 300 | | |||
156 | } | | |||
157 | } | | |||
158 | } | | |||
159 | } | | |||
160 | | ||||
161 | RoundButton { | | |||
162 | focus: playEnabled | 164 | focus: playEnabled | ||
163 | 165 | | |||
164 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | 166 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | ||
165 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | 167 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | ||
166 | Layout.alignment: Qt.AlignVCenter | 168 | Layout.alignment: Qt.AlignVCenter | ||
167 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | 169 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | ||
168 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | 170 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | ||
169 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | 171 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | ||
170 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | 172 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | ||
171 | | ||||
172 | enabled: playEnabled | | |||
173 | hoverEnabled: true | | |||
174 | | ||||
175 | onClicked: { | | |||
176 | if (musicWidget.isPlaying) { | | |||
177 | musicWidget.pause() | | |||
178 | } else { | | |||
179 | musicWidget.play() | | |||
180 | } | | |||
181 | } | | |||
182 | | ||||
183 | contentItem: Image { | | |||
184 | anchors.fill: parent | | |||
185 | | ||||
186 | source: { | | |||
187 | if (musicWidget.isPlaying) | | |||
188 | Qt.resolvedUrl(elisaTheme.pauseIcon) | | |||
189 | else | | |||
190 | Qt.resolvedUrl(elisaTheme.playIcon) | | |||
191 | } | | |||
192 | | ||||
193 | width: elisaTheme.smallControlButtonSize | | |||
194 | height: elisaTheme.smallControlButtonSize | | |||
195 | | ||||
196 | sourceSize.width: elisaTheme.smallControlButtonSize | | |||
197 | sourceSize.height: elisaTheme.smallControlButtonSize | | |||
198 | | ||||
199 | fillMode: Image.PreserveAspectFit | | |||
200 | mirror: LayoutMirroring.enabled | | |||
201 | opacity: playEnabled ? 1.0 : 0.6 | | |||
202 | } | 173 | } | ||
203 | 174 | | |||
204 | background: Rectangle { | 175 | ElisaToolButton { | ||
205 | color: "transparent" | 176 | id: skipForwardButton | ||
206 | 177 | action: skipForwardAction | |||
207 | border.color: (parent.hovered || parent.activeFocus) ? myPalette.highlight : "transparent" | | |||
208 | border.width: 1 | | |||
209 | | ||||
210 | radius: elisaTheme.smallControlButtonSize | | |||
211 | | ||||
212 | Behavior on border.color { | | |||
213 | ColorAnimation { | | |||
214 | duration: 300 | | |||
215 | } | | |||
216 | } | | |||
217 | } | | |||
218 | } | | |||
219 | | ||||
220 | RoundButton { | | |||
221 | focus: skipForwardEnabled | 178 | focus: skipForwardEnabled | ||
222 | 179 | | |||
223 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | 180 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | ||
224 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | 181 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | ||
225 | Layout.alignment: Qt.AlignVCenter | 182 | Layout.alignment: Qt.AlignVCenter | ||
226 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | 183 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | ||
227 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | 184 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | ||
228 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | 185 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | ||
229 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | 186 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | ||
230 | | ||||
231 | enabled: skipForwardEnabled | | |||
232 | hoverEnabled: true | | |||
233 | | ||||
234 | onClicked: { | | |||
235 | musicWidget.playNext() | | |||
236 | } | | |||
237 | | ||||
238 | contentItem: Image { | | |||
239 | anchors.fill: parent | | |||
240 | | ||||
241 | source: Qt.resolvedUrl(LayoutMirroring.enabled ? elisaTheme.skipBackwardIcon : elisaTheme.skipForwardIcon) | | |||
242 | | ||||
243 | width: elisaTheme.smallControlButtonSize | | |||
244 | height: elisaTheme.smallControlButtonSize | | |||
245 | | ||||
246 | sourceSize.width: elisaTheme.smallControlButtonSize | | |||
247 | sourceSize.height: elisaTheme.smallControlButtonSize | | |||
248 | | ||||
249 | fillMode: Image.PreserveAspectFit | | |||
250 | | ||||
251 | opacity: skipForwardEnabled ? 1.0 : 0.6 | | |||
252 | } | | |||
253 | | ||||
254 | background: Rectangle { | | |||
255 | color: "transparent" | | |||
256 | | ||||
257 | border.color: (parent.hovered || parent.activeFocus) ? myPalette.highlight : "transparent" | | |||
258 | border.width: 1 | | |||
259 | | ||||
260 | radius: elisaTheme.smallControlButtonSize | | |||
261 | | ||||
262 | Behavior on border.color { | | |||
263 | ColorAnimation { | | |||
264 | duration: 300 | | |||
265 | } | | |||
266 | } | | |||
267 | } | | |||
268 | } | 187 | } | ||
269 | 188 | | |||
270 | TextMetrics { | 189 | TextMetrics { | ||
271 | id: durationTextMetrics | 190 | id: durationTextMetrics | ||
272 | text: i18nc("This is used to preserve a fixed width for the duration text.", "00:00:00") | 191 | text: i18nc("This is used to preserve a fixed width for the duration text.", "00:00:00") | ||
273 | } | 192 | } | ||
274 | 193 | | |||
275 | LabelWithToolTip { | 194 | LabelWithToolTip { | ||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | 282 | LabelWithToolTip { | |||
377 | horizontalAlignment: Text.AlignLeft | 296 | horizontalAlignment: Text.AlignLeft | ||
378 | 297 | | |||
379 | ProgressIndicator { | 298 | ProgressIndicator { | ||
380 | id: durationIndicator | 299 | id: durationIndicator | ||
381 | position: musicWidget.duration | 300 | position: musicWidget.duration | ||
382 | } | 301 | } | ||
383 | } | 302 | } | ||
384 | 303 | | |||
385 | Image { | 304 | ElisaToolButton { | ||
386 | id: volumeIcon | 305 | id: muteButton | ||
387 | 306 | action: muteAction | |||
388 | source: if (musicWidget.muted) | | |||
389 | Qt.resolvedUrl(elisaTheme.playerVolumeMutedIcon) | | |||
390 | else | | |||
391 | Qt.resolvedUrl(elisaTheme.playerVolumeIcon) | | |||
392 | | ||||
393 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | | |||
394 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | | |||
395 | Layout.alignment: Qt.AlignVCenter | | |||
396 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | | |||
397 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | | |||
398 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | | |||
399 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | | |||
400 | Layout.rightMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | | |||
401 | Layout.leftMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin : 0 | | |||
402 | | ||||
403 | sourceSize.width: elisaTheme.smallControlButtonSize | | |||
404 | sourceSize.height: elisaTheme.smallControlButtonSize | | |||
405 | | ||||
406 | fillMode: Image.PreserveAspectFit | | |||
407 | | ||||
408 | visible: false | | |||
409 | } | | |||
410 | | ||||
411 | | ||||
412 | RoundButton { | | |||
413 | focus: true | 307 | focus: true | ||
414 | 308 | | |||
415 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | 309 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | ||
416 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | 310 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | ||
417 | Layout.alignment: Qt.AlignVCenter | 311 | Layout.alignment: Qt.AlignVCenter | ||
418 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | 312 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | ||
419 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | 313 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | ||
420 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | 314 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | ||
421 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | 315 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | ||
422 | | ||||
423 | hoverEnabled: true | | |||
424 | | ||||
425 | onClicked: musicWidget.muted = !musicWidget.muted | | |||
426 | | ||||
427 | contentItem: Image { | | |||
428 | anchors.fill: parent | | |||
429 | | ||||
430 | source: if (musicWidget.muted) | | |||
431 | Qt.resolvedUrl(elisaTheme.playerVolumeMutedIcon) | | |||
432 | else | | |||
433 | Qt.resolvedUrl(elisaTheme.playerVolumeIcon) | | |||
434 | | ||||
435 | width: elisaTheme.smallControlButtonSize | | |||
436 | height: elisaTheme.smallControlButtonSize | | |||
437 | | ||||
438 | sourceSize.width: elisaTheme.smallControlButtonSize | | |||
439 | sourceSize.height: elisaTheme.smallControlButtonSize | | |||
440 | | ||||
441 | fillMode: Image.PreserveAspectFit | | |||
442 | } | | |||
443 | | ||||
444 | background: Rectangle { | | |||
445 | color: "transparent" | | |||
446 | | ||||
447 | border.color: (parent.hovered || parent.activeFocus) ? myPalette.highlight : "transparent" | | |||
448 | border.width: 1 | | |||
449 | | ||||
450 | radius: elisaTheme.smallControlButtonSize | | |||
451 | | ||||
452 | Behavior on border.color { | | |||
453 | ColorAnimation { | | |||
454 | duration: 300 | | |||
455 | } | | |||
456 | } | | |||
457 | } | | |||
458 | } | 316 | } | ||
459 | 317 | | |||
460 | Slider { | 318 | Slider { | ||
461 | id: volumeSlider | 319 | id: volumeSlider | ||
462 | 320 | | |||
463 | from: 0 | 321 | from: 0 | ||
464 | to: 100 | 322 | to: 100 | ||
465 | value: musicWidget.volume | 323 | value: musicWidget.volume | ||
Show All 39 Lines | 359 | handle: Rectangle { | |||
505 | implicitHeight: 18 | 363 | implicitHeight: 18 | ||
506 | radius: 9 | 364 | radius: 9 | ||
507 | color: myPalette.base | 365 | color: myPalette.base | ||
508 | border.width: 1 | 366 | border.width: 1 | ||
509 | border.color: volumeSlider.pressed ? myPalette.text : (muted ? myPalette.mid : myPalette.dark) | 367 | border.color: volumeSlider.pressed ? myPalette.text : (muted ? myPalette.mid : myPalette.dark) | ||
510 | } | 368 | } | ||
511 | } | 369 | } | ||
512 | 370 | | |||
513 | RoundButton { | 371 | ElisaToolButton { | ||
514 | focus: true | 372 | focus: true | ||
373 | action: shuffleAction | ||||
515 | id: shuffleButton | 374 | id: shuffleButton | ||
516 | 375 | | |||
517 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | 376 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | ||
518 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | 377 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | ||
519 | Layout.alignment: Qt.AlignCenter | 378 | Layout.alignment: Qt.AlignCenter | ||
520 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | 379 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | ||
521 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | 380 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | ||
522 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | 381 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | ||
523 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | 382 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | ||
524 | | ||||
525 | hoverEnabled: true | | |||
526 | onClicked: musicWidget.shuffle = !musicWidget.shuffle | | |||
527 | | ||||
528 | contentItem: Image { | | |||
529 | anchors.fill: parent | | |||
530 | | ||||
531 | source: musicWidget.shuffle ? Qt.resolvedUrl(elisaTheme.shuffleIcon) : Qt.resolvedUrl(elisaTheme.noShuffleIcon) | | |||
532 | | ||||
533 | width: elisaTheme.smallControlButtonSize | | |||
534 | height: elisaTheme.smallControlButtonSize | | |||
535 | | ||||
536 | sourceSize.width: elisaTheme.smallControlButtonSize | | |||
537 | sourceSize.height: elisaTheme.smallControlButtonSize | | |||
538 | | ||||
539 | fillMode: Image.PreserveAspectFit | | |||
540 | } | 383 | } | ||
541 | 384 | | |||
542 | background: Rectangle { | 385 | ElisaToolButton { | ||
543 | color: "transparent" | | |||
544 | } | | |||
545 | } | | |||
546 | | ||||
547 | | ||||
548 | RoundButton { | | |||
549 | focus: true | 386 | focus: true | ||
387 | action: repeatAction | ||||
550 | id: repeatButton | 388 | id: repeatButton | ||
551 | 389 | | |||
552 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | 390 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | ||
553 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | 391 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | ||
554 | Layout.alignment: Qt.AlignCenter | 392 | Layout.alignment: Qt.AlignCenter | ||
555 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | 393 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | ||
556 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | 394 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | ||
557 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | 395 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | ||
558 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | 396 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | ||
559 | | ||||
560 | hoverEnabled: true | | |||
561 | onClicked: musicWidget.repeat = !musicWidget.repeat | | |||
562 | | ||||
563 | contentItem: Image { | | |||
564 | anchors.fill: parent | | |||
565 | | ||||
566 | source: musicWidget.repeat ? Qt.resolvedUrl(elisaTheme.repeatIcon) : Qt.resolvedUrl(elisaTheme.noRepeatIcon) | | |||
567 | | ||||
568 | width: elisaTheme.smallControlButtonSize | | |||
569 | height: elisaTheme.smallControlButtonSize | | |||
570 | | ||||
571 | sourceSize.width: elisaTheme.smallControlButtonSize | | |||
572 | sourceSize.height: elisaTheme.smallControlButtonSize | | |||
573 | | ||||
574 | fillMode: Image.PreserveAspectFit | | |||
575 | } | 397 | } | ||
576 | 398 | | |||
577 | background: Rectangle { | 399 | ElisaToolButton { | ||
578 | color: "transparent" | | |||
579 | } | | |||
580 | | ||||
581 | } | | |||
582 | | ||||
583 | Controls1.ToolButton { | | |||
584 | id: menuButton | 400 | id: menuButton | ||
585 | action: applicationMenuAction | 401 | action: applicationMenuAction | ||
402 | focus: true | ||||
586 | 403 | | |||
587 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | 404 | Layout.preferredWidth: elisaTheme.smallControlButtonSize | ||
588 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | 405 | Layout.preferredHeight: elisaTheme.smallControlButtonSize | ||
589 | Layout.alignment: Qt.AlignVCenter | 406 | Layout.alignment: Qt.AlignVCenter | ||
590 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | 407 | Layout.maximumWidth: elisaTheme.smallControlButtonSize | ||
591 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | 408 | Layout.maximumHeight: elisaTheme.smallControlButtonSize | ||
592 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | 409 | Layout.minimumWidth: elisaTheme.smallControlButtonSize | ||
593 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | 410 | Layout.minimumHeight: elisaTheme.smallControlButtonSize | ||
Show All 27 Lines |