Skip to content

Commit f27be14

Browse files
committed
fix: incorrect styling for audio input format in player
1 parent 11cad8c commit f27be14

File tree

1 file changed

+27
-30
lines changed

1 file changed

+27
-30
lines changed

src/components/player-controls.ts

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { MediaPlayer } from '../model/media-player';
1919
import { until } from 'lit-html/directives/until.js';
2020
import { findPlayer } from '../utils/utils';
2121
import MediaBrowseService from '../services/media-browse-service';
22+
import { when } from 'lit/directives/when.js';
2223

2324
class PlayerControls extends LitElement {
2425
@property({ attribute: false }) store!: Store;
@@ -48,31 +49,34 @@ class PlayerControls extends LitElement {
4849
const playing = this.activePlayer.isPlaying();
4950
return html`
5051
<div class="main" id="mediaControls">
51-
<div class="icons">
52-
<div class="flex-1"></div>
53-
<ha-icon-button hide=${noUpDown} @click=${this.volDown} .path=${mdiVolumeMinus}></ha-icon-button>
54-
<sonos-shuffle hide=${noShuffle} .store=${this.store}></sonos-shuffle>
55-
<ha-icon-button hide=${noPrev} @click=${this.prev} .path=${mdiSkipPrevious}></ha-icon-button>
56-
<ha-icon-button hide=${noFastForwardAndRewind} @click=${this.rewind} .path=${mdiRewind}></ha-icon-button>
57-
<ha-icon-button @click=${playing ? this.pauseOrStop : this.play} .path=${playing ? pauseOrStop : mdiPlayCircle} class="big-icon"></ha-icon-button>
58-
<ha-icon-button hide=${noFastForwardAndRewind} @click=${this.fastForward} .path=${mdiFastForward}></ha-icon-button>
59-
<ha-icon-button hide=${noNext} @click=${this.next} .path=${mdiSkipNext}></ha-icon-button>
60-
<sonos-repeat hide=${noRepeat} .store=${this.store} ></sonos-repeat>
61-
62-
<ha-icon-button hide=${noUpDown} @click=${this.volUp} .path=${mdiVolumePlus}></ha-icon-button>
63-
<div class="audio-input-format">
64-
${this.config.showAudioInputFormat && until(this.getAudioInputFormat())}
65-
</div>
66-
<ha-icon-button hide=${noBrowse} @click=${this.browseMedia} .path=${mdiPlayBoxMultiple}></ha-icon-button>
52+
<div class="icons">
53+
<div class="flex-1"></div>
54+
<ha-icon-button hide=${noUpDown} @click=${this.volDown} .path=${mdiVolumeMinus}></ha-icon-button>
55+
<sonos-shuffle hide=${noShuffle} .store=${this.store}></sonos-shuffle>
56+
<ha-icon-button hide=${noPrev} @click=${this.prev} .path=${mdiSkipPrevious}></ha-icon-button>
57+
<ha-icon-button hide=${noFastForwardAndRewind} @click=${this.rewind} .path=${mdiRewind}></ha-icon-button>
58+
<ha-icon-button @click=${playing ? this.pauseOrStop : this.play}
59+
.path=${playing ? pauseOrStop : mdiPlayCircle} class="big-icon"></ha-icon-button>
60+
<ha-icon-button hide=${noFastForwardAndRewind} @click=${this.fastForward}
61+
.path=${mdiFastForward}></ha-icon-button>
62+
<ha-icon-button hide=${noNext} @click=${this.next} .path=${mdiSkipNext}></ha-icon-button>
63+
<sonos-repeat hide=${noRepeat} .store=${this.store}></sonos-repeat>
64+
65+
<ha-icon-button hide=${noUpDown} @click=${this.volUp} .path=${mdiVolumePlus}></ha-icon-button>
66+
<div class="audio-input-format">
67+
${when(this.config.showAudioInputFormat, () => until(this.getAudioInputFormat()))}
6768
</div>
68-
<sonos-volume .store=${this.store} .player=${this.volumePlayer}
69-
.updateMembers=${this.updateMemberVolumes}></sonos-volume>
70-
<div class="icons">
71-
<ha-icon-button hide=${this.store.hidePower(true)} @click=${this.togglePower}></ha-icon-button>
72-
</div">
69+
<ha-icon-button hide=${noBrowse} @click=${this.browseMedia} .path=${mdiPlayBoxMultiple}></ha-icon-button>
70+
</div>
71+
<sonos-volume .store=${this.store} .player=${this.volumePlayer}
72+
.updateMembers=${this.updateMemberVolumes}></sonos-volume>
73+
<div class="icons">
74+
<ha-icon-button hide=${this.store.hidePower(true)} @click=${this.togglePower}></ha-icon-button>
75+
</div">
7376
</div>
74-
`;
77+
`;
7578
}
79+
7680
private prev = async () => await this.mediaControlService.prev(this.activePlayer);
7781
private play = async () => await this.mediaControlService.play(this.activePlayer);
7882
private pauseOrStop = async () => {
@@ -139,19 +143,12 @@ class PlayerControls extends LitElement {
139143
flex: 1 0 0;
140144
margin-bottom: 10px;
141145
text-align: center;
142-
align-self: stretch;
143-
position: relative;
146+
align-self: end;
144147
}
145148
.audio-input-format > div {
146149
color: var(--card-background-color);
147150
background: var(--disabled-text-color);
148-
text-overflow: ellipsis;
149-
overflow: hidden;
150151
white-space: nowrap;
151-
position: absolute;
152-
bottom: 0;
153-
right: 0;
154-
max-width: 100%;
155152
font-size: smaller;
156153
line-height: normal;
157154
padding: 3px;

0 commit comments

Comments
 (0)