feat: improve selection background/border color contrast

closes #2352
This commit is contained in:
Louis Pontoise committed 2023-02-20 19:01:17 +01:00
1 parent a60f1e13db
commit cea0cff2a7
3 files changed
+5 -5

No files matched your search

-1
View File
@@ -94,7 +94,6 @@ class Preferences {
// constant values
// not exposed as preferences now but may be in the future, probably through macro preferences
static var windowMaterial: NSVisualEffectView.Material { .dark }
static var fontColor: NSColor { .white }
static var windowPadding: CGFloat { 18 }
static var interCellPadding: CGFloat { 5 }
+3 -2
View File
@@ -3,7 +3,8 @@ import Cocoa
class ThumbnailView: NSStackView {
static let windowsControlSize = CGFloat(16)
static let windowsControlSpacing = CGFloat(8)
static let highlightBackgroundColor = NSColor(red: 0, green: 0, blue: 0, alpha: 0.4)
static let highlightBackgroundColor = NSColor(red: 0, green: 0, blue: 0, alpha: 0.5)
static let highlightBorderColor = NSColor.white
var window_: Window?
var thumbnail = NSImageView()
var appIcon = NSImageView()
@@ -103,7 +104,7 @@ class ThumbnailView: NSStackView {
layer!.backgroundColor = (Preferences.theme == .macOs && isFocused) || (Preferences.theme == .windows10 && isHovered)
? ThumbnailView.highlightBackgroundColor.cgColor : .clear
layer!.borderColor = (Preferences.theme == .macOs && isHovered) || (Preferences.theme == .windows10 && isFocused)
? NSColor.controlColor.cgColor : .clear
? ThumbnailView.highlightBorderColor.cgColor : .clear
let newFrameInset = (isFocused) ? -Preferences.intraCellPadding : Preferences.intraCellPadding
if newFrameInset != frameInset {
frameInset = newFrameInset
+2 -2
View File
@@ -7,7 +7,7 @@ class ThumbnailsView: NSVisualEffectView {
convenience init() {
self.init(frame: .zero)
material = Preferences.windowMaterial
material = .dark
state = .active
wantsLayer = true
updateRoundedCorners(Preferences.windowCornerRadius)
@@ -228,7 +228,7 @@ class ScrollView: NSScrollView {
self?.isCurrentlyScrolling = true
}
}
private func resetHoveredWindow() {
if let oldIndex = Windows.hoveredWindowIndex {
Windows.hoveredWindowIndex = nil