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

View File

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