@@ -61,7 +61,9 @@ const getWindowOptionLabel = (window: CaptureWindow) => {
6161 return parts . join ( " • " ) ;
6262} ;
6363
64- const createDefaultGeneralSettings = ( ) : GeneralSettingsStore => ( {
64+ type ExtendedGeneralSettingsStore = GeneralSettingsStore ;
65+
66+ const createDefaultGeneralSettings = ( ) : ExtendedGeneralSettingsStore => ( {
6567 uploadIndividualFiles : false ,
6668 hideDockIcon : false ,
6769 autoCreateShareableLink : false ,
@@ -71,11 +73,12 @@ const createDefaultGeneralSettings = (): GeneralSettingsStore => ({
7173 autoZoomOnClicks : false ,
7274 custom_cursor_capture2 : true ,
7375 excludedWindows : [ ] ,
76+ instantModeMaxResolution : 1920 ,
7477} ) ;
7578
7679const deriveInitialSettings = (
7780 store : GeneralSettingsStore | null ,
78- ) : GeneralSettingsStore => {
81+ ) : ExtendedGeneralSettingsStore => {
7982 const defaults = createDefaultGeneralSettings ( ) ;
8083 if ( ! store ) return defaults ;
8184
@@ -85,6 +88,16 @@ const deriveInitialSettings = (
8588 } ;
8689} ;
8790
91+ const INSTANT_MODE_RESOLUTION_OPTIONS = [
92+ { value : 1280 , label : "720p" } ,
93+ { value : 1920 , label : "1080p" } ,
94+ { value : 2560 , label : "1440p" } ,
95+ { value : 3840 , label : "4K" } ,
96+ ] satisfies {
97+ value : number ;
98+ label : string ;
99+ } [ ] ;
100+
88101export default function GeneralSettings ( ) {
89102 const [ store ] = createResource ( ( ) => generalSettingsStore . get ( ) ) ;
90103
@@ -167,7 +180,7 @@ function AppearanceSection(props: {
167180}
168181
169182function Inner ( props : { initialStore : GeneralSettingsStore | null } ) {
170- const [ settings , setSettings ] = createStore < GeneralSettingsStore > (
183+ const [ settings , setSettings ] = createStore < ExtendedGeneralSettingsStore > (
171184 deriveInitialSettings ( props . initialStore ) ,
172185 ) ;
173186
@@ -417,13 +430,23 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {
417430 ) }
418431
419432 < SettingGroup title = "Recording" >
433+ < SelectSettingItem
434+ label = "Instant mode max resolution"
435+ description = "Choose the maximum resolution for Instant Mode recordings."
436+ value = { settings . instantModeMaxResolution ?? 1920 }
437+ onChange = { ( value ) =>
438+ handleChange ( "instantModeMaxResolution" , value )
439+ }
440+ options = { INSTANT_MODE_RESOLUTION_OPTIONS . map ( ( option ) => ( {
441+ text : option . label ,
442+ value : option . value ,
443+ } ) ) }
444+ />
420445 < SelectSettingItem
421446 label = "Recording countdown"
422447 description = "Countdown before recording starts"
423448 value = { settings . recordingCountdown ?? 0 }
424- onChange = { ( value ) =>
425- handleChange ( "recordingCountdown" , value as number )
426- }
449+ onChange = { ( value ) => handleChange ( "recordingCountdown" , value ) }
427450 options = { [
428451 { text : "Off" , value : 0 } ,
429452 { text : "3 seconds" , value : 3 } ,
@@ -436,10 +459,7 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {
436459 description = "The main window recording start behaviour"
437460 value = { settings . mainWindowRecordingStartBehaviour ?? "close" }
438461 onChange = { ( value ) =>
439- handleChange (
440- "mainWindowRecordingStartBehaviour" ,
441- value as MainWindowRecordingStartBehaviour ,
442- )
462+ handleChange ( "mainWindowRecordingStartBehaviour" , value )
443463 }
444464 options = { [
445465 { text : "Close" , value : "close" } ,
@@ -451,10 +471,7 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {
451471 description = "The studio recording finish behaviour"
452472 value = { settings . postStudioRecordingBehaviour ?? "openEditor" }
453473 onChange = { ( value ) =>
454- handleChange (
455- "postStudioRecordingBehaviour" ,
456- value as PostStudioRecordingBehaviour ,
457- )
474+ handleChange ( "postStudioRecordingBehaviour" , value )
458475 }
459476 options = { [
460477 { text : "Open editor" , value : "openEditor" } ,
@@ -468,12 +485,7 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {
468485 label = "After deleting recording behaviour"
469486 description = "Should Cap reopen after deleting an in progress recording?"
470487 value = { settings . postDeletionBehaviour ?? "doNothing" }
471- onChange = { ( value ) =>
472- handleChange (
473- "postDeletionBehaviour" ,
474- value as PostDeletionBehaviour ,
475- )
476- }
488+ onChange = { ( value ) => handleChange ( "postDeletionBehaviour" , value ) }
477489 options = { [
478490 { text : "Do Nothing" , value : "doNothing" } ,
479491 {
0 commit comments