复用编辑器背景色浮层菜单

编辑器画布背景色菜单改为复用 PlatformFloatingMenu

背景色选项改为复用 PlatformFloatingMenuItem

删除背景色菜单局部容器样式并更新 TRACKING
This commit is contained in:
2026-06-14 03:10:14 +08:00
parent d865d9e4aa
commit b39d93214d
3 changed files with 12 additions and 17 deletions

View File

@@ -1913,16 +1913,15 @@ export function ImageCanvasEditorView() {
/>
</button>
{isBackgroundMenuOpen ? (
<div
<PlatformFloatingMenu
className="image-canvas-editor__background-menu"
role="menu"
aria-label="画布背景色菜单"
label="画布背景色菜单"
placement="top-start"
>
{CANVAS_BACKGROUND_OPTIONS.map((option) => (
<button
<PlatformFloatingMenuItem
key={option.value}
type="button"
role="menuitem"
className="image-canvas-editor__background-menu-item"
aria-label={`切换画布背景色为${option.label}`}
aria-pressed={canvasBackgroundColor === option.value}
onClick={() => {
@@ -1934,9 +1933,9 @@ export function ImageCanvasEditorView() {
className="image-canvas-editor__background-swatch"
style={{ backgroundColor: option.value }}
/>
</button>
</PlatformFloatingMenuItem>
))}
</div>
</PlatformFloatingMenu>
) : null}
</div>
<EditorIconButton