mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Media player RTL fixes (#3001)
This commit is contained in:
parent
86940f4d42
commit
45189c9163
@ -132,6 +132,10 @@ class HaMediaPlayerCard extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
|||||||
height: 44px;
|
height: 44px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.playback-controls {
|
||||||
|
direction: ltr;
|
||||||
|
}
|
||||||
|
|
||||||
paper-icon-button {
|
paper-icon-button {
|
||||||
opacity: var(--dark-primary-opacity);
|
opacity: var(--dark-primary-opacity);
|
||||||
}
|
}
|
||||||
@ -186,7 +190,7 @@ class HaMediaPlayerCard extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
|||||||
class="self-center secondary"
|
class="self-center secondary"
|
||||||
></paper-icon-button>
|
></paper-icon-button>
|
||||||
|
|
||||||
<div>
|
<div class="playback-controls">
|
||||||
<paper-icon-button
|
<paper-icon-button
|
||||||
icon="hass:skip-previous"
|
icon="hass:skip-previous"
|
||||||
invisible$="[[!playerObj.supportsPreviousTrack]]"
|
invisible$="[[!playerObj.supportsPreviousTrack]]"
|
||||||
|
@ -58,6 +58,11 @@ class HaPaperSlider extends PaperSliderClass {
|
|||||||
-webkit-transform: scale(1) translate(0, -10px);
|
-webkit-transform: scale(1) translate(0, -10px);
|
||||||
transform: scale(1) translate(0, -10px);
|
transform: scale(1) translate(0, -10px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:host([dir="rtl"]) .pin.expand > .slider-knob > .slider-knob-inner::after {
|
||||||
|
-webkit-transform: scale(1) translate(0, -17px) scaleX(-1) !important;
|
||||||
|
transform: scale(1) translate(0, -17px) scaleX(-1) !important;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
tpl.content.appendChild(styleEl);
|
tpl.content.appendChild(styleEl);
|
||||||
return tpl;
|
return tpl;
|
||||||
|
@ -14,6 +14,7 @@ import attributeClassNames from "../../../common/entity/attribute_class_names";
|
|||||||
import isComponentLoaded from "../../../common/config/is_component_loaded";
|
import isComponentLoaded from "../../../common/config/is_component_loaded";
|
||||||
import EventsMixin from "../../../mixins/events-mixin";
|
import EventsMixin from "../../../mixins/events-mixin";
|
||||||
import LocalizeMixin from "../../../mixins/localize-mixin";
|
import LocalizeMixin from "../../../mixins/localize-mixin";
|
||||||
|
import { computeRTLDirection } from "../../../common/util/compute_rtl";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @appliesMixin LocalizeMixin
|
* @appliesMixin LocalizeMixin
|
||||||
@ -137,6 +138,7 @@ class MoreInfoMediaPlayer extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
|||||||
on-change="volumeSliderChanged"
|
on-change="volumeSliderChanged"
|
||||||
class="flex"
|
class="flex"
|
||||||
ignore-bar-touch=""
|
ignore-bar-touch=""
|
||||||
|
dir="{{rtl}}"
|
||||||
>
|
>
|
||||||
</ha-paper-slider>
|
</ha-paper-slider>
|
||||||
</div>
|
</div>
|
||||||
@ -233,6 +235,11 @@ class MoreInfoMediaPlayer extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
|||||||
type: String,
|
type: String,
|
||||||
value: "",
|
value: "",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
rtl: {
|
||||||
|
type: String,
|
||||||
|
computed: "_computeRTLDirection(hass)",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -425,6 +432,10 @@ class MoreInfoMediaPlayer extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
|||||||
this.ttsMessage = "";
|
this.ttsMessage = "";
|
||||||
this.$.ttsInput.focus();
|
this.$.ttsInput.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_computeRTLDirection(hass) {
|
||||||
|
return computeRTLDirection(hass);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
customElements.define("more-info-media_player", MoreInfoMediaPlayer);
|
customElements.define("more-info-media_player", MoreInfoMediaPlayer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user