@@ -38,10 +38,16 @@ struct VMConfigAppleDisplayView: View {
38
38
lhs. resolution. heightInPixels == rhs. heightInPixels
39
39
}
40
40
}
41
- private let defaultResolution = NamedResolution ( name: " " ,
42
- resolution: Resolution ( width: 1920 , height: 1200 ) )
41
+
42
+ private static let customResolution = NamedResolution ( name: NSLocalizedString ( " Custom " , comment: " VMConfigAppleDisplayView " ) ,
43
+ resolution: Resolution ( width: 0 , height: 0 ) )
44
+
45
+ private var customResolution : NamedResolution {
46
+ Self . customResolution
47
+ }
43
48
44
49
private let resolutions = [
50
+ Self . customResolution,
45
51
NamedResolution ( name: " 1024 × 640 — 16:10 " ,
46
52
resolution: Resolution ( width: 1024 , height: 640 ) ) ,
47
53
NamedResolution ( name: " 1024 × 665 — MacBook Pro (14-inch, 2021) Scaled " ,
@@ -127,7 +133,7 @@ struct VMConfigAppleDisplayView: View {
127
133
return item
128
134
}
129
135
}
130
- return defaultResolution
136
+ return customResolution
131
137
} set: { newValue in
132
138
config. widthInPixels = newValue. resolution. widthInPixels
133
139
config. heightInPixels = newValue. resolution. heightInPixels
@@ -151,6 +157,10 @@ struct VMConfigAppleDisplayView: View {
151
157
. tag ( item)
152
158
}
153
159
}
160
+ if displayResolution. wrappedValue == customResolution {
161
+ NumberTextField ( " Width " , number: $config. widthInPixels)
162
+ NumberTextField ( " Height " , number: $config. heightInPixels)
163
+ }
154
164
Toggle ( " HiDPI (Retina) " , isOn: isHidpi)
155
165
. help ( " Only available on macOS virtual machines. " )
156
166
}
0 commit comments