Lovelace Menu Edits (#11323)

This commit is contained in:
Zack Barett 2022-01-24 03:14:32 -06:00 committed by GitHub
parent 9cd23374f4
commit abeaa63005
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 30 deletions

View File

@ -2,9 +2,7 @@ import "@material/mwc-button";
import "@material/mwc-list/mwc-list-item";
import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item";
import {
mdiClose,
mdiCodeBraces,
mdiCog,
mdiDotsVertical,
mdiFileMultiple,
mdiFormatListBulletedTriangle,
@ -119,13 +117,6 @@ class HUIRoot extends LitElement {
${this._editMode
? html`
<app-toolbar class="edit-mode">
<ha-icon-button
.label=${this.hass!.localize(
"ui.panel.lovelace.menu.exit_edit_mode"
)}
.path=${mdiClose}
@click=${this._editModeDisable}
></ha-icon-button>
<div main-title>
${this.config.title ||
this.hass!.localize("ui.panel.lovelace.editor.header")}
@ -138,6 +129,13 @@ class HUIRoot extends LitElement {
@click=${this._editLovelace}
></ha-icon-button>
</div>
<mwc-button
class="exit-edit-mode"
.label=${this.hass!.localize(
"ui.panel.lovelace.menu.exit_edit_mode"
)}
@click=${this._editModeDisable}
></mwc-button>
<a
href=${documentationUrl(this.hass, "/lovelace/")}
rel="noreferrer"
@ -377,30 +375,36 @@ class HUIRoot extends LitElement {
)}
<ha-svg-icon
slot="graphic"
.path=${mdiCog}
.path=${mdiPencil}
></ha-svg-icon>
</mwc-list-item>
`
: ""}
<a
href=${documentationUrl(this.hass, "/lovelace/")}
rel="noreferrer"
class="menu-link"
target="_blank"
>
<mwc-list-item
graphic="icon"
aria-label=${this.hass!.localize(
"ui.panel.lovelace.menu.help"
)}
>
${this.hass!.localize("ui.panel.lovelace.menu.help")}
<ha-svg-icon
slot="graphic"
.path=${mdiHelp}
></ha-svg-icon>
</mwc-list-item>
</a>
${this._editMode
? html`
<a
href=${documentationUrl(this.hass, "/lovelace/")}
rel="noreferrer"
class="menu-link"
target="_blank"
>
<mwc-list-item
graphic="icon"
aria-label=${this.hass!.localize(
"ui.panel.lovelace.menu.help"
)}
>
${this.hass!.localize(
"ui.panel.lovelace.menu.help"
)}
<ha-svg-icon
slot="graphic"
.path=${mdiHelp}
></ha-svg-icon>
</mwc-list-item>
</a>
`
: ""}
</ha-button-menu>
</app-toolbar>
`}
@ -933,6 +937,10 @@ class HUIRoot extends LitElement {
var(--primary-background-color)
);
}
.exit-edit-mode {
--mdc-theme-primary: var(--primary-text-color);
--mdc-typography-button-font-size: 14px;
}
`,
];
}

View File

@ -3184,7 +3184,7 @@
"help": "Help",
"start_conversation": "Start conversation",
"reload_resources": "Reload resources",
"exit_edit_mode": "Exit UI edit mode",
"exit_edit_mode": "Done",
"close": "Close"
},
"reload_resources": {