Skip to content

Commit

Permalink
fix: electron window layout titleSticky ui (#1010)
Browse files Browse the repository at this point in the history
  • Loading branch information
yusixian authored Oct 18, 2024
1 parent ac488e0 commit 1135361
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/renderer/src/pages/(main)/(layer)/(subview)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import { getSidebarActiveView, setSidebarActiveView } from "~/atoms/sidebar"
import { MotionButtonBase } from "~/components/ui/button"
import { FABContainer, FABPortable } from "~/components/ui/fab"
import { ScrollArea } from "~/components/ui/scroll-area"
import { isElectronBuild } from "~/constants"
import { springScrollTo } from "~/lib/scroller"
import { cn } from "~/lib/utils"
import { cn, getOS } from "~/lib/utils"

import { useSubViewTitleValue } from "./hooks"

Expand Down Expand Up @@ -36,13 +37,18 @@ export function Component() {
}, [scrollRef])

const { t } = useTranslation()

// electron window has pt-[calc(var(--fo-window-padding-top)_-10px)]
const isElectronWindows = isElectronBuild && getOS() === "Windows"

return (
<div className="relative flex size-full">
<div
className={cn(
"absolute inset-x-0 top-0 z-10 p-4",
"grid grid-cols-[1fr_auto_1fr] items-center gap-4",
isTitleSticky && "group border-b bg-zinc-50/80 backdrop-blur-xl dark:bg-neutral-900/90",
isTitleSticky && isElectronWindows && "-top-5",
)}
>
<MotionButtonBase
Expand Down

0 comments on commit 1135361

Please sign in to comment.