Changeset View
Changeset View
Standalone View
Standalone View
src/qml/MediaPlayerControl.qml
Show First 20 Lines • Show All 125 Lines • ▼ Show 20 Line(s) | 24 | FocusScope { | |||
---|---|---|---|---|---|
126 | RowLayout { | 126 | RowLayout { | ||
127 | anchors.fill: parent | 127 | anchors.fill: parent | ||
128 | spacing: 0 | 128 | spacing: 0 | ||
129 | 129 | | |||
130 | FlatButtonWithToolTip { | 130 | FlatButtonWithToolTip { | ||
131 | id: minimizeMaximizeButton | 131 | id: minimizeMaximizeButton | ||
132 | action: minimizeMaximizeAction | 132 | action: minimizeMaximizeAction | ||
133 | 133 | | |||
134 | Layout.preferredHeight: elisaTheme.mediaPlayerControlHeight - elisaTheme.layoutVerticalMargin | ||||
135 | Layout.preferredWidth: elisaTheme.mediaPlayerControlHeight- elisaTheme.layoutVerticalMargin | ||||
134 | icon.width: elisaTheme.smallControlButtonSize | 136 | icon.width: elisaTheme.smallControlButtonSize | ||
135 | icon.height: elisaTheme.smallControlButtonSize | 137 | icon.height: elisaTheme.smallControlButtonSize | ||
136 | 138 | | |||
137 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.mediaPlayerHorizontalMargin : 0 | 139 | Layout.rightMargin: LayoutMirroring.enabled ? elisaTheme.mediaPlayerHorizontalMargin : 0 | ||
138 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.mediaPlayerHorizontalMargin : 0 | 140 | Layout.leftMargin: !LayoutMirroring.enabled ? elisaTheme.mediaPlayerHorizontalMargin : 0 | ||
139 | } | 141 | } | ||
140 | 142 | | |||
141 | FlatButtonWithToolTip { | 143 | FlatButtonWithToolTip { | ||
142 | id: skipBackwardButton | 144 | id: skipBackwardButton | ||
143 | action: skipBackwardAction | 145 | action: skipBackwardAction | ||
144 | focus: skipBackwardEnabled | 146 | focus: skipBackwardEnabled | ||
147 | | ||||
148 | Layout.preferredHeight: elisaTheme.mediaPlayerControlHeight - elisaTheme.layoutVerticalMargin | ||||
149 | Layout.preferredWidth: elisaTheme.mediaPlayerControlHeight - elisaTheme.layoutVerticalMargin | ||||
145 | icon.width: elisaTheme.smallControlButtonSize | 150 | icon.width: elisaTheme.smallControlButtonSize | ||
146 | icon.height: elisaTheme.smallControlButtonSize | 151 | icon.height: elisaTheme.smallControlButtonSize | ||
147 | } | 152 | } | ||
148 | 153 | | |||
149 | FlatButtonWithToolTip { | 154 | FlatButtonWithToolTip { | ||
150 | id: playPauseButton | 155 | id: playPauseButton | ||
151 | action: playPauseAction | 156 | action: playPauseAction | ||
152 | focus: playEnabled | 157 | focus: playEnabled | ||
153 | 158 | | |||
159 | Layout.preferredHeight: elisaTheme.mediaPlayerControlHeight - elisaTheme.layoutVerticalMargin | ||||
160 | Layout.preferredWidth: elisaTheme.mediaPlayerControlHeight - elisaTheme.layoutVerticalMargin | ||||
154 | icon.width: elisaTheme.smallControlButtonSize | 161 | icon.width: elisaTheme.smallControlButtonSize | ||
155 | icon.height: elisaTheme.smallControlButtonSize | 162 | icon.height: elisaTheme.smallControlButtonSize | ||
156 | } | 163 | } | ||
157 | 164 | | |||
158 | FlatButtonWithToolTip { | 165 | FlatButtonWithToolTip { | ||
159 | id: skipForwardButton | 166 | id: skipForwardButton | ||
160 | action: skipForwardAction | 167 | action: skipForwardAction | ||
161 | focus: skipForwardEnabled | 168 | focus: skipForwardEnabled | ||
162 | 169 | | |||
170 | Layout.preferredHeight: elisaTheme.mediaPlayerControlHeight - elisaTheme.layoutVerticalMargin | ||||
171 | Layout.preferredWidth: elisaTheme.mediaPlayerControlHeight - elisaTheme.layoutVerticalMargin | ||||
163 | icon.width: elisaTheme.smallControlButtonSize | 172 | icon.width: elisaTheme.smallControlButtonSize | ||
164 | icon.height: elisaTheme.smallControlButtonSize | 173 | icon.height: elisaTheme.smallControlButtonSize | ||
165 | } | 174 | } | ||
166 | 175 | | |||
167 | TextMetrics { | 176 | TextMetrics { | ||
168 | id: durationTextMetrics | 177 | id: durationTextMetrics | ||
169 | text: i18nc("This is used to preserve a fixed width for the duration text.", "00:00:00") | 178 | text: i18nc("This is used to preserve a fixed width for the duration text.", "00:00:00") | ||
170 | } | 179 | } | ||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | 231 | } else { | |||
223 | musicWidget.seek(seekValue) | 232 | musicWidget.seek(seekValue) | ||
224 | seekStarted = false; | 233 | seekStarted = false; | ||
225 | } | 234 | } | ||
226 | } | 235 | } | ||
227 | 236 | | |||
228 | background: Rectangle { | 237 | background: Rectangle { | ||
229 | x: musicProgress.leftPadding | 238 | x: musicProgress.leftPadding | ||
230 | y: musicProgress.topPadding + musicProgress.availableHeight / 2 - height / 2 | 239 | y: musicProgress.topPadding + musicProgress.availableHeight / 2 - height / 2 | ||
231 | implicitWidth: 200 | 240 | Layout.preferredWidth: 200 | ||
232 | implicitHeight: 6 | 241 | Layout.preferredHeight: 6 | ||
233 | width: musicProgress.availableWidth | 242 | width: musicProgress.availableWidth | ||
234 | height: implicitHeight | 243 | height: Layout.preferredHeight | ||
235 | radius: 3 | 244 | radius: 3 | ||
236 | color: myPalette.dark | 245 | color: myPalette.dark | ||
237 | 246 | | |||
238 | Rectangle { | 247 | Rectangle { | ||
239 | x: (LayoutMirroring.enabled ? musicProgress.visualPosition * parent.width : 0) | 248 | x: (LayoutMirroring.enabled ? musicProgress.visualPosition * parent.width : 0) | ||
240 | width: LayoutMirroring.enabled ? parent.width - musicProgress.visualPosition * parent.width: musicProgress.handle.x + radius | 249 | width: LayoutMirroring.enabled ? parent.width - musicProgress.visualPosition * parent.width: musicProgress.handle.x + radius | ||
241 | height: parent.height | 250 | height: parent.height | ||
242 | color: myPalette.text | 251 | color: myPalette.text | ||
243 | radius: 3 | 252 | radius: 3 | ||
244 | } | 253 | } | ||
245 | } | 254 | } | ||
246 | 255 | | |||
247 | handle: Rectangle { | 256 | handle: Rectangle { | ||
248 | x: musicProgress.leftPadding + musicProgress.visualPosition * (musicProgress.availableWidth - width) | 257 | x: musicProgress.leftPadding + musicProgress.visualPosition * (musicProgress.availableWidth - width) | ||
249 | y: musicProgress.topPadding + musicProgress.availableHeight / 2 - height / 2 | 258 | y: musicProgress.topPadding + musicProgress.availableHeight / 2 - height / 2 | ||
250 | implicitWidth: 18 | 259 | Layout.preferredWidth: 18 | ||
251 | implicitHeight: 18 | 260 | Layout.preferredHeight: 18 | ||
252 | radius: 9 | 261 | radius: 9 | ||
253 | color: myPalette.base | 262 | color: myPalette.base | ||
254 | border.width: 1 | 263 | border.width: 1 | ||
255 | border.color: musicProgress.pressed ? myPalette.text : myPalette.dark | 264 | border.color: musicProgress.pressed ? myPalette.text : myPalette.dark | ||
256 | 265 | | |||
257 | } | 266 | } | ||
258 | } | 267 | } | ||
259 | 268 | | |||
Show All 19 Lines | 269 | LabelWithToolTip { | |||
279 | } | 288 | } | ||
280 | } | 289 | } | ||
281 | 290 | | |||
282 | FlatButtonWithToolTip { | 291 | FlatButtonWithToolTip { | ||
283 | id: muteButton | 292 | id: muteButton | ||
284 | action: muteAction | 293 | action: muteAction | ||
285 | focus: true | 294 | focus: true | ||
286 | 295 | | |||
296 | Layout.preferredHeight: elisaTheme.mediaPlayerControlHeight - elisaTheme.layoutVerticalMargin | ||||
297 | Layout.preferredWidth: elisaTheme.mediaPlayerControlHeight - elisaTheme.layoutVerticalMargin | ||||
287 | icon.width: elisaTheme.smallControlButtonSize | 298 | icon.width: elisaTheme.smallControlButtonSize | ||
288 | icon.height: elisaTheme.smallControlButtonSize | 299 | icon.height: elisaTheme.smallControlButtonSize | ||
289 | } | 300 | } | ||
290 | 301 | | |||
291 | Slider { | 302 | Slider { | ||
292 | id: volumeSlider | 303 | id: volumeSlider | ||
293 | 304 | | |||
294 | from: 0 | 305 | from: 0 | ||
295 | to: 100 | 306 | to: 100 | ||
296 | 307 | | |||
297 | enabled: !muted | 308 | enabled: !muted | ||
298 | 309 | | |||
299 | Layout.alignment: Qt.AlignVCenter | 310 | Layout.alignment: Qt.AlignVCenter | ||
300 | Layout.preferredWidth: elisaTheme.volumeSliderWidth | 311 | Layout.preferredWidth: elisaTheme.volumeSliderWidth | ||
301 | Layout.maximumWidth: elisaTheme.volumeSliderWidth | 312 | Layout.maximumWidth: elisaTheme.volumeSliderWidth | ||
302 | Layout.minimumWidth: elisaTheme.volumeSliderWidth | 313 | Layout.minimumWidth: elisaTheme.volumeSliderWidth | ||
303 | Layout.rightMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin * 3 : 0 | 314 | Layout.rightMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin * 3 : 0 | ||
304 | Layout.leftMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin * 3 : 0 | 315 | Layout.leftMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin * 3 : 0 | ||
305 | 316 | | |||
306 | width: elisaTheme.volumeSliderWidth | 317 | width: elisaTheme.volumeSliderWidth | ||
307 | 318 | | |||
308 | background: Rectangle { | 319 | background: Rectangle { | ||
309 | x: volumeSlider.leftPadding | 320 | x: volumeSlider.leftPadding | ||
310 | y: volumeSlider.topPadding + volumeSlider.availableHeight / 2 - height / 2 | 321 | y: volumeSlider.topPadding + volumeSlider.availableHeight / 2 - height / 2 | ||
311 | implicitWidth: 200 | 322 | Layout.preferredWidth: 200 | ||
312 | implicitHeight: 6 | 323 | Layout.preferredHeight: 6 | ||
313 | width: volumeSlider.availableWidth | 324 | width: volumeSlider.availableWidth | ||
314 | height: implicitHeight | 325 | height: Layout.preferredHeight | ||
315 | radius: 3 | 326 | radius: 3 | ||
316 | color: myPalette.dark | 327 | color: myPalette.dark | ||
317 | opacity: muted ? 0.5 : 1 | 328 | opacity: muted ? 0.5 : 1 | ||
318 | 329 | | |||
319 | Rectangle { | 330 | Rectangle { | ||
320 | x: (LayoutMirroring.enabled ? volumeSlider.visualPosition * parent.width : 0) | 331 | x: (LayoutMirroring.enabled ? volumeSlider.visualPosition * parent.width : 0) | ||
321 | width: (LayoutMirroring.enabled ? parent.width - volumeSlider.visualPosition * parent.width : volumeSlider.visualPosition * parent.width) | 332 | width: (LayoutMirroring.enabled ? parent.width - volumeSlider.visualPosition * parent.width : volumeSlider.visualPosition * parent.width) | ||
322 | height: parent.height | 333 | height: parent.height | ||
323 | color: myPalette.text | 334 | color: myPalette.text | ||
324 | radius: 3 | 335 | radius: 3 | ||
325 | opacity: muted ? 0.5 : 1 | 336 | opacity: muted ? 0.5 : 1 | ||
326 | } | 337 | } | ||
327 | } | 338 | } | ||
328 | 339 | | |||
329 | handle: Rectangle { | 340 | handle: Rectangle { | ||
330 | x: volumeSlider.leftPadding + volumeSlider.visualPosition * (volumeSlider.availableWidth - width) | 341 | x: volumeSlider.leftPadding + volumeSlider.visualPosition * (volumeSlider.availableWidth - width) | ||
331 | y: volumeSlider.topPadding + volumeSlider.availableHeight / 2 - height / 2 | 342 | y: volumeSlider.topPadding + volumeSlider.availableHeight / 2 - height / 2 | ||
332 | implicitWidth: 18 | 343 | Layout.preferredWidth: 18 | ||
333 | implicitHeight: 18 | 344 | Layout.preferredHeight: 18 | ||
334 | radius: 9 | 345 | radius: 9 | ||
335 | color: myPalette.base | 346 | color: myPalette.base | ||
336 | border.width: 1 | 347 | border.width: 1 | ||
337 | border.color: volumeSlider.pressed ? myPalette.text : (muted ? myPalette.mid : myPalette.dark) | 348 | border.color: volumeSlider.pressed ? myPalette.text : (muted ? myPalette.mid : myPalette.dark) | ||
338 | } | 349 | } | ||
339 | } | 350 | } | ||
340 | 351 | | |||
341 | FlatButtonWithToolTip { | 352 | FlatButtonWithToolTip { | ||
342 | focus: true | 353 | focus: true | ||
343 | action: shuffleAction | 354 | action: shuffleAction | ||
344 | id: shuffleButton | 355 | id: shuffleButton | ||
345 | 356 | | |||
357 | Layout.preferredHeight: elisaTheme.mediaPlayerControlHeight - elisaTheme.layoutVerticalMargin | ||||
358 | Layout.preferredWidth: elisaTheme.mediaPlayerControlHeight - elisaTheme.layoutVerticalMargin | ||||
346 | icon.width: elisaTheme.smallControlButtonSize | 359 | icon.width: elisaTheme.smallControlButtonSize | ||
347 | icon.height: elisaTheme.smallControlButtonSize | 360 | icon.height: elisaTheme.smallControlButtonSize | ||
348 | } | 361 | } | ||
349 | 362 | | |||
350 | FlatButtonWithToolTip { | 363 | FlatButtonWithToolTip { | ||
351 | focus: true | 364 | focus: true | ||
352 | action: repeatAction | 365 | action: repeatAction | ||
353 | id: repeatButton | 366 | id: repeatButton | ||
354 | 367 | | |||
368 | Layout.preferredHeight: elisaTheme.mediaPlayerControlHeight - elisaTheme.layoutVerticalMargin | ||||
369 | Layout.preferredWidth: elisaTheme.mediaPlayerControlHeight - elisaTheme.layoutVerticalMargin | ||||
355 | icon.width: elisaTheme.smallControlButtonSize | 370 | icon.width: elisaTheme.smallControlButtonSize | ||
356 | icon.height: elisaTheme.smallControlButtonSize | 371 | icon.height: elisaTheme.smallControlButtonSize | ||
357 | } | 372 | } | ||
358 | 373 | | |||
359 | FlatButtonWithToolTip { | 374 | FlatButtonWithToolTip { | ||
360 | id: menuButton | 375 | id: menuButton | ||
361 | action: applicationMenuAction | 376 | action: applicationMenuAction | ||
362 | focus: true | 377 | focus: true | ||
363 | 378 | | |||
379 | Layout.preferredHeight: elisaTheme.mediaPlayerControlHeight - elisaTheme.layoutVerticalMargin | ||||
380 | Layout.preferredWidth: elisaTheme.mediaPlayerControlHeight - elisaTheme.layoutVerticalMargin | ||||
364 | icon.width: elisaTheme.smallControlButtonSize | 381 | icon.width: elisaTheme.smallControlButtonSize | ||
365 | icon.height: elisaTheme.smallControlButtonSize | 382 | icon.height: elisaTheme.smallControlButtonSize | ||
366 | 383 | | |||
367 | Layout.rightMargin: !LayoutMirroring.enabled ? elisaTheme.mediaPlayerHorizontalMargin : elisaTheme.mediaPlayerHorizontalMargin * 1.5 | 384 | Layout.rightMargin: !LayoutMirroring.enabled ? elisaTheme.mediaPlayerHorizontalMargin : elisaTheme.mediaPlayerHorizontalMargin * 1.5 | ||
368 | Layout.leftMargin: LayoutMirroring.enabled ? elisaTheme.mediaPlayerHorizontalMargin : elisaTheme.mediaPlayerHorizontalMargin * 1.5 | 385 | Layout.leftMargin: LayoutMirroring.enabled ? elisaTheme.mediaPlayerHorizontalMargin : elisaTheme.mediaPlayerHorizontalMargin * 1.5 | ||
369 | } | 386 | } | ||
370 | } | 387 | } | ||
371 | 388 | | |||
Show All 29 Lines |