mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Change disabled icon to pencil-off (#5930)
This commit is contained in:
parent
61bd536d7b
commit
16154e9d8b
@ -1,3 +1,6 @@
|
|||||||
|
import "@material/mwc-fab";
|
||||||
|
import "@material/mwc-icon-button";
|
||||||
|
import { mdiPencil, mdiPencilOff, mdiPlus } from "@mdi/js";
|
||||||
import "@polymer/paper-item/paper-icon-item";
|
import "@polymer/paper-item/paper-icon-item";
|
||||||
import "@polymer/paper-item/paper-item-body";
|
import "@polymer/paper-item/paper-item-body";
|
||||||
import "@polymer/paper-listbox/paper-listbox";
|
import "@polymer/paper-listbox/paper-listbox";
|
||||||
@ -20,7 +23,7 @@ import { computeStateDomain } from "../../../common/entity/compute_state_domain"
|
|||||||
import { navigate } from "../../../common/navigate";
|
import { navigate } from "../../../common/navigate";
|
||||||
import { compare } from "../../../common/string/compare";
|
import { compare } from "../../../common/string/compare";
|
||||||
import "../../../components/ha-card";
|
import "../../../components/ha-card";
|
||||||
import "@material/mwc-fab";
|
import "../../../components/ha-svg-icon";
|
||||||
import "../../../components/map/ha-locations-editor";
|
import "../../../components/map/ha-locations-editor";
|
||||||
import type {
|
import type {
|
||||||
HaLocationsEditor,
|
HaLocationsEditor,
|
||||||
@ -47,8 +50,6 @@ import type { HomeAssistant, Route } from "../../../types";
|
|||||||
import "../ha-config-section";
|
import "../ha-config-section";
|
||||||
import { configSections } from "../ha-panel-config";
|
import { configSections } from "../ha-panel-config";
|
||||||
import { showZoneDetailDialog } from "./show-dialog-zone-detail";
|
import { showZoneDetailDialog } from "./show-dialog-zone-detail";
|
||||||
import "../../../components/ha-svg-icon";
|
|
||||||
import { mdiPlus } from "@mdi/js";
|
|
||||||
|
|
||||||
@customElement("ha-config-zone")
|
@customElement("ha-config-zone")
|
||||||
export class HaConfigZone extends SubscribeMixin(LitElement) {
|
export class HaConfigZone extends SubscribeMixin(LitElement) {
|
||||||
@ -148,17 +149,18 @@ export class HaConfigZone extends SubscribeMixin(LitElement) {
|
|||||||
@click=${this._itemClicked}
|
@click=${this._itemClicked}
|
||||||
.entry=${entry}
|
.entry=${entry}
|
||||||
>
|
>
|
||||||
<ha-icon .icon=${entry.icon} slot="item-icon"> </ha-icon>
|
<ha-icon .icon=${entry.icon} slot="item-icon"></ha-icon>
|
||||||
<paper-item-body>
|
<paper-item-body>
|
||||||
${entry.name}
|
${entry.name}
|
||||||
</paper-item-body>
|
</paper-item-body>
|
||||||
${!this.narrow
|
${!this.narrow
|
||||||
? html`
|
? html`
|
||||||
<ha-icon-button
|
<mwc-icon-button
|
||||||
icon="hass:pencil"
|
|
||||||
.entry=${entry}
|
.entry=${entry}
|
||||||
@click=${this._openEditEntry}
|
@click=${this._openEditEntry}
|
||||||
></ha-icon-button>
|
>
|
||||||
|
<ha-svg-icon .path=${mdiPencil}></ha-svg-icon>
|
||||||
|
</mwc-icon-button>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
</paper-icon-item>
|
</paper-icon-item>
|
||||||
@ -176,9 +178,8 @@ export class HaConfigZone extends SubscribeMixin(LitElement) {
|
|||||||
${state.attributes.friendly_name || state.entity_id}
|
${state.attributes.friendly_name || state.entity_id}
|
||||||
</paper-item-body>
|
</paper-item-body>
|
||||||
<div style="display:inline-block">
|
<div style="display:inline-block">
|
||||||
<ha-icon-button
|
<mwc-icon-button
|
||||||
.entityId=${state.entity_id}
|
.entityId=${state.entity_id}
|
||||||
icon="hass:pencil"
|
|
||||||
@click=${this._openCoreConfig}
|
@click=${this._openCoreConfig}
|
||||||
disabled=${ifDefined(
|
disabled=${ifDefined(
|
||||||
state.entity_id === "zone.home" &&
|
state.entity_id === "zone.home" &&
|
||||||
@ -187,7 +188,15 @@ export class HaConfigZone extends SubscribeMixin(LitElement) {
|
|||||||
? undefined
|
? undefined
|
||||||
: true
|
: true
|
||||||
)}
|
)}
|
||||||
></ha-icon-button>
|
>
|
||||||
|
<ha-svg-icon
|
||||||
|
.path=${state.entity_id === "zone.home" &&
|
||||||
|
this.narrow &&
|
||||||
|
this._canEditCore
|
||||||
|
? mdiPencil
|
||||||
|
: mdiPencilOff}
|
||||||
|
></ha-svg-icon>
|
||||||
|
</mwc-icon-button>
|
||||||
<paper-tooltip position="left">
|
<paper-tooltip position="left">
|
||||||
${state.entity_id === "zone.home"
|
${state.entity_id === "zone.home"
|
||||||
? this.hass.localize(
|
? this.hass.localize(
|
||||||
@ -477,7 +486,7 @@ export class HaConfigZone extends SubscribeMixin(LitElement) {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
ha-icon,
|
ha-icon,
|
||||||
ha-icon-button:not([disabled]) {
|
mwc-icon-button:not([disabled]) {
|
||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
}
|
}
|
||||||
.empty {
|
.empty {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user