diff --git a/Sources/Cloud/CloudTeamPickerRow.swift b/Sources/Cloud/CloudTeamPickerRow.swift index 23752312c490..b88555b864de 100644 --- a/Sources/Cloud/CloudTeamPickerRow.swift +++ b/Sources/Cloud/CloudTeamPickerRow.swift @@ -29,7 +29,7 @@ struct CloudTeamPickerRow: View { } .padding(.horizontal, 7) .frame(height: 22) - .contentShape(Capsule(style: .continuous)) + .contentShape(RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, style: .continuous)) } .buttonStyle(.plain) .popover(isPresented: $isPresented, arrowEdge: .top) { diff --git a/Sources/Cloud/MachinesControlBarComponents.swift b/Sources/Cloud/MachinesControlBarComponents.swift index d526fef7bc60..cac467b24c65 100644 --- a/Sources/Cloud/MachinesControlBarComponents.swift +++ b/Sources/Cloud/MachinesControlBarComponents.swift @@ -130,7 +130,7 @@ struct MachinesChromeIconButton: View { .buttonStyle(.plain) .foregroundColor(isHovered ? .primary : .secondary) .background( - RoundedRectangle(cornerRadius: 4, style: .continuous) + RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, style: .continuous) .fill(isHovered ? Color.primary.opacity(0.06) : Color.clear) ) .onHover { isHovered = $0 } diff --git a/Sources/Feed/FeedButtonStyleDebugWindowController.swift b/Sources/Feed/FeedButtonStyleDebugWindowController.swift index 96873d292548..0b7af790208f 100644 --- a/Sources/Feed/FeedButtonStyleDebugWindowController.swift +++ b/Sources/Feed/FeedButtonStyleDebugWindowController.swift @@ -322,11 +322,11 @@ enum FeedButtonDebugSettings { } static var compactCornerRadius: Double { - double(forKey: compactCornerRadiusKey, defaultValue: 5) + double(forKey: compactCornerRadiusKey, defaultValue: Double(RightSidebarChromeMetrics.buttonCornerRadius)) } static var mediumCornerRadius: Double { - double(forKey: mediumCornerRadiusKey, defaultValue: 6) + double(forKey: mediumCornerRadiusKey, defaultValue: Double(RightSidebarChromeMetrics.buttonCornerRadius)) } static var compactHorizontalPadding: Double { @@ -608,7 +608,7 @@ enum FeedButtonDebugPreset: String, CaseIterable, Identifiable { var compactCornerRadius: Double { switch self { - case .solidClassic, .minimalFlat: return 5.0 + case .solidClassic, .minimalFlat: return 6.0 case .raycastGlass, .frostedOutline: return 7.0 case .standardLiquidGlass, .tintedLiquidGlass: return 8.0 case .nativeGlass: return 9.0 @@ -862,7 +862,7 @@ private struct FeedButtonStyleDebugView: View { @AppStorage(FeedButtonDebugSettings.paletteKey) private var paletteRaw = FeedButtonDebugPalettePreset.system.rawValue @AppStorage(FeedButtonDebugSettings.compactCornerRadiusKey) - private var compactCornerRadius = 5.0 + private var compactCornerRadius = 6.0 @AppStorage(FeedButtonDebugSettings.mediumCornerRadiusKey) private var mediumCornerRadius = 6.0 @AppStorage(FeedButtonDebugSettings.compactHorizontalPaddingKey) @@ -925,7 +925,7 @@ private struct FeedButtonStyleDebugView: View { FeedButtonDebugSettings.reset() styleRaw = FeedButtonDebugVisualStyle.solid.rawValue paletteRaw = FeedButtonDebugPalettePreset.system.rawValue - compactCornerRadius = 5.0 + compactCornerRadius = 6.0 mediumCornerRadius = 6.0 compactHorizontalPadding = 8.0 mediumHorizontalPadding = 12.0 diff --git a/Sources/Feed/FeedPanelView.swift b/Sources/Feed/FeedPanelView.swift index 7baa7aff5a6b..d0089215fad0 100644 --- a/Sources/Feed/FeedPanelView.swift +++ b/Sources/Feed/FeedPanelView.swift @@ -1848,7 +1848,7 @@ struct FeedButton: View { ? CGFloat(FeedButtonDebugSettings.compactCornerRadius) : CGFloat(FeedButtonDebugSettings.mediumCornerRadius) #else - return size == .compact ? 5 : 6 + return RightSidebarChromeMetrics.buttonCornerRadius #endif } private var horizontalPadding: CGFloat { diff --git a/Sources/RightSidebarChromeStyle.swift b/Sources/RightSidebarChromeStyle.swift index a3bdf1cf6498..3245bf2fd639 100644 --- a/Sources/RightSidebarChromeStyle.swift +++ b/Sources/RightSidebarChromeStyle.swift @@ -149,11 +149,11 @@ struct RightSidebarChromePillModifier: ViewModifier { isVisible: true ) .background( - RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.controlCornerRadius, style: .continuous) + RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, style: .continuous) .fill(backgroundColor) ) .contentShape( - RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.controlCornerRadius, style: .continuous) + RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, style: .continuous) ) } @@ -295,6 +295,12 @@ extension View { modifier(RightSidebarChromeBottomBorderModifier(backgroundColor: backgroundColor)) } + /// Gives system bordered buttons below this view the shared + /// right-sidebar button radius instead of the platform default shape. + func rightSidebarButtonBorderShape() -> some View { + buttonBorderShape(.roundedRectangle(radius: RightSidebarChromeMetrics.buttonCornerRadius)) + } + func rightSidebarHeaderControlAlignment() -> some View { alignmentGuide(VerticalAlignment.center) { dimensions in dimensions[VerticalAlignment.center] + RightSidebarChromeMetrics.headerControlCenterAlignmentAdjustment diff --git a/Sources/RightSidebarPanelView.swift b/Sources/RightSidebarPanelView.swift index 534124e917da..9375a41fc222 100644 --- a/Sources/RightSidebarPanelView.swift +++ b/Sources/RightSidebarPanelView.swift @@ -173,6 +173,7 @@ struct RightSidebarPanelView: View { contentForMode .frame(maxWidth: .infinity, maxHeight: .infinity) } + .rightSidebarButtonBorderShape() .frame(maxWidth: .infinity, maxHeight: .infinity) // Keep every mode (including Dock and AppKit-backed file rows) on the // same resolved cmux scheme as the window and left sidebar. diff --git a/Sources/SessionIndexView.swift b/Sources/SessionIndexView.swift index 59b4915e13b9..22f36f61b66f 100644 --- a/Sources/SessionIndexView.swift +++ b/Sources/SessionIndexView.swift @@ -1252,10 +1252,10 @@ struct SessionTranscriptPreviewView: View { CmuxSystemSymbolImage(magnified: "xmark", pointSize: 11, weight: .semibold, tint: closeIsHovered ? .primary : .secondary) .frame(width: 20, height: 20) .background( - RoundedRectangle(cornerRadius: 4, style: .continuous) + RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, style: .continuous) .fill(closeIsHovered ? Color.primary.opacity(0.08) : Color.clear) ) - .contentShape(RoundedRectangle(cornerRadius: 4, style: .continuous)) + .contentShape(RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, style: .continuous)) .onHover { closeIsHovered = $0 } .onTapGesture { onDismiss() diff --git a/Sources/SidebarSearchFieldCell.swift b/Sources/SidebarSearchFieldCell.swift index 6e8b9bdd9bf2..0053782553d9 100644 --- a/Sources/SidebarSearchFieldCell.swift +++ b/Sources/SidebarSearchFieldCell.swift @@ -17,7 +17,7 @@ final class SidebarSearchFieldCell: NSSearchFieldCell { context.saveGState() context.setFillColor(NSColor.labelColor.withAlphaComponent(0.06).cgColor) context.addPath(RoundedRectangle( - cornerRadius: RightSidebarChromeMetrics.controlCornerRadius, + cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, style: .continuous ).path(in: frame).cgPath) context.fillPath() diff --git a/Sources/VaultCheckpointTimelineView.swift b/Sources/VaultCheckpointTimelineView.swift index 18eef8a33214..8df658ae68de 100644 --- a/Sources/VaultCheckpointTimelineView.swift +++ b/Sources/VaultCheckpointTimelineView.swift @@ -146,8 +146,11 @@ struct VaultCheckpointTimelineView: View { .padding(.horizontal, 10) .frame(height: 26) .background( - RoundedRectangle(cornerRadius: 7, style: .continuous) - .fill(cmuxAccent.color.opacity(0.13)) + RoundedRectangle( + cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, + style: .continuous + ) + .fill(cmuxAccent.color.opacity(0.13)) ) } .buttonStyle(.borderless) @@ -418,7 +421,7 @@ private struct VaultCheckpointRow: View, Equatable { .padding(.horizontal, 8) .frame(height: 22) .background( - RoundedRectangle(cornerRadius: 6, style: .continuous) + RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, style: .continuous) .fill( isForkEnabled ? cmuxAccent.color.opacity(isHovered ? 0.16 : 0.10) diff --git a/Sources/WindowChromeMetrics.swift b/Sources/WindowChromeMetrics.swift index 502f902dad9f..92d38bc28582 100644 --- a/Sources/WindowChromeMetrics.swift +++ b/Sources/WindowChromeMetrics.swift @@ -54,9 +54,10 @@ enum RightSidebarChromeMetrics { static var contentIconCenter: CGFloat { contentIconLeadingPadding + contentIconFrameSize / 2 } - static var controlCornerRadius: CGFloat { - min(10, max(5, controlHeight * 0.25)) - } + /// Corner radius for every right-sidebar button: header icon buttons, + /// mode and grouping pills, panel action buttons, and system bordered + /// buttons (via `rightSidebarButtonBorderShape()`). + static let buttonCornerRadius: CGFloat = HeaderChromeControlMetrics.cornerRadius static let headerControlSize: CGFloat = HeaderChromeControlMetrics.buttonSize static let headerIconSize: CGFloat = 10 static let headerIconFrameSize: CGFloat = headerIconSize @@ -66,7 +67,7 @@ enum RightSidebarChromeMetrics { /// controls share one leading column and one trailing column. static let headerLeadingPadding: CGFloat = HeaderChromeControlMetrics.titlebarControlsLeadingPadding static let headerTrailingPadding: CGFloat = 6 - static let headerControlCornerRadius: CGFloat = HeaderChromeControlMetrics.cornerRadius + static let headerControlCornerRadius: CGFloat = buttonCornerRadius static let headerControlCenterAlignmentAdjustment: CGFloat = 0 }