Tweak retain_definitely to work wide the newer thumbnails.

This commit is contained in:
Dermot Duffy
2022-03-20 20:06:20 -07:00
parent c4ec94573c
commit 0ae9afef4b
7 changed files with 41 additions and 27 deletions
+2
View File
@@ -13,6 +13,7 @@ import {
} from '../types.js'; } from '../types.js';
import { BrowseMediaUtil } from '../browse-media-util.js'; import { BrowseMediaUtil } from '../browse-media-util.js';
import { View } from '../view.js'; import { View } from '../view.js';
import { localize } from '../localize/localize.js';
import { renderProgressIndicator } from './message.js'; import { renderProgressIndicator } from './message.js';
import { stopEventFromActivatingCardWideActions } from '../common.js'; import { stopEventFromActivatingCardWideActions } from '../common.js';
@@ -221,6 +222,7 @@ export class FrigateCardGalleryCore extends LitElement {
/>${child.frigate?.event?.retain_indefinitely ? html`<ha-icon />${child.frigate?.event?.retain_indefinitely ? html`<ha-icon
class="favorite" class="favorite"
icon="mdi:star" icon="mdi:star"
title=${localize('event.retain_indefinitely')}
/>` : ``}` />` : ``}`
: ``} : ``}
</div> </div>
+5 -1
View File
@@ -38,7 +38,11 @@ export class FrigateCardThumbnail extends FrigateCardCarousel {
title="${this.media.title}" title="${this.media.title}"
/> />
${event?.retain_indefinitely ${event?.retain_indefinitely
? html` <ha-icon class="favorite" icon="mdi:star" />` ? html` <ha-icon
class="favorite"
icon="mdi:star"
title=${localize('event.retain_indefinitely')}
/>`
: ``} : ``}
${this.details && event ${this.details && event
? html` <div class="details"> ? html` <div class="details">
+2 -1
View File
@@ -211,7 +211,8 @@
"event": { "event": {
"start": "Start", "start": "Start",
"duration": "Duration", "duration": "Duration",
"in_progress": "In Progress" "in_progress": "In Progress",
"retain_indefinitely": "Event will be indefinitely retained"
}, },
"error": { "error": {
"empty_response": "Received empty response from Home Assistant for request", "empty_response": "Received empty response from Home Assistant for request",
+6
View File
@@ -38,6 +38,12 @@ ha-icon.control {
padding-bottom: $drawer-padding-extend; padding-bottom: $drawer-padding-extend;
} }
:host([open]) ha-icon.control {
// When the drawer is open make the button to close it more prominent.
opacity: 1;
background-color: black;
}
:host([location='left']) ha-icon.control { :host([location='left']) ha-icon.control {
border-top-right-radius: $drawer-icon-size; border-top-right-radius: $drawer-icon-size;
border-bottom-right-radius: $drawer-icon-size; border-bottom-right-radius: $drawer-icon-size;
+14 -14
View File
@@ -1,16 +1,21 @@
@use "@material/image-list/mdc-image-list"; @use '@material/image-list/mdc-image-list';
@use "@material/image-list"; @use '@material/image-list';
@use 'thumbnail';
:host { :host {
display: block; display: block;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: auto; overflow: auto;
-ms-overflow-style: none; /* Hide scrollbar: IE and Edge */
scrollbar-width: none; /* Hide scrollbar: Firefox */ // Hide scrollbar: IE and Edge
-ms-overflow-style: none;
// Hide scrollbar: Firefox
scrollbar-width: none;
} }
/* Hide scrollbar for Chrome, Safari and Opera */ // Hide scrollbar for Chrome, Safari and Opera
:host::-webkit-scrollbar { :host::-webkit-scrollbar {
display: none; display: none;
} }
@@ -44,12 +49,7 @@ ha-card.frigate-card-gallery-folder {
height: 100%; height: 100%;
line-height: 1; line-height: 1;
} }
.favorite {
position: absolute; @include thumbnail.thumbnail-favorite() {
transform: translate(-50%, -50%); opacity: 0.8;
height: 24px; } ;
width: 24px;
top: 10%;
left: 90%;
color: yellow;
}
+8 -7
View File
@@ -54,12 +54,13 @@ span.heading {
font-weight: bold; font-weight: bold;
} }
.favorite { @mixin thumbnail-favorite() {
ha-icon.favorite {
position: absolute; position: absolute;
transform: translate(-50%, -50%); color: var(--primary-color);
height: 24px; padding: 2px;
width: 24px; @content;
top: 12%;
left: 90%;
color: yellow;
} }
}
@include thumbnail-favorite()
+2 -2
View File
@@ -953,7 +953,7 @@ export interface FrigateEvent {
start_time: number; start_time: number;
top_score: number; top_score: number;
zones: string[]; zones: string[];
retain_indefinitely: boolean; retain_indefinitely?: boolean;
} }
export interface FrigateBrowseMediaSource extends BrowseMediaSource { export interface FrigateBrowseMediaSource extends BrowseMediaSource {
@@ -988,7 +988,7 @@ export const frigateBrowseMediaSourceSchema: z.ZodSchema<BrowseMediaSource> = z.
start_time: z.number(), start_time: z.number(),
top_score: z.number(), top_score: z.number(),
zones: z.string().array(), zones: z.string().array(),
retain_indefinitely: z.boolean(), retain_indefinitely: z.boolean().optional(),
}), }),
}) })
.optional(), .optional(),