Improve background settings and fix save button (#24978)

This commit is contained in:
Wendelin 2025-04-09 12:04:07 +02:00 committed by GitHub
parent 828bf977b2
commit ccee57f4a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 3 deletions

View File

@ -83,6 +83,10 @@ export class HaBackgroundSelector extends LitElement {
display: block;
position: relative;
}
ha-picture-upload {
background-color: var(--primary-background-color);
border-radius: var(--file-upload-image-border-radius);
}
div {
display: flex;
flex-direction: column;

View File

@ -303,6 +303,7 @@ export class HuiDialogEditView extends LitElement {
`
: nothing}
<ha-button
class="save"
slot="primaryAction"
?disabled=${!this._config ||
this._saving ||
@ -665,6 +666,15 @@ export class HuiDialogEditView extends LitElement {
ha-alert ha-button {
display: block;
}
ha-button.save {
position: relative;
}
.save ha-spinner {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
@media all and (min-width: 600px) {
ha-dialog {

View File

@ -1,11 +1,9 @@
import "@material/mwc-list/mwc-list-item";
import memoizeOne from "memoize-one";
import { LitElement, css, html, nothing } from "lit";
import { customElement, property, state } from "lit/decorators";
import { fireEvent } from "../../../../common/dom/fire_event";
import "../../../../components/ha-form/ha-form";
import type { SchemaUnion } from "../../../../components/ha-form/types";
import "../../../../components/ha-selector/ha-selector-background";
import type { LovelaceViewConfig } from "../../../../data/lovelace/config/view";
import type { HomeAssistant } from "../../../../types";
@ -38,7 +36,7 @@ export class HuiViewBackgroundEditor extends LitElement {
{
name: "opacity",
selector: {
number: { min: 0, max: 100, mode: "slider" },
number: { min: 0, max: 100, mode: "slider", step: 10 },
},
},
{