mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
View background settings: Change transparancy to opacity (#23450)
This commit is contained in:
parent
351d318c89
commit
d0327915db
@ -9,7 +9,7 @@ export interface ShowViewConfig {
|
||||
|
||||
export interface LovelaceViewBackgroundConfig {
|
||||
image?: string;
|
||||
transparency?: number;
|
||||
opacity?: number;
|
||||
size?: "auto" | "cover" | "contain";
|
||||
alignment?:
|
||||
| "top left"
|
||||
|
@ -37,7 +37,7 @@ export class HuiViewBackgroundEditor extends LitElement {
|
||||
type: "expandable" as const,
|
||||
schema: [
|
||||
{
|
||||
name: "transparency",
|
||||
name: "opacity",
|
||||
selector: {
|
||||
number: { min: 1, max: 100, mode: "slider" },
|
||||
},
|
||||
@ -117,7 +117,7 @@ export class HuiViewBackgroundEditor extends LitElement {
|
||||
|
||||
if (!background) {
|
||||
background = {
|
||||
transparency: 33,
|
||||
opacity: 33,
|
||||
alignment: "center",
|
||||
size: "cover",
|
||||
repeat: "repeat",
|
||||
@ -125,7 +125,7 @@ export class HuiViewBackgroundEditor extends LitElement {
|
||||
};
|
||||
} else {
|
||||
background = {
|
||||
transparency: 100,
|
||||
opacity: 100,
|
||||
alignment: "center",
|
||||
size: "cover",
|
||||
repeat: "no-repeat",
|
||||
@ -162,9 +162,9 @@ export class HuiViewBackgroundEditor extends LitElement {
|
||||
return this.hass.localize(
|
||||
"ui.panel.lovelace.editor.edit_view.background.image"
|
||||
);
|
||||
case "transparency":
|
||||
case "opacity":
|
||||
return this.hass.localize(
|
||||
"ui.panel.lovelace.editor.edit_view.background.transparency"
|
||||
"ui.panel.lovelace.editor.edit_view.background.opacity"
|
||||
);
|
||||
case "alignment":
|
||||
return this.hass.localize(
|
||||
|
@ -67,8 +67,8 @@ export class HUIViewBackground extends LitElement {
|
||||
background?: string | LovelaceViewBackgroundConfig
|
||||
) {
|
||||
if (typeof background === "object" && background.image) {
|
||||
if (background.transparency) {
|
||||
return `${background.transparency}%`;
|
||||
if (background.opacity) {
|
||||
return `${background.opacity}%`;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -5956,7 +5956,7 @@
|
||||
"bottom right": "Bottom right"
|
||||
}
|
||||
},
|
||||
"transparency": "Background transparency",
|
||||
"opacity": "Background opacity",
|
||||
"repeat": {
|
||||
"name": "Background repeat",
|
||||
"options": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user