mirror of
https://seed.radicle.dev/rad:z4D5UCArafTzTQpDZNQRuqswh3ury.git
synced 2026-11-29 14:50:34 +08:00
Add overlay scrollbars with custom styling
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user