Skip to content

Commit 4cd5534

Browse files
committed
Use fixed styles and adjust for safe areas on media browse dialog
1 parent bf6fc07 commit 4cd5534

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/components/media-player/dialog-media-player-browse.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import type {
1919
MediaPlayerItem,
2020
MediaPlayerLayoutType,
2121
} from "../../data/media-player";
22-
import { haStyleDialog } from "../../resources/styles";
22+
import { haStyleDialog, haStyleDialogFixedTop } from "../../resources/styles";
2323
import type { HomeAssistant } from "../../types";
2424
import "../ha-dialog";
2525
import "../ha-dialog-header";
@@ -223,30 +223,38 @@ class DialogMediaPlayerBrowse extends LitElement {
223223
static get styles(): CSSResultGroup {
224224
return [
225225
haStyleDialog,
226+
haStyleDialogFixedTop,
226227
css`
227228
ha-dialog {
228229
--dialog-z-index: 9;
229230
--dialog-content-padding: 0;
230231
}
231232
232233
ha-media-player-browse {
233-
--media-browser-max-height: calc(100vh - 65px);
234+
--media-browser-max-height: calc(
235+
100vh - 65px - var(--safe-area-inset-top, 0) -
236+
var(--safe-area-inset-bottom, 0)
237+
);
234238
}
235239
236240
:host(.opened) ha-media-player-browse {
237-
height: calc(100vh - 65px);
241+
height: calc(
242+
100vh - 65px - var(--safe-area-inset-top, 0) -
243+
var(--safe-area-inset-bottom, 0)
244+
);
238245
}
239246
240247
@media (min-width: 800px) {
241248
ha-dialog {
242249
--mdc-dialog-max-width: 800px;
243-
--dialog-surface-position: fixed;
244-
--dialog-surface-top: 40px;
245-
--mdc-dialog-max-height: calc(100vh - 72px);
250+
--mdc-dialog-max-height: calc(100% - 72px);
246251
}
247252
ha-media-player-browse {
248253
position: initial;
249-
--media-browser-max-height: calc(100vh - 145px);
254+
--media-browser-max-height: calc(
255+
100vh - 145px - var(--safe-area-inset-top, 0) -
256+
var(--safe-area-inset-bottom, 0)
257+
);
250258
width: 700px;
251259
}
252260
}

0 commit comments

Comments
 (0)