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 "@material/mwc-list/mwc-list-item";
import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item"; import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item";
import { import {
mdiClose,
mdiCodeBraces, mdiCodeBraces,
mdiCog,
mdiDotsVertical, mdiDotsVertical,
mdiFileMultiple, mdiFileMultiple,
mdiFormatListBulletedTriangle, mdiFormatListBulletedTriangle,
@ -119,13 +117,6 @@ class HUIRoot extends LitElement {
${this._editMode ${this._editMode
? html` ? html`
<app-toolbar class="edit-mode"> <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> <div main-title>
${this.config.title || ${this.config.title ||
this.hass!.localize("ui.panel.lovelace.editor.header")} this.hass!.localize("ui.panel.lovelace.editor.header")}
@ -138,6 +129,13 @@ class HUIRoot extends LitElement {
@click=${this._editLovelace} @click=${this._editLovelace}
></ha-icon-button> ></ha-icon-button>
</div> </div>
<mwc-button
class="exit-edit-mode"
.label=${this.hass!.localize(
"ui.panel.lovelace.menu.exit_edit_mode"
)}
@click=${this._editModeDisable}
></mwc-button>
<a <a
href=${documentationUrl(this.hass, "/lovelace/")} href=${documentationUrl(this.hass, "/lovelace/")}
rel="noreferrer" rel="noreferrer"
@ -377,30 +375,36 @@ class HUIRoot extends LitElement {
)} )}
<ha-svg-icon <ha-svg-icon
slot="graphic" slot="graphic"
.path=${mdiCog} .path=${mdiPencil}
></ha-svg-icon> ></ha-svg-icon>
</mwc-list-item> </mwc-list-item>
` `
: ""} : ""}
<a ${this._editMode
href=${documentationUrl(this.hass, "/lovelace/")} ? html`
rel="noreferrer" <a
class="menu-link" href=${documentationUrl(this.hass, "/lovelace/")}
target="_blank" rel="noreferrer"
> class="menu-link"
<mwc-list-item target="_blank"
graphic="icon" >
aria-label=${this.hass!.localize( <mwc-list-item
"ui.panel.lovelace.menu.help" 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" ${this.hass!.localize(
.path=${mdiHelp} "ui.panel.lovelace.menu.help"
></ha-svg-icon> )}
</mwc-list-item> <ha-svg-icon
</a> slot="graphic"
.path=${mdiHelp}
></ha-svg-icon>
</mwc-list-item>
</a>
`
: ""}
</ha-button-menu> </ha-button-menu>
</app-toolbar> </app-toolbar>
`} `}
@ -933,6 +937,10 @@ class HUIRoot extends LitElement {
var(--primary-background-color) 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", "help": "Help",
"start_conversation": "Start conversation", "start_conversation": "Start conversation",
"reload_resources": "Reload resources", "reload_resources": "Reload resources",
"exit_edit_mode": "Exit UI edit mode", "exit_edit_mode": "Done",
"close": "Close" "close": "Close"
}, },
"reload_resources": { "reload_resources": {