From 8e8bd7fb9fcb1100f76b02decfd38de1c68cc349 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 5 Nov 2023 23:45:37 +0100 Subject: [PATCH] [`media UI`] Fixing/refactoring media UI. - Fixed broken elements in the media control view. - Fixed volume bar. --- .../webapp/src/components/Media/Controls.vue | 82 ++++++++----------- .../http/webapp/src/components/Media/View.vue | 19 ++++- .../src/components/Media/VolumeSlider.vue | 72 ++++++++++++++++ .../src/components/elements/DropdownItem.vue | 3 +- .../src/components/panels/Media/Index.vue | 7 +- .../components/panels/Media/Players/Mixin.vue | 4 + 6 files changed, 137 insertions(+), 50 deletions(-) create mode 100644 platypush/backend/http/webapp/src/components/Media/VolumeSlider.vue diff --git a/platypush/backend/http/webapp/src/components/Media/Controls.vue b/platypush/backend/http/webapp/src/components/Media/Controls.vue index 14da13275..5ec4f0150 100644 --- a/platypush/backend/http/webapp/src/components/Media/Controls.vue +++ b/platypush/backend/http/webapp/src/components/Media/Controls.vue @@ -22,15 +22,9 @@
-
- -
-
- -
+
@@ -68,7 +62,7 @@
-
+
-
+
-
+
-
+
+
+ +
-
-
- -
-
- -
-
@@ -162,13 +150,26 @@ import Utils from "@/Utils" import MediaUtils from "@/components/Media/Utils"; import Slider from "@/components/elements/Slider"; +import VolumeSlider from "./VolumeSlider"; export default { - name: "Controls", - components: {Slider}, + components: {Slider, VolumeSlider}, mixins: [Utils, MediaUtils], - emits: ['search', 'previous', 'next', 'play', 'pause', 'stop', 'seek', 'consume', 'random', 'repeat', - 'set-volume', 'mute', 'unmute'], + emits: [ + 'consume', + 'mute', + 'next', + 'pause', + 'play', + 'previous', + 'random', + 'repeat', + 'search', + 'seek', + 'set-volume', + 'stop', + 'unmute', + ], props: { track: { @@ -320,10 +321,6 @@ button { margin-right: .25em; } } - - .volume-slider { - flex-grow: 1; - } } .controls { @@ -332,12 +329,19 @@ button { display: flex; padding: 1em .5em; overflow: hidden; + align-items: center; .row { width: 100%; display: flex; } + .volume-container { + display: flex; + flex-direction: column; + align-items: center; + } + .track-container { display: flex; flex-direction: column; @@ -441,25 +445,11 @@ button { button { padding: 0.5em; } - - .volume-container { - align-items: center; - margin-top: -1.25em; - - button { - background: none; - } - } } .seek-slider { width: 75%; } - - .volume-slider { - width: 75%; - margin-right: .5em; - } } .time { diff --git a/platypush/backend/http/webapp/src/components/Media/View.vue b/platypush/backend/http/webapp/src/components/Media/View.vue index 7591061d4..ad326d617 100644 --- a/platypush/backend/http/webapp/src/components/Media/View.vue +++ b/platypush/backend/http/webapp/src/components/Media/View.vue @@ -8,7 +8,7 @@ @pause="$emit('pause', $event)" @stop="$emit('stop')" @previous="$emit('previous')" @next="$emit('next')" @seek="$emit('seek', $event)" @set-volume="$emit('set-volume', $event)" @consume="$emit('consume', $event)" @repeat="$emit('repeat', $event)" @random="$emit('random', $event)" - @search="$emit('search', $event)"/> + @search="$emit('search', $event)" @mute="$emit('mute')" @unmute="$emit('unmute')" />
@@ -19,7 +19,22 @@ import Controls from "@/components/Media/Controls"; export default { name: "View", components: {Controls}, - emits: ['play', 'pause', 'stop', 'next', 'previous', 'set-volume', 'seek', 'consume', 'random', 'repeat', 'search'], + emits: [ + 'consume', + 'mute', + 'next', + 'pause', + 'play', + 'previous', + 'random', + 'repeat', + 'search', + 'seek', + 'set-volume', + 'stop', + 'unmute', + ], + props: { pluginName: { type: String, diff --git a/platypush/backend/http/webapp/src/components/Media/VolumeSlider.vue b/platypush/backend/http/webapp/src/components/Media/VolumeSlider.vue new file mode 100644 index 000000000..1b2a20150 --- /dev/null +++ b/platypush/backend/http/webapp/src/components/Media/VolumeSlider.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/platypush/backend/http/webapp/src/components/elements/DropdownItem.vue b/platypush/backend/http/webapp/src/components/elements/DropdownItem.vue index 691b15a3f..30998a821 100644 --- a/platypush/backend/http/webapp/src/components/elements/DropdownItem.vue +++ b/platypush/backend/http/webapp/src/components/elements/DropdownItem.vue @@ -50,11 +50,12 @@ export default {