Add overlay scrollbars with custom styling

This commit is contained in:
Sebastian Martinez
2025-06-11 19:54:59 +02:00
parent 499a0983ea
commit e246a48b90
8 changed files with 119 additions and 88 deletions
+16
View File
@@ -4,6 +4,7 @@
import { getCurrentWindow } from "@tauri-apps/api/window";
import { onMount } from "svelte";
import { useOverlayScrollbars } from "overlayscrollbars-svelte";
import { dynamicInterval } from "@app/lib/interval";
import { invoke } from "@app/lib/invoke";
@@ -20,6 +21,7 @@
let { notificationCount }: Props = $props();
let borderComponent: HTMLElement | undefined = $state();
let notificationPopoverExpaneded: boolean = $state(false);
let buttonActive: boolean = $state(false);
@@ -29,6 +31,19 @@
}
});
$effect(() => {
if (borderComponent) {
const [initialize] = useOverlayScrollbars({
options: () => ({
scrollbars: { theme: "os-theme-radicle", autoHide: "scroll" },
}),
defer: true,
});
initialize({ target: borderComponent });
}
});
onMount(async () => {
await loadCounter();
});
@@ -128,6 +143,7 @@
{#snippet popover()}
<Border
bind:innerElement={borderComponent}
variant="ghost"
styleWidth="40rem"
stylePadding="1rem"