Skip to content

Commit

Permalink
Replace mute icon with material design icon
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Petry <[email protected]>
  • Loading branch information
PVince81 committed Feb 1, 2021
1 parent 8a9f63e commit 484a223
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 18 deletions.
6 changes: 0 additions & 6 deletions css/icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@
&.icon-grid-view {
background-image: url(icon-color-path('toggle-pictures', 'actions', 'fff', 1, true));
}
&.icon-audio {
background-image: url(icon-color-path('audio', 'actions', 'fff', 1, true));
}
&.icon-audio-off {
background-image: url(icon-color-path('audio-off', 'actions', 'fff', 1, true));
}
&.icon-video {
background-image: url(icon-color-path('video', 'actions', 'fff', 1, true));
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/CallView/CallView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ export default {
}

#videos .videoContainer.speaking:not(.videoView) ::v-deep .nameIndicator,
#videos .videoContainer.videoView.speaking ::v-deep .nameIndicator .icon-audio {
#videos .videoContainer.videoView.speaking ::v-deep .nameIndicator .microphone-icon {
animation: pulse 1s;
animation-iteration-count: infinite;
}
Expand Down
29 changes: 24 additions & 5 deletions src/components/CallView/shared/LocalMediaControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@
v-tooltip="audioButtonTooltip"
:aria-label="audioButtonAriaLabel"
:class="audioButtonClass"
class="forced-white"
@shortkey="toggleAudio"
@click="toggleAudio" />
@click="toggleAudio">
<component :is="audioButtonComponent"
:size="24"
title=""
fill-color="#ffffff"
decorative />
</button>
<span v-show="model.attributes.audioAvailable"
ref="volumeIndicator"
class="volume-indicator" />
Expand Down Expand Up @@ -161,6 +166,9 @@ import escapeHtml from 'escape-html'
import { emit } from '@nextcloud/event-bus'
import { showMessage } from '@nextcloud/dialogs'
import Hand from 'vue-material-design-icons/Hand'
import Microphone from 'vue-material-design-icons/Microphone'
import MicrophoneOff from 'vue-material-design-icons/MicrophoneOff'
import MicrophoneOutline from 'vue-material-design-icons/MicrophoneOutline'
import Popover from '@nextcloud/vue/dist/Components/Popover'
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip'
import SpeakingWhileMutedWarner from '../../../utils/webrtc/SpeakingWhileMutedWarner'
Expand All @@ -184,6 +192,9 @@ export default {
ActionSeparator,
ActionButton,
Hand,
Microphone,
MicrophoneOff,
MicrophoneOutline,
},

props: {
Expand Down Expand Up @@ -231,13 +242,21 @@ export default {

audioButtonClass() {
return {
'icon-audio': this.model.attributes.audioAvailable && this.model.attributes.audioEnabled,
'audio-disabled': this.model.attributes.audioAvailable && !this.model.attributes.audioEnabled,
'icon-audio-off': !this.model.attributes.audioAvailable || !this.model.attributes.audioEnabled,
'no-audio-available': !this.model.attributes.audioAvailable,
}
},

audioButtonComponent() {
if (this.model.attributes.audioAvailable) {
if (this.model.attributes.audioEnabled) {
return 'Microphone'
}
return 'MicrophoneOff'
}
return 'MicrophoneOutline'
},

audioButtonTooltip() {
if (!this.model.attributes.audioAvailable) {
return {
Expand Down Expand Up @@ -770,7 +789,7 @@ export default {
opacity: 0.7;
}

#muteWrapper .icon-audio-off + .volume-indicator {
#muteWrapper .microphone-off-icon + .volume-indicator {
background: linear-gradient(0deg, gray, white 36px);
}

Expand Down
23 changes: 18 additions & 5 deletions src/components/MediaDevicesPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@
class="preview-not-available">
<div v-if="audioStreamError"
class="icon icon-error" />
<div v-else-if="!audioInputId"
class="icon icon-audio-off" />
<div v-else-if="!enabled"
class="icon icon-audio" />
<MicrophoneOff
v-else-if="!audioInputId"
:size="64"
title=""
fill-color="#999" />
<Microphone
v-else-if="!enabled"
:size="64"
title=""
fill-color="#999" />
<div v-else-if="!audioStream"
class="icon icon-loading" />
<p v-if="audioStreamErrorMessage">
Expand All @@ -44,7 +50,10 @@
reference is always valid once mounted. -->
<div v-show="audioPreviewAvailable"
class="volume-indicator-wrapper">
<div class="icon icon-audio" />
<Microphone
:size="64"
title=""
fill-color="#999" />
<span ref="volumeIndicator"
class="volume-indicator"
:style="{ 'height': currentVolumeIndicatorHeight + 'px' }" />
Expand Down Expand Up @@ -83,6 +92,8 @@
<script>
import attachMediaStream from 'attachmediastream'
import hark from 'hark'
import Microphone from 'vue-material-design-icons/Microphone'
import MicrophoneOff from 'vue-material-design-icons/MicrophoneOff'
import { mediaDevicesManager } from '../utils/webrtc/index'
import MediaDevicesSelector from './MediaDevicesSelector'

Expand All @@ -92,6 +103,8 @@ export default {

components: {
MediaDevicesSelector,
Microphone,
MicrophoneOff,
},

props: {
Expand Down
8 changes: 7 additions & 1 deletion src/components/TopBar/TopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@
v-if="showModerationOptions && canFullModerate && isInCall">
<ActionSeparator />
<ActionButton
icon="icon-audio"
:close-after-click="true"
@click="forceMuteOthers">
<MicrophoneOff
slot="icon"
:size="16"
decorative
title="" />
{{ t('spreed', 'Mute others') }}
</ActionButton>
</template>
Expand Down Expand Up @@ -106,6 +110,7 @@ import CallButton from './CallButton'
import BrowserStorage from '../../services/BrowserStorage'
import ActionLink from '@nextcloud/vue/dist/Components/ActionLink'
import ActionSeparator from '@nextcloud/vue/dist/Components/ActionSeparator'
import MicrophoneOff from 'vue-material-design-icons/MicrophoneOff'
import { CONVERSATION, PARTICIPANT } from '../../constants'
import { generateUrl } from '@nextcloud/router'
import { callParticipantCollection } from '../../utils/webrtc/index'
Expand All @@ -120,6 +125,7 @@ export default {
ActionLink,
CallButton,
ActionSeparator,
MicrophoneOff,
},

props: {
Expand Down

0 comments on commit 484a223

Please sign in to comment.