Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Cloud/CloudTeamPickerRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Cloud/MachinesControlBarComponents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
10 changes: 5 additions & 5 deletions Sources/Feed/FeedButtonStyleDebugWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/Feed/FeedPanelView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 8 additions & 2 deletions Sources/RightSidebarChromeStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
}

Expand Down Expand Up @@ -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))
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
}

func rightSidebarHeaderControlAlignment() -> some View {
alignmentGuide(VerticalAlignment.center) { dimensions in
dimensions[VerticalAlignment.center] + RightSidebarChromeMetrics.headerControlCenterAlignmentAdjustment
Expand Down
1 change: 1 addition & 0 deletions Sources/RightSidebarPanelView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions Sources/SessionIndexView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion Sources/SidebarSearchFieldCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
9 changes: 6 additions & 3 deletions Sources/VaultCheckpointTimelineView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
9 changes: 5 additions & 4 deletions Sources/WindowChromeMetrics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

Expand Down