@@ -26,24 +26,41 @@ struct ExportSheet: View {
2626 . labelsHidden ( )
2727 }
2828
29- settingsRow ( label: " Codec " ) {
30- Picker ( " " , selection: $settings. codec) {
31- ForEach ( ExportCodec . allCases) { codec in
32- Text ( codec. label) . tag ( codec)
29+ if settings. format. isGIF {
30+ settingsRow ( label: " Quality " ) {
31+ Picker ( " " , selection: $settings. gifQuality) {
32+ ForEach ( GIFQuality . allCases) { quality in
33+ Text ( quality. label) . tag ( quality)
34+ }
3335 }
36+ . pickerStyle ( . segmented)
37+ . labelsHidden ( )
38+ }
39+
40+ Text ( settings. gifQuality. description)
41+ . font ( . system( size: 11 ) )
42+ . foregroundStyle ( ReframedColors . dimLabel)
43+ . padding ( . top, - 10 )
44+ } else {
45+ settingsRow ( label: " Codec " ) {
46+ Picker ( " " , selection: $settings. codec) {
47+ ForEach ( ExportCodec . allCases) { codec in
48+ Text ( codec. label) . tag ( codec)
49+ }
50+ }
51+ . pickerStyle ( . segmented)
52+ . labelsHidden ( )
3453 }
35- . pickerStyle ( . segmented)
36- . labelsHidden ( )
37- }
3854
39- Text ( settings. codec. description)
40- . font ( . system( size: 11 ) )
41- . foregroundStyle ( ReframedColors . dimLabel)
42- . padding ( . top, - 10 )
55+ Text ( settings. codec. description)
56+ . font ( . system( size: 11 ) )
57+ . foregroundStyle ( ReframedColors . dimLabel)
58+ . padding ( . top, - 10 )
59+ }
4360
4461 settingsRow ( label: " Frame Rate " ) {
4562 Picker ( " " , selection: $settings. fps) {
46- ForEach ( ExportFPS . allCases ) { fps in
63+ ForEach ( gifAllowedFPSCases ) { fps in
4764 Text ( fps. label) . tag ( fps)
4865 }
4966 }
@@ -74,7 +91,7 @@ struct ExportSheet: View {
7491 . labelsHidden ( )
7592 }
7693
77- if hasAudio {
94+ if hasAudio && !settings . format . isGIF {
7895 settingsRow ( label: " Audio Bitrate (kbps) " ) {
7996 Picker ( " " , selection: $settings. audioBitrate) {
8097 ForEach ( ExportAudioBitrate . allCases) { bitrate in
@@ -86,22 +103,31 @@ struct ExportSheet: View {
86103 }
87104 }
88105
89- settingsRow ( label: " Renderer " ) {
90- Picker ( " " , selection: $settings. mode) {
91- ForEach ( ExportMode . allCases) { mode in
92- Text ( mode. label) . tag ( mode)
106+ if !settings. format. isGIF {
107+ settingsRow ( label: " Renderer " ) {
108+ Picker ( " " , selection: $settings. mode) {
109+ ForEach ( ExportMode . allCases) { mode in
110+ Text ( mode. label) . tag ( mode)
111+ }
93112 }
113+ . pickerStyle ( . segmented)
114+ . labelsHidden ( )
94115 }
95- . pickerStyle ( . segmented)
96- . labelsHidden ( )
97- }
98116
99- Text ( settings. mode. description)
100- . font ( . system( size: 11 ) )
101- . foregroundStyle ( ReframedColors . dimLabel)
102- . padding ( . top, - 10 )
117+ Text ( settings. mode. description)
118+ . font ( . system( size: 11 ) )
119+ . foregroundStyle ( ReframedColors . dimLabel)
120+ . padding ( . top, - 10 )
121+ }
103122 }
104123 . padding ( . horizontal, 28 )
124+ . onChange ( of: settings. format) { _, newFormat in
125+ if newFormat. isGIF {
126+ if let fpsVal = settings. fps. numericValue, fpsVal > 30 {
127+ settings. fps = . fps24
128+ }
129+ }
130+ }
105131
106132 Spacer ( ) . frame ( height: 28 )
107133
@@ -123,6 +149,16 @@ struct ExportSheet: View {
123149 . background ( ReframedColors . panelBackground)
124150 }
125151
152+ private var gifAllowedFPSCases : [ ExportFPS ] {
153+ if settings. format. isGIF {
154+ return ExportFPS . allCases. filter { fps in
155+ guard let val = fps. numericValue else { return true }
156+ return val <= 30
157+ }
158+ }
159+ return ExportFPS . allCases
160+ }
161+
126162 private func settingsRow< Content: View > ( label: String , @ViewBuilder content: ( ) -> Content ) -> some View {
127163 VStack ( alignment: . leading, spacing: 6 ) {
128164 Text ( label)
0 commit comments