You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/AdvancedCollectionTableView/Configuration/Configurations/NSListContentConfiguration/NSListContentConfiguration+Image.swift
@@ -35,31 +35,27 @@ public extension NSListContentConfiguration {
35
35
}
36
36
37
37
/// The scaling of the image.
38
-
publicenumScaling:Hashable{
38
+
publicenumScaling:Int,Hashable{
39
39
/// The image is resized to fit the bounds rectangle, preserving the aspect of the image. If the image does not completely fill the bounds rectangle, the image is centered in the partial axis.
40
-
case fit
40
+
case scaleToFit
41
+
/// The image is resized to completely fill the bounds rectangle, while still preserving the aspect of the image.
42
+
case scaleToFill
41
43
/// The image is resized to fit the entire bounds rectangle.
42
44
case resize
43
45
/// The image isn't resized.
44
46
case none
45
-
// case fill
46
47
47
-
varimageScaling:NSImageScaling{
48
+
varscaling:NSImageScaling{
48
49
switchself{
49
-
case.fit:return.scaleProportionallyUpOrDown
50
-
// case .fill: return .scaleProportionallyUpOrDown
@@ -142,8 +138,27 @@ public extension NSListContentConfiguration {
142
138
}
143
139
}
144
140
145
-
// var reservedLayoutSize: CGSize = CGSize(0, 0)
146
-
// static let standardDimension: CGFloat = -CGFloat.greatestFiniteMagnitude
141
+
/**
142
+
The layout size that the system reserves for the image, and then centers the image within.
143
+
144
+
Use this property to ensure:
145
+
- Consistent horizontal alignment for images across adjacent content views, even when the images vary in width.
146
+
- Consistent height for content views, even when the images vary in height.
147
+
148
+
The reserved layout size only affects the amount of space for the image, and its positioning within that space. It doesn’t affect the size of the image.
149
+
150
+
The default value is `zero`. A width or height of zero means that the system uses the default behavior for that dimension:
151
+
- The system centers symbol images inside a predefined reserved layout size that scales with the content size category.
152
+
- Nonsymbol images use a reserved layout size equal to the actual size of the displayed image.
153
+
*/
154
+
publicvarreservedLayoutSize:CGSize=CGSize(0,0)
155
+
156
+
/**
157
+
The system standard layout dimension for reserved layout size.
158
+
159
+
Setting the ``reservedLayoutSize`` width or height to this constant results in using the system standard value for a symbol image for that dimension, even when the image is not a symbol image.
0 commit comments