diff --git a/src/ui/DebugWindow.swift b/src/ui/DebugWindow.swift index fa95444c..438dca77 100644 --- a/src/ui/DebugWindow.swift +++ b/src/ui/DebugWindow.swift @@ -82,6 +82,7 @@ class DebugWindow: NSPanel { filterControl = NSSegmentedControl(labels: ["Debug", "Info", "Warning", "Error"], trackingMode: .selectOne, target: nil, action: nil) filterControl.translatesAutoresizingMaskIntoConstraints = false + LabelAndControl.applySystemSelectedSegmentStyle(filterControl) filterControl.selectedSegment = 0 filterControl.onAction = { [weak self] _ in self?.filterChanged() } for i in 0.. 0 { button.setWidth(segmentWidth, forSegment: i) @@ -266,6 +266,14 @@ class LabelAndControl: NSObject { return button } + static func applySystemSelectedSegmentStyle(_ control: NSSegmentedControl) { + if #available(macOS 10.14, *) { + control.segmentStyle = .automatic + } else { + control.segmentStyle = .texturedRounded + } + } + static func makeLabelWithSlider(_ labelText: String, _ rawName: String, _ minValue: Double, _ maxValue: Double, _ numberOfTickMarks: Int = 0, _ allowsTickMarkValuesOnly: Bool = false, _ unitText: String = "", width: CGFloat = 200, extraAction: ActionClosure? = nil) -> [NSView] { diff --git a/src/ui/settings-window/tabs/appearance/CustomizeStyleSheet.swift b/src/ui/settings-window/tabs/appearance/CustomizeStyleSheet.swift index c9a49247..163f903d 100644 --- a/src/ui/settings-window/tabs/appearance/CustomizeStyleSheet.swift +++ b/src/ui/settings-window/tabs/appearance/CustomizeStyleSheet.swift @@ -32,7 +32,7 @@ class CustomizeStyleSheet: SheetWindow { NSLocalizedString("Advanced", comment: "") ], trackingMode: .selectOne, target: self, action: #selector(switchTab(_:))) control.selectedSegment = 0 - control.segmentStyle = .automatic + LabelAndControl.applySystemSelectedSegmentStyle(control) control.widthAnchor.constraint(equalToConstant: CustomizeStyleSheet.width).isActive = true let view = TableGroupSetView(originalViews: [illustratedImageView, control, showHideView, advancedView], padding: 0) return view