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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AppKit
import SwiftUI
import CmuxCanvas
import CmuxFoundation

/// Delegate through which a pane view reports gestures to the canvas root.
@MainActor
Expand Down Expand Up @@ -185,7 +186,7 @@ final class CanvasPaneView: NSView {
layer?.borderColor = chrome.isFocused
? NSColor.controlAccentColor.cgColor
: NSColor.separatorColor.cgColor
layer?.borderWidth = chrome.isFocused ? 2 : 1
layer?.borderWidth = chrome.isFocused ? CGFloat.paneIndicatorStrokeWidth : 1
layer?.backgroundColor = paneBackground.cgColor
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
public import CoreGraphics

extension CGFloat {
/// Stroke width shared by the pane focus and attention indicators: the active
/// pane border, the notification ring, the focus flash and the Canvas focus
/// border. They draw along the same edge, so one width keeps them aligned.
public static let paneIndicatorStrokeWidth: CGFloat = 2
}
1 change: 0 additions & 1 deletion Sources/PaneChromeSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ enum PaneChromeSettings {
static let paneBorderColorKey = "paneBorderColor"
static let activePaneBorderColorKey = "activePaneBorderColor"
static let defaultColorHex = ""
static let activeBorderLineWidth = 2.0
static let didChangeNotification = Notification.Name("cmux.paneChromeSettingsDidChange")

static func paneBorderColorHex(defaults: UserDefaults = .standard) -> String? {
Expand Down
3 changes: 2 additions & 1 deletion Sources/Panels/Panel.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Foundation
import Combine
import AppKit
import CmuxFoundation

/// Type of panel content
public enum PanelType: String, Codable, CaseIterable, Sendable {
Expand Down Expand Up @@ -210,7 +211,7 @@ enum FocusFlashCurve: Equatable {
enum PanelOverlayRingMetrics {
static let inset: CGFloat = 2
static let cornerRadius: CGFloat = 6
static let lineWidth: CGFloat = 2.5
static let lineWidth: CGFloat = .paneIndicatorStrokeWidth

static func pathRect(in bounds: CGRect) -> CGRect {
bounds.insetBy(dx: inset, dy: inset)
Expand Down
24 changes: 18 additions & 6 deletions Sources/Panels/PanelContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,12 @@ struct PanelFilePathHeader<TrailingContent: View>: View {

var body: some View {
HStack(spacing: 8) {
CmuxSystemSymbolImage(systemName: iconSystemName, pointSize: 16, tint: .secondary)
.frame(width: 16)
CmuxSystemSymbolImage(
systemName: iconSystemName,
pointSize: RightSidebarChromeMetrics.contentIconFrameSize,
tint: .secondary
)
.frame(width: RightSidebarChromeMetrics.contentIconFrameSize)
Text(filePath)
.cmuxFont(size: 11, design: .monospaced)
.foregroundStyle(Color(nsColor: foregroundColor).opacity(0.68))
Expand All @@ -278,8 +282,8 @@ struct PanelFilePathHeader<TrailingContent: View>: View {
Spacer(minLength: 8)
trailingContent()
}
.padding(.horizontal, 12)
.frame(height: 30)
.padding(.horizontal, RightSidebarChromeMetrics.contentIconLeadingPadding)
.frame(height: RightSidebarChromeMetrics.secondaryBarHeight)
.background(Color.clear)
}
}
Expand All @@ -306,8 +310,16 @@ struct PanelHeaderIconGlyph: View {
let systemName: String

var body: some View {
CmuxSystemSymbolImage(systemName: systemName, pointSize: 13, tint: .secondary)
.frame(width: 20, height: 20, alignment: .center)
CmuxSystemSymbolImage(
systemName: systemName,
pointSize: RightSidebarChromeMetrics.headerIconSize,
tint: .secondary
)
.frame(
width: RightSidebarChromeMetrics.headerControlSize,
height: RightSidebarChromeMetrics.headerControlSize,
alignment: .center
)
.contentShape(Rectangle())
}
}
2 changes: 1 addition & 1 deletion Sources/TmuxWorkspacePaneOverlayView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ struct TmuxWorkspacePaneOverlayView: View {
path,
with: .color(Color(nsColor: color)),
style: StrokeStyle(
lineWidth: CGFloat(PaneChromeSettings.activeBorderLineWidth),
lineWidth: PanelOverlayRingMetrics.lineWidth,
lineJoin: .round
)
)
Expand Down
Loading