folder标题适配web端

This commit is contained in:
xintaofei
2026-03-25 22:39:57 +08:00
parent e93b0586b9
commit c4809bec46
2 changed files with 8 additions and 5 deletions

View File

@@ -25,11 +25,14 @@ export function AppTitleBar({
showWindowControls = true, showWindowControls = true,
}: AppTitleBarProps) { }: AppTitleBarProps) {
const { isMac, isWindows } = usePlatform() const { isMac, isWindows } = usePlatform()
const isDesktopRuntime =
typeof window !== "undefined" && "__TAURI_INTERNALS__" in window
const hasDesktopWindowChrome = showWindowControls && isDesktopRuntime
const rowPadding = cn( const rowPadding = cn(
"px-3", "px-3",
isMac && "pl-[76px]", isMac && hasDesktopWindowChrome && "pl-[76px]",
isWindows && showWindowControls && "pr-[138px]" isWindows && hasDesktopWindowChrome && "pr-[138px]"
) )
return ( return (
@@ -54,7 +57,7 @@ export function AppTitleBar({
<div <div
className={cn( className={cn(
"ml-auto shrink-0", "ml-auto shrink-0",
isWindows && showWindowControls && "mr-4" isWindows && hasDesktopWindowChrome && "mr-4"
)} )}
> >
{right} {right}
@@ -70,7 +73,7 @@ export function AppTitleBar({
</div> </div>
) : null} ) : null}
{showWindowControls && isWindows ? ( {hasDesktopWindowChrome && isWindows ? (
<div className="absolute right-0 top-0 z-30"> <div className="absolute right-0 top-0 z-30">
<WindowControls /> <WindowControls />
</div> </div>

View File

@@ -239,7 +239,7 @@ export function FolderTitleBar() {
<AppTitleBar <AppTitleBar
centerInteractive centerInteractive
left={ left={
<div className="flex items-center gap-4 min-w-0 pl-4"> <div className="flex min-w-0 items-center gap-4">
<FolderNameDropdown /> <FolderNameDropdown />
<BranchDropdown <BranchDropdown
branch={branch} branch={branch}