Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/managers/notification-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ class NotificationManager extends LitElement {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 12px;
}
mwc-button {
color: var(--primary-color);
font-weight: bold;
margin-left: 8px;
}
`;
}
Expand Down
23 changes: 22 additions & 1 deletion src/panels/config/automation/ha-automation-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import "../../../components/ha-card";
import "../../../components/ha-icon-button";
import "../../../components/ha-svg-icon";
import "../../../components/ha-yaml-editor";
import { showToast } from "../../../util/toast";
import type { HaYamlEditor } from "../../../components/ha-yaml-editor";
import {
AutomationConfig,
Expand Down Expand Up @@ -132,6 +133,7 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
${this.hass.localize("ui.panel.config.automation.editor.edit_ui")}
${this._mode === "gui"
? html`<ha-svg-icon
class="selected_menu_item"
slot="graphic"
.path=${mdiCheck}
></ha-svg-icon>`
Expand All @@ -147,6 +149,7 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
${this.hass.localize("ui.panel.config.automation.editor.edit_yaml")}
${this._mode === "yaml"
? html`<ha-svg-icon
class="selected_menu_item"
slot="graphic"
.path=${mdiCheck}
></ha-svg-icon>`
Expand All @@ -168,6 +171,7 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
<ha-svg-icon
slot="graphic"
.path=${mdiContentDuplicate}
class=${classMap({ enabled_icon: this.automationId })}
></ha-svg-icon>
</mwc-list-item>

Expand All @@ -182,7 +186,12 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
${this.hass.localize(
"ui.panel.config.automation.picker.delete_automation"
)}
<ha-svg-icon slot="graphic" .path=${mdiDelete}></ha-svg-icon>
<ha-svg-icon
class=${classMap({ warning: this.automationId })}
slot="graphic"
.path=${mdiDelete}
>
</ha-svg-icon>
</mwc-list-item>
</ha-button-menu>
${this._config
Expand Down Expand Up @@ -725,6 +734,9 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
},
(errors) => {
this._errors = errors.body.message;
showToast(this, {
message: errors.body.message,
});
throw errors;
}
);
Expand Down Expand Up @@ -766,6 +778,15 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
mwc-fab.dirty {
bottom: 0;
}
.enabled_icon {
color: var(--primary-text-color);
}
.selected_menu_item {
color: var(--primary-color);
}
Comment on lines +781 to +786
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that the correct link you wanted to paste? If yes, I must be missing the point how the quickbar is related to this PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mdc-theme-text-secondary-on-background variable is the one used for the icon, that is what you are fixing here right? (they both use mwc-list-item)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I thought the link pointed to ha-quick-bar.ts. My change however, does one extra thing: The checkbox icon is colored in primary-color. Also, in case the menu option is disabled, what would happen with your change?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a test by copying the mentioned style line from your PR. Does not work for me. All icons are black except the last one which I colored red.

li[role="separator"] {
border-bottom-color: var(--divider-color);
}
`,
];
}
Expand Down
4 changes: 4 additions & 0 deletions src/panels/config/scene/ha-scene-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import { HomeAssistant, Route } from "../../../types";
import "../ha-config-section";
import { configSections } from "../ha-panel-config";
import "../../../components/ha-svg-icon";
import { showToast } from "../../../util/toast";
import { mdiContentSave } from "@mdi/js";
import { KeyboardShortcutMixin } from "../../../mixins/keyboard-shortcut-mixin";

Expand Down Expand Up @@ -715,6 +716,9 @@ export class HaSceneEditor extends SubscribeMixin(
}
} catch (err) {
this._errors = err.body.message || err.message;
showToast(this, {
message: err.body.message || err.message,
});
throw err;
}
}
Expand Down
36 changes: 30 additions & 6 deletions src/panels/config/script/ha-script-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
>
${this.hass.localize("ui.panel.config.automation.editor.edit_ui")}
${this._mode === "gui"
? html`<ha-svg-icon
? html` <ha-svg-icon
class="selected_menu_item"
slot="graphic"
.path=${mdiCheck}
></ha-svg-icon>`
Expand All @@ -121,7 +122,8 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
>
${this.hass.localize("ui.panel.config.automation.editor.edit_yaml")}
${this._mode === "yaml"
? html`<ha-svg-icon
? html` <ha-svg-icon
class="selected_menu_item"
slot="graphic"
.path=${mdiCheck}
></ha-svg-icon>`
Expand All @@ -139,7 +141,12 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
graphic="icon"
>
${this.hass.localize("ui.panel.config.script.editor.delete_script")}
<ha-svg-icon slot="graphic" .path=${mdiDelete}></ha-svg-icon>
<ha-svg-icon
class=${classMap({ warning: this.scriptEntityId })}
slot="graphic"
.path=${mdiDelete}
>
</ha-svg-icon>
</mwc-list-item>
</ha-button-menu>
${this.narrow
Expand Down Expand Up @@ -573,9 +580,17 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {

private _saveScript(): void {
if (this._idError) {
this._errors = this.hass.localize(
"ui.panel.config.script.editor.id_already_exists_save_error"
);
showToast(this, {
message: this.hass.localize(
"ui.panel.config.script.editor.id_already_exists_save_error"
),
dismissable: false,
duration: 0,
action: {
action: () => {},
text: this.hass.localize("ui.dialogs.generic.ok"),
},
});
return;
}
const id = this.scriptEntityId
Expand All @@ -591,6 +606,9 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
},
(errors) => {
this._errors = errors.body.message;
showToast(this, {
message: errors.body.message,
});
throw errors;
}
);
Expand Down Expand Up @@ -629,6 +647,12 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
mwc-fab.dirty {
bottom: 0;
}
.selected_menu_item {
color: var(--primary-color);
}
li[role="separator"] {
border-bottom-color: var(--divider-color);
}
`,
];
}
Expand Down