Merge pull request #6404 from yosilevy/RTL-dev-changes

Removed LTR force - looks much better
This commit is contained in:
Yosi Levy 2020-07-17 07:00:07 +03:00 committed by GitHub
commit ba67b1291f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 4 deletions

View File

@ -29,7 +29,6 @@ class HaPanelDevEvent extends EventsMixin(LocalizeMixin(PolymerElement)) {
-moz-user-select: initial; -moz-user-select: initial;
@apply --paper-font-body1; @apply --paper-font-body1;
padding: 16px; padding: 16px;
direction: ltr;
display: block; display: block;
} }

View File

@ -11,6 +11,7 @@ import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box";
import LocalizeMixin from "../../../mixins/localize-mixin"; import LocalizeMixin from "../../../mixins/localize-mixin";
import "../../../styles/polymer-ha-style"; import "../../../styles/polymer-ha-style";
import "../../../util/app-localstorage-document"; import "../../../util/app-localstorage-document";
import { computeRTL } from "../../../common/util/compute_rtl";
const ERROR_SENTINEL = {}; const ERROR_SENTINEL = {};
/* /*
@ -26,7 +27,6 @@ class HaPanelDevService extends LocalizeMixin(PolymerElement) {
-moz-user-select: initial; -moz-user-select: initial;
display: block; display: block;
padding: 16px; padding: 16px;
direction: ltr;
} }
.ha-form { .ha-form {
@ -51,8 +51,13 @@ class HaPanelDevService extends LocalizeMixin(PolymerElement) {
text-align: left; text-align: left;
} }
:host([rtl]) .attributes th {
text-align: right;
}
.attributes tr { .attributes tr {
vertical-align: top; vertical-align: top;
direction: ltr;
} }
.attributes tr:nth-child(odd) { .attributes tr:nth-child(odd) {
@ -83,6 +88,14 @@ class HaPanelDevService extends LocalizeMixin(PolymerElement) {
.error { .error {
color: var(--error-color); color: var(--error-color);
} }
:host([rtl]) .desc-container {
text-align: right;
}
:host([rtl]) .desc-container h3 {
direction: ltr;
}
</style> </style>
<app-localstorage-document <app-localstorage-document
@ -141,7 +154,9 @@ class HaPanelDevService extends LocalizeMixin(PolymerElement) {
</h1> </h1>
</template> </template>
<template is="dom-if" if="[[_description]]"> <template is="dom-if" if="[[_description]]">
<h3>[[_description]]</h3> <div class="desc-container">
<h3>[[_description]]</h3>
</div>
<table class="attributes"> <table class="attributes">
<tr> <tr>
@ -227,6 +242,10 @@ class HaPanelDevService extends LocalizeMixin(PolymerElement) {
type: String, type: String,
computed: "_computeDescription(hass, _domain, _service)", computed: "_computeDescription(hass, _domain, _service)",
}, },
rtl: {
reflectToAttribute: true,
computed: "_computeRTL(hass)",
},
}; };
} }
@ -329,6 +348,10 @@ class HaPanelDevService extends LocalizeMixin(PolymerElement) {
_yamlChanged(ev) { _yamlChanged(ev) {
this.serviceData = ev.detail.value; this.serviceData = ev.detail.value;
} }
_computeRTL(hass) {
return computeRTL(hass);
}
} }
customElements.define("developer-tools-service", HaPanelDevService); customElements.define("developer-tools-service", HaPanelDevService);

View File

@ -13,6 +13,7 @@ import { EventsMixin } from "../../../mixins/events-mixin";
import LocalizeMixin from "../../../mixins/localize-mixin"; import LocalizeMixin from "../../../mixins/localize-mixin";
import "../../../styles/polymer-ha-style"; import "../../../styles/polymer-ha-style";
import { mdiInformationOutline } from "@mdi/js"; import { mdiInformationOutline } from "@mdi/js";
import { computeRTL } from "../../../common/util/compute_rtl";
const ERROR_SENTINEL = {}; const ERROR_SENTINEL = {};
/* /*
@ -29,7 +30,6 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
-moz-user-select: initial; -moz-user-select: initial;
display: block; display: block;
padding: 16px; padding: 16px;
direction: ltr;
} }
.inputs { .inputs {
@ -44,8 +44,13 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
text-align: left; text-align: left;
} }
:host([rtl]) .entities th {
text-align: right;
}
.entities tr { .entities tr {
vertical-align: top; vertical-align: top;
direction: ltr;
} }
.entities tr:nth-child(odd) { .entities tr:nth-child(odd) {
@ -232,6 +237,10 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
computed: computed:
"computeEntities(hass, _entityFilter, _stateFilter, _attributeFilter)", "computeEntities(hass, _entityFilter, _stateFilter, _attributeFilter)",
}, },
rtl: {
reflectToAttribute: true,
computed: "_computeRTL(hass)",
},
}; };
} }
@ -396,6 +405,10 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
_yamlChanged(ev) { _yamlChanged(ev) {
this._stateAttributes = ev.detail.value; this._stateAttributes = ev.detail.value;
} }
_computeRTL(hass) {
return computeRTL(hass);
}
} }
customElements.define("developer-tools-state", HaPanelDevState); customElements.define("developer-tools-state", HaPanelDevState);