Merge pull request #1176 from kiwix/1175-ios-selected-cell-background-color-is-wrong

Revert selected cell color for iOS
This commit is contained in:
Kelson 2025-04-22 06:50:14 +02:00 committed by GitHub
commit 58fb279abd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,11 +25,15 @@ enum CellBackground {
#endif #endif
static func colorFor(isHovering: Bool, isSelected: Bool = false) -> Color { static func colorFor(isHovering: Bool, isSelected: Bool = false) -> Color {
#if os(macOS)
if isSelected { if isSelected {
isHovering ? selected.opacity(0.75) : selected isHovering ? selected.opacity(0.75) : selected
} else { } else {
isHovering ? selected.opacity(0.5) : normal isHovering ? selected.opacity(0.5) : normal
} }
#else
isHovering ? selected : normal
#endif
} }
static let clipShapeRectangle = RoundedRectangle(cornerRadius: 12, style: .continuous) static let clipShapeRectangle = RoundedRectangle(cornerRadius: 12, style: .continuous)