mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-18 21:40:29 +00:00
macOS: match scroller’s appearance with surface’s background
This commit is contained in:
@@ -172,13 +172,16 @@ class SurfaceScrollView: NSView {
|
||||
}
|
||||
|
||||
// MARK: Scrolling
|
||||
|
||||
|
||||
private func synchronizeAppearance() {
|
||||
let scrollbarConfig = surfaceView.derivedConfig.scrollbar
|
||||
scrollView.hasVerticalScroller = scrollbarConfig != .never
|
||||
scrollView.verticalScroller?.controlSize = .small
|
||||
let hasLightBackground = OSColor(surfaceView.derivedConfig.backgroundColor).isLightColor
|
||||
// Make sure the scroller’s appearance matches the surface's background color.
|
||||
scrollView.appearance = NSAppearance(named: hasLightBackground ? .aqua : .darkAqua)
|
||||
}
|
||||
|
||||
|
||||
/// Positions the surface view to fill the currently visible rectangle.
|
||||
///
|
||||
/// This is called whenever the scroll position changes. The surface view (which does the
|
||||
|
||||
Reference in New Issue
Block a user