Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix icons not showing in new frontend version #556

Merged
merged 2 commits into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class MiniMediaPlayerDropdown extends LitElement {
class='mmp-dropdown__button icon'
slot='dropdown-trigger'
.icon=${ICON.DROPDOWN}>
<ha-icon .icon=${ICON.DROPDOWN}></ha-icon>
</ha-icon-button>
` : html`
<mmp-button class='mmp-dropdown__button' slot='dropdown-trigger'>
Expand Down
15 changes: 15 additions & 0 deletions src/components/mediaControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class MiniMediaPlayerMediaControls extends LitElement {
<ha-icon-button
@click=${e => this.player.prev(e)}
.icon=${ICON.PREV}>
<ha-icon .icon=${ICON.PREV}></ha-icon>
</ha-icon-button>` : ''}
${this.renderJumpBackwardButton()}
${this.renderPlayButtons()}
Expand All @@ -57,6 +58,7 @@ class MiniMediaPlayerMediaControls extends LitElement {
<ha-icon-button
@click=${e => this.player.next(e)}
.icon=${ICON.NEXT}>
<ha-icon .icon=${ICON.NEXT}></ha-icon>
</ha-icon-button>` : ''}
</div>
` : html``}
Expand All @@ -71,6 +73,7 @@ class MiniMediaPlayerMediaControls extends LitElement {
@click=${e => this.player.toggleShuffle(e)}
.icon=${ICON.SHUFFLE}
?color=${this.player.shuffle}>
<ha-icon .icon=${ICON.SHUFFLE}></ha-icon>
</ha-icon-button>
</div>
` : html``;
Expand All @@ -87,6 +90,7 @@ class MiniMediaPlayerMediaControls extends LitElement {
@click=${e => this.player.toggleRepeat(e)}
.icon=${ICON.REPEAT[this.player.repeat]}
?color=${colored}>
<ha-icon .icon=${ICON.REPEAT[this.player.repeat]}></ha-icon>
</ha-icon-button>
</div>
`;
Expand Down Expand Up @@ -133,10 +137,12 @@ class MiniMediaPlayerMediaControls extends LitElement {
<ha-icon-button
@click=${e => this.player.volumeDown(e)}
.icon=${ICON.VOL_DOWN}>
<ha-icon .icon=${ICON.VOL_DOWN}></ha-icon>
</ha-icon-button>
<ha-icon-button
@click=${e => this.player.volumeUp(e)}
.icon=${ICON.VOL_UP}>
<ha-icon .icon=${ICON.VOL_UP}></ha-icon>
</ha-icon-button>
`;
}
Expand All @@ -156,27 +162,31 @@ class MiniMediaPlayerMediaControls extends LitElement {
<ha-icon-button
@click=${e => this.player.playPause(e)}
.icon=${ICON.PLAY[this.player.isPlaying]}>
<ha-icon .icon=${ICON.PLAY[this.player.isPlaying]}></ha-icon>
</ha-icon-button>
`;
case 'stop':
return html`
<ha-icon-button
@click=${e => this.player.stop(e)}
.icon=${ICON.STOP.true}>
<ha-icon .icon=${ICON.STOP.true}></ha-icon>
</ha-icon-button>
`;
case 'play_stop':
return html`
<ha-icon-button
@click=${e => this.player.playStop(e)}
.icon=${ICON.STOP[this.player.isPlaying]}>
<ha-icon .icon=${ICON.STOP[this.player.isPlaying]}></ha-icon>
</ha-icon-button>
`;
case 'next':
return html`
<ha-icon-button
@click=${e => this.player.next(e)}
.icon=${ICON.NEXT}>
<ha-icon .icon=${ICON.NEXT}></ha-icon>
</ha-icon-button>
`;
default:
Expand All @@ -185,6 +195,7 @@ class MiniMediaPlayerMediaControls extends LitElement {
<ha-icon-button
@click=${e => this.player.toggleMute(e)}
.icon=${ICON.MUTE[muted]}>
<ha-icon .icon=${ICON.MUTE[muted]}></ha-icon>
</ha-icon-button>
`;
}
Expand All @@ -197,12 +208,14 @@ class MiniMediaPlayerMediaControls extends LitElement {
<ha-icon-button
@click=${e => this.player.playPause(e)}
.icon=${ICON.PLAY[this.player.isPlaying]}>
<ha-icon .icon=${ICON.PLAY[this.player.isPlaying]}></ha-icon>
</ha-icon-button>
` : html``}
${!hide.play_stop ? html`
<ha-icon-button
@click=${e => this.handleStop(e)}
.icon=${hide.play_pause ? ICON.STOP[this.player.isPlaying] : ICON.STOP.true}>
<ha-icon .icon=${hide.play_pause ? ICON.STOP[this.player.isPlaying] : ICON.STOP.true}></ha-icon>
</ha-icon-button>
` : html``}
`;
Expand All @@ -215,6 +228,7 @@ class MiniMediaPlayerMediaControls extends LitElement {
<ha-icon-button
@click=${e => this.player.jump(e, this.jumpAmount)}
.icon=${ICON.FAST_FORWARD}>
<ha-icon .icon=${ICON.FAST_FORWARD}></ha-icon>
</ha-icon-button>
`;
}
Expand All @@ -226,6 +240,7 @@ class MiniMediaPlayerMediaControls extends LitElement {
<ha-icon-button
@click=${e => this.player.jump(e, -this.jumpAmount)}
.icon=${ICON.REWIND}>
<ha-icon .icon=${ICON.REWIND}></ha-icon>
</ha-icon-button>
`;
}
Expand Down
3 changes: 3 additions & 0 deletions src/components/powerstrip.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,14 @@ class MiniMediaPlayerPowerstrip extends LitElement {
?inactive=${!this.player.isGrouped}
?color=${this.groupVisible}
@click=${this.handleGroupClick}>
<ha-icon .icon=${this.icon}></ha-icon>
</ha-icon-button>` : ''}
${this.showPowerButton ? html`
<ha-icon-button class='power-button'
.icon=${ICON.POWER}
@click=${e => this.player.toggle(e)}
?color=${this.powerColor}>
<ha-icon .icon=${ICON.POWER}></ha-icon>
</ha-icon-button>` : ''}
`;
}
Expand All @@ -115,6 +117,7 @@ class MiniMediaPlayerPowerstrip extends LitElement {
<ha-icon-button
.icon=${ICON.PLAY[this.player.isPlaying]}
@click=${e => this.player.playPause(e)}>
<ha-icon .icon=${ICON.PLAY[this.player.isPlaying]}></ha-icon>
</ha-icon-button>`;
else if (this.showLabel)
return html`
Expand Down