|
|
|
@ -70,7 +70,8 @@ export function MediaInpaintingToolbar({ |
|
|
|
left: centerX, |
|
|
|
top: frameRect.top, |
|
|
|
transform: "translate(-50%, calc(-100% - 10px))", |
|
|
|
maxWidth: `min(${Math.max(frameRect.width, 320)}px, calc(100vw - 32px))`, |
|
|
|
width: "max-content", |
|
|
|
maxWidth: "calc(100vw - 32px)", |
|
|
|
} as CSSProperties; |
|
|
|
const bottomToolbarStyle = { |
|
|
|
left: centerX, |
|
|
|
@ -82,7 +83,7 @@ export function MediaInpaintingToolbar({ |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<div |
|
|
|
className="nodrag nopan nowheel absolute z-[10005] flex items-center gap-2 overflow-hidden rounded-xl border border-[var(--border-subtle)] bg-[var(--surface-2)] px-3 py-2 text-sm text-[var(--text-primary)] shadow-[var(--shadow-panel)]" |
|
|
|
className="nodrag nopan nowheel absolute z-[10005] flex items-center gap-2 overflow-x-auto overflow-y-visible whitespace-nowrap rounded-xl border border-[var(--border-subtle)] bg-[var(--surface-2)] px-3 py-2 text-sm text-[var(--text-primary)] shadow-[var(--shadow-panel)]" |
|
|
|
style={topToolbarStyle} |
|
|
|
> |
|
|
|
<button |
|
|
|
@ -106,7 +107,7 @@ export function MediaInpaintingToolbar({ |
|
|
|
}} |
|
|
|
aria-label="画笔" |
|
|
|
title="画笔" |
|
|
|
className={`!h-9 !w-9 !rounded-md ${!eraseMode && drawTool === "brush" ? "!bg-[var(--surface-hover)] !text-[var(--text-primary)]" : "!text-[var(--text-secondary)]"}`} |
|
|
|
className={`!h-9 !w-9 !shrink-0 !rounded-md ${!eraseMode && drawTool === "brush" ? "!bg-[var(--surface-hover)] !text-[var(--text-primary)]" : "!text-[var(--text-secondary)]"}`} |
|
|
|
/> |
|
|
|
<Button |
|
|
|
type="text" |
|
|
|
@ -118,7 +119,7 @@ export function MediaInpaintingToolbar({ |
|
|
|
}} |
|
|
|
aria-label="矩形选区" |
|
|
|
title="矩形选区" |
|
|
|
className={`!h-9 !w-9 !rounded-md ${!eraseMode && drawTool === "rectangle" ? "!bg-[var(--surface-hover)] !text-[var(--text-primary)]" : "!text-[var(--text-secondary)]"}`} |
|
|
|
className={`!h-9 !w-9 !shrink-0 !rounded-md ${!eraseMode && drawTool === "rectangle" ? "!bg-[var(--surface-hover)] !text-[var(--text-primary)]" : "!text-[var(--text-secondary)]"}`} |
|
|
|
/> |
|
|
|
<Button |
|
|
|
type="text" |
|
|
|
@ -126,7 +127,7 @@ export function MediaInpaintingToolbar({ |
|
|
|
onClick={() => onEraseModeChange(true)} |
|
|
|
aria-label="橡皮" |
|
|
|
title="橡皮" |
|
|
|
className={`!h-9 !w-9 !rounded-md ${eraseMode ? "!bg-[var(--surface-hover)] !text-[var(--text-primary)]" : "!text-[var(--text-secondary)]"}`} |
|
|
|
className={`!h-9 !w-9 !shrink-0 !rounded-md ${eraseMode ? "!bg-[var(--surface-hover)] !text-[var(--text-primary)]" : "!text-[var(--text-secondary)]"}`} |
|
|
|
> |
|
|
|
<span className="inline-block h-3.5 w-3.5 rotate-45 rounded-[2px] border border-current" /> |
|
|
|
</Button> |
|
|
|
@ -146,13 +147,13 @@ export function MediaInpaintingToolbar({ |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<Tooltip title="撤销"> |
|
|
|
<Button type="text" icon={<UndoOutlined />} disabled={busy} onClick={onUndo} className="!h-9 !w-9 !rounded-md" /> |
|
|
|
<Button type="text" icon={<UndoOutlined />} disabled={busy} onClick={onUndo} className="!h-9 !w-9 !shrink-0 !rounded-md" /> |
|
|
|
</Tooltip> |
|
|
|
<Tooltip title="重做"> |
|
|
|
<Button type="text" icon={<RedoOutlined />} disabled={busy} onClick={onRedo} className="!h-9 !w-9 !rounded-md" /> |
|
|
|
<Button type="text" icon={<RedoOutlined />} disabled={busy} onClick={onRedo} className="!h-9 !w-9 !shrink-0 !rounded-md" /> |
|
|
|
</Tooltip> |
|
|
|
<Tooltip title="清空"> |
|
|
|
<Button type="text" icon={<ClearOutlined />} disabled={busy} onClick={onClear} className="!h-9 !w-9 !rounded-md" /> |
|
|
|
<Button type="text" icon={<ClearOutlined />} disabled={busy} onClick={onClear} className="!h-9 !w-9 !shrink-0 !rounded-md" /> |
|
|
|
</Tooltip> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
|