folder标题适配web端
This commit is contained in:
@@ -25,11 +25,14 @@ export function AppTitleBar({
|
||||
showWindowControls = true,
|
||||
}: AppTitleBarProps) {
|
||||
const { isMac, isWindows } = usePlatform()
|
||||
const isDesktopRuntime =
|
||||
typeof window !== "undefined" && "__TAURI_INTERNALS__" in window
|
||||
const hasDesktopWindowChrome = showWindowControls && isDesktopRuntime
|
||||
|
||||
const rowPadding = cn(
|
||||
"px-3",
|
||||
isMac && "pl-[76px]",
|
||||
isWindows && showWindowControls && "pr-[138px]"
|
||||
isMac && hasDesktopWindowChrome && "pl-[76px]",
|
||||
isWindows && hasDesktopWindowChrome && "pr-[138px]"
|
||||
)
|
||||
|
||||
return (
|
||||
@@ -54,7 +57,7 @@ export function AppTitleBar({
|
||||
<div
|
||||
className={cn(
|
||||
"ml-auto shrink-0",
|
||||
isWindows && showWindowControls && "mr-4"
|
||||
isWindows && hasDesktopWindowChrome && "mr-4"
|
||||
)}
|
||||
>
|
||||
{right}
|
||||
@@ -70,7 +73,7 @@ export function AppTitleBar({
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{showWindowControls && isWindows ? (
|
||||
{hasDesktopWindowChrome && isWindows ? (
|
||||
<div className="absolute right-0 top-0 z-30">
|
||||
<WindowControls />
|
||||
</div>
|
||||
|
||||
@@ -239,7 +239,7 @@ export function FolderTitleBar() {
|
||||
<AppTitleBar
|
||||
centerInteractive
|
||||
left={
|
||||
<div className="flex items-center gap-4 min-w-0 pl-4">
|
||||
<div className="flex min-w-0 items-center gap-4">
|
||||
<FolderNameDropdown />
|
||||
<BranchDropdown
|
||||
branch={branch}
|
||||
|
||||
Reference in New Issue
Block a user