WindowsTopLeftLogo.tsx 1.0 KB

123456789101112131415161718192021222324252627282930
  1. import { cn } from "@/components/lib/utils.js";
  2. import zaiLogoUrl from "@/assets/provider-icons/logo-zai.svg";
  3. export function WindowsTopLeftLogo({
  4. className,
  5. imageClassName,
  6. }: {
  7. className?: string;
  8. imageClassName?: string;
  9. }) {
  10. return (
  11. <div
  12. className={cn(
  13. // Workspace 的左侧工具组从 1px 面板边框之后开始,Settings 旧标题层却从窗口 0 点开始,
  14. // Workspace 的 logo 位于 28px 按钮内,图像相对按钮左沿还有 4px 居中留白;
  15. // Settings 直接渲染 20px 图像,不能拿按钮容器的 left 13px 当作图像坐标。
  16. // 计入 4px 外层留白、1px 边框和按钮内 4px 后,两处图像均为 left 17px / top 19px。
  17. "absolute left-1 top-1 mt-px ml-px z-20 flex h-12 items-center px-3 [app-region:drag]",
  18. className,
  19. )}
  20. >
  21. <img
  22. src={zaiLogoUrl}
  23. alt="ZCode"
  24. className={cn("pointer-events-none size-5 select-none", imageClassName)}
  25. draggable={false}
  26. />
  27. </div>
  28. );
  29. }