mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-21 18:19:03 +08:00
feat: macOS 改用原生圆角与原生红绿灯
- tauri.conf.json: decorations=true + titleBarStyle=Overlay + transparent + hiddenTitle + trafficLightPosition,启用原生圆角/squircle 与原生红绿灯 - main.css: 移除 #root 的 CSS border-radius,避免圆弧覆盖原生连续曲率 - App.tsx: macOS 下隐藏自绘 Windows 风格三按钮 - ContentArea.tsx: 侧栏隐藏(沉浸/竖屏)时 header 左侧为红绿灯留白 - Sidebar.tsx: macOS 下 logo 区上内边距增大,避开红绿灯 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -104,6 +104,12 @@ export function ContentArea({
|
||||
bottomInset = 0,
|
||||
}: ContentAreaProps): React.JSX.Element {
|
||||
const { t } = useTranslation()
|
||||
const isMacOS =
|
||||
typeof navigator !== "undefined" &&
|
||||
/mac/i.test(navigator.userAgent) &&
|
||||
!/iphone|ipad|ipod|android/i.test(navigator.userAgent)
|
||||
// macOS 使用原生红绿灯,侧栏隐藏(沉浸/竖屏)时顶部左侧需为红绿灯留白
|
||||
const macTrafficLightsInset = isMacOS && (isPortraitMode || immersiveMode)
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
const isSubPage = location.pathname !== "/" && !location.pathname.startsWith("/home")
|
||||
@@ -418,6 +424,7 @@ export function ContentArea({
|
||||
background: "var(--ss-header-bg)",
|
||||
borderBottom: "1px solid var(--ss-border-color)",
|
||||
flexShrink: 0,
|
||||
paddingLeft: macTrafficLightsInset ? "80px" : 0,
|
||||
WebkitAppRegion: "drag",
|
||||
position: "relative",
|
||||
} as React.CSSProperties
|
||||
|
||||
@@ -213,13 +213,20 @@ export function Sidebar({
|
||||
|
||||
const showFloatingPanel = floatingExpand && collapsed && floatingExpanded
|
||||
|
||||
const isMacOS =
|
||||
typeof navigator !== "undefined" &&
|
||||
/mac/i.test(navigator.userAgent) &&
|
||||
!/iphone|ipad|ipod|android/i.test(navigator.userAgent)
|
||||
|
||||
const renderSidebarBody = (isCollapsedView: boolean, hideMenu = false) => (
|
||||
<>
|
||||
<div
|
||||
data-tauri-drag-region
|
||||
style={
|
||||
{
|
||||
padding: isCollapsedView ? "20px 8px 12px" : "24px 24px 16px",
|
||||
padding: isCollapsedView
|
||||
? `${isMacOS ? 40 : 20}px 8px 12px`
|
||||
: `${isMacOS ? 44 : 24}px 24px 16px`,
|
||||
textAlign: "center",
|
||||
WebkitAppRegion: "drag",
|
||||
userSelect: "none",
|
||||
|
||||
Reference in New Issue
Block a user