Skip to content

Commit a43597d

Browse files
committed
chore: set fixed initial sheet size
1 parent 9eb9116 commit a43597d

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

macos/native_image_picker_macos/Sources/native_image_picker_macos/ImagePickerImpl.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,8 @@ class ImagePickerImpl: NSObject, ImagePickerApi {
118118
return
119119
}
120120

121-
let windowSize = window.frame.size
122-
123-
let scaleFactor = 0.80 // 80% of the parent window's size
124-
125-
var pickerWidth = windowSize.width * scaleFactor
126-
var pickerHeight = windowSize.height * scaleFactor
127-
128-
picker.view.frame = NSRect(x: 0, y: 0, width: pickerWidth, height: pickerHeight)
121+
// A similar initial sheet size to PhotosPicker in a macOS SwiftUI app.
122+
picker.view.frame = NSRect(x: 0, y: 0, width: 780, height: 615)
129123

130124
window.contentViewController?.presentAsSheet(picker)
131125

0 commit comments

Comments
 (0)