Change button to plus and minus to inc/dec position (#17194)

This commit is contained in:
Paul Bottein 2023-07-18 15:01:00 +02:00 committed by GitHub
parent d56273ec25
commit 000288aecb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 16 deletions

View File

@ -1,14 +1,14 @@
import "@material/mwc-button";
import { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
import {
mdiArrowDown,
mdiArrowUp,
mdiContentCopy,
mdiContentCut,
mdiContentDuplicate,
mdiDelete,
mdiDotsVertical,
mdiFileMoveOutline,
mdiMinus,
mdiPlus,
} from "@mdi/js";
import deepClone from "deep-clone-simple";
import {
@ -96,14 +96,12 @@ export class HuiCardOptions extends LitElement {
? html`
<ha-icon-button
.label=${this.hass!.localize(
"ui.panel.lovelace.editor.edit_card.move_down"
"ui.panel.lovelace.editor.edit_card.decrease_position"
)}
.path=${mdiArrowDown}
.path=${mdiMinus}
class="move-arrow"
@click=${this._cardDown}
.disabled=${this.lovelace!.config.views[this.path![0]]
.cards!.length ===
this.path![1] + 1}
@click=${this._decreaseCardPosiion}
?disabled=${this.path![1] === 0}
></ha-icon-button>
<ha-icon-button
@click=${this._changeCardPosition}
@ -115,12 +113,14 @@ export class HuiCardOptions extends LitElement {
</ha-icon-button>
<ha-icon-button
.label=${this.hass!.localize(
"ui.panel.lovelace.editor.edit_card.move_up"
"ui.panel.lovelace.editor.edit_card.increase_position"
)}
.path=${mdiArrowUp}
.path=${mdiPlus}
class="move-arrow"
@click=${this._cardUp}
?disabled=${this.path![1] === 0}
@click=${this._increaseCardPosition}
.disabled=${this.lovelace!.config.views[this.path![0]]
.cards!.length ===
this.path![1] + 1}
></ha-icon-button>
`
: nothing}
@ -291,7 +291,7 @@ export class HuiCardOptions extends LitElement {
this._clipboard = deepClone(cardConfig);
}
private _cardUp(): void {
private _decreaseCardPosiion(): void {
const lovelace = this.lovelace!;
const path = this.path!;
lovelace.saveConfig(
@ -299,7 +299,7 @@ export class HuiCardOptions extends LitElement {
);
}
private _cardDown(): void {
private _increaseCardPosition(): void {
const lovelace = this.lovelace!;
const path = this.path!;
lovelace.saveConfig(

View File

@ -4571,11 +4571,11 @@
"cut": "Cut",
"duplicate": "Duplicate",
"move": "Move to view",
"move_up": "Move card up",
"move_down": "Move card down",
"move_before": "Move card before",
"move_after": "Move card after",
"change_position": "Change card position",
"decrease_position": "Decrease card position",
"increase_position": "Increase card position",
"options": "More options",
"search_cards": "Search cards"
},