diff --git a/alt-tab-macos/logic/Preferences.swift b/alt-tab-macos/logic/Preferences.swift index acb05bc2..a00574d9 100644 --- a/alt-tab-macos/logic/Preferences.swift +++ b/alt-tab-macos/logic/Preferences.swift @@ -15,7 +15,7 @@ class Preferences { static let fontIconSize = CGFloat(20) static let maxScreenUsage = CGFloat(0.8) static let minCellsPerRow = CGFloat(3) - static let maxCellsPerRow = CGFloat(4) + static let maxCellsPerRow = CGFloat(6) static let nCellsRows = CGFloat(3) static let themeMacro = MacroPreferenceHelper<(CGFloat, CGFloat, CGFloat, NSColor, NSColor)>([ diff --git a/alt-tab-macos/ui/Cell.swift b/alt-tab-macos/ui/Cell.swift index c3b1b4c8..c6ed0248 100644 --- a/alt-tab-macos/ui/Cell.swift +++ b/alt-tab-macos/ui/Cell.swift @@ -127,9 +127,9 @@ class Cell: NSCollectionViewItem { } static func thumbnailSize(_ image: NSImage?, _ screen: NSScreen) -> (CGFloat, CGFloat) { + guard let image = image else { return (0, 0) } let thumbnailHeightMax = Cell.height(screen) - Preferences.intraCellPadding * 3 - Preferences.iconSize let thumbnailWidthMax = Cell.widthMax(screen) - Preferences.intraCellPadding * 2 - guard let image = image else { return (Cell.widthMin(screen) - Preferences.intraCellPadding * 2, thumbnailHeightMax) } let thumbnailHeight = min(image.size.height, thumbnailHeightMax) let thumbnailWidth = min(image.size.width, thumbnailWidthMax) let imageRatio = image.size.width / image.size.height