fix: thumbnails have a minimum width to help with tall windows

this was a regression introduced around the rewrite from NSCollectionView to custom NSView where i missed the minimum width bit
This commit is contained in:
Louis Pontoise authored and lwouis committed 2020-05-08 03:29:38 +09:00
1 parent 29d384552b
commit a60750c415
1 file changed
+1 -1
+1 -1
View File
@@ -51,7 +51,7 @@ class ThumbnailView: NSStackView {
spaceIcon.setNumber(UInt32(element.spaceIndex!))
}
}
assignIfDifferent(&frame.size.width, thumbnail.frame.size.width + Preferences.intraCellPadding * 2)
assignIfDifferent(&frame.size.width, max(thumbnail.frame.size.width + Preferences.intraCellPadding * 2, ThumbnailView.widthMin(screen)))
assignIfDifferent(&frame.size.height, newHeight)
let fontIconWidth = CGFloat([minimizedIcon, hiddenIcon, spaceIcon].filter { !$0.isHidden }.count) * (Preferences.fontIconSize + Preferences.intraCellPadding)
assignIfDifferent(&label.textContainer!.size.width, frame.width - Preferences.iconSize - Preferences.intraCellPadding * 3 - fontIconWidth)