@@ -13,7 +13,7 @@ import { StatusBar } from './components/status-bar';
1313import { AnnotationToolbar } from './components/annotation-toolbar' ;
1414import { ExportToolbar } from './components/export-toolbar' ;
1515import { CropToolbar } from './components/crop-toolbar' ;
16- import { CaptureResult , CaptureMode , WindowInfo , Annotation , EditorTool , OutputRatio , CropArea , CropAspectRatio , CropState , LibraryImage } from './types' ;
16+ import { CaptureResult , CaptureMode , WindowInfo , Annotation , EditorTool , OutputRatio , CropArea , CropAspectRatio , CropState , BorderType , LibraryImage } from './types' ;
1717import {
1818 CaptureFullscreen ,
1919 CaptureWindow ,
@@ -50,6 +50,11 @@ const DEFAULT_EDITOR_SETTINGS = {
5050 showBackground : true ,
5151 inset : 0 ,
5252 autoBackground : true ,
53+ borderEnabled : false ,
54+ borderWeight : 2 ,
55+ borderColor : '#000000' ,
56+ borderOpacity : 100 ,
57+ borderType : 'center' as BorderType ,
5358} ;
5459
5560// Helper to parse ratio string into numeric ratio
@@ -145,6 +150,11 @@ function App() {
145150 const [ autoBackground , setAutoBackground ] = useState ( DEFAULT_EDITOR_SETTINGS . autoBackground ) ;
146151 const [ extractedColor , setExtractedColor ] = useState < string | null > ( null ) ;
147152 const [ insetBackgroundColor , setInsetBackgroundColor ] = useState < string | null > ( null ) ;
153+ const [ borderEnabled , setBorderEnabled ] = useState ( DEFAULT_EDITOR_SETTINGS . borderEnabled ) ;
154+ const [ borderWeight , setBorderWeight ] = useState ( DEFAULT_EDITOR_SETTINGS . borderWeight ) ;
155+ const [ borderColor , setBorderColor ] = useState ( DEFAULT_EDITOR_SETTINGS . borderColor ) ;
156+ const [ borderOpacity , setBorderOpacity ] = useState ( DEFAULT_EDITOR_SETTINGS . borderOpacity ) ;
157+ const [ borderType , setBorderType ] = useState < BorderType > ( DEFAULT_EDITOR_SETTINGS . borderType ) ;
148158 const [ editorSettingsLoaded , setEditorSettingsLoaded ] = useState ( false ) ;
149159 // Stores settings when background is hidden, so they can be restored
150160 const [ savedBackgroundSettings , setSavedBackgroundSettings ] = useState < {
@@ -238,6 +248,11 @@ function App() {
238248 if ( cfg . autoBackground !== undefined ) setAutoBackground ( cfg . autoBackground ) ;
239249 if ( cfg . insetBackgroundColor ) setInsetBackgroundColor ( cfg . insetBackgroundColor ) ;
240250 if ( cfg . shapeCornerRadius !== undefined ) setShapeCornerRadius ( cfg . shapeCornerRadius ) ;
251+ if ( cfg . borderEnabled !== undefined ) setBorderEnabled ( cfg . borderEnabled ) ;
252+ if ( cfg . borderWeight !== undefined ) setBorderWeight ( cfg . borderWeight ) ;
253+ if ( cfg . borderColor ) setBorderColor ( cfg . borderColor ) ;
254+ if ( cfg . borderOpacity !== undefined ) setBorderOpacity ( cfg . borderOpacity ) ;
255+ if ( cfg . borderType ) setBorderType ( cfg . borderType as BorderType ) ;
241256 }
242257 } catch ( err ) {
243258 console . error ( 'Failed to load editor settings:' , err ) ;
@@ -261,10 +276,15 @@ function App() {
261276 autoBackground,
262277 insetBackgroundColor : insetBackgroundColor || undefined ,
263278 shapeCornerRadius,
279+ borderEnabled,
280+ borderWeight,
281+ borderColor,
282+ borderOpacity,
283+ borderType,
264284 } ) . catch ( err => {
265285 console . error ( 'Failed to save editor settings:' , err ) ;
266286 } ) ;
267- } , [ padding , cornerRadius , shadowSize , backgroundColor , outputRatio , showBackground , inset , autoBackground , insetBackgroundColor , shapeCornerRadius , editorSettingsLoaded ] ) ;
287+ } , [ padding , cornerRadius , shadowSize , backgroundColor , outputRatio , showBackground , inset , autoBackground , insetBackgroundColor , shapeCornerRadius , borderEnabled , borderWeight , borderColor , borderOpacity , borderType , editorSettingsLoaded ] ) ;
268288
269289 // Load export settings from config on startup
270290 useEffect ( ( ) => {
@@ -1617,6 +1637,11 @@ function App() {
16171637 outputRatio = { outputRatio }
16181638 inset = { inset }
16191639 insetBackgroundColor = { insetBackgroundColor ?? extractedColor ?? undefined }
1640+ borderEnabled = { borderEnabled }
1641+ borderWeight = { borderWeight }
1642+ borderColor = { borderColor }
1643+ borderOpacity = { borderOpacity }
1644+ borderType = { borderType }
16201645 stageRef = { stageRef }
16211646 activeTool = { activeTool }
16221647 annotations = { annotations }
@@ -1656,6 +1681,11 @@ function App() {
16561681 autoBackground = { autoBackground }
16571682 extractedColor = { extractedColor }
16581683 insetBackgroundColor = { insetBackgroundColor }
1684+ borderEnabled = { borderEnabled }
1685+ borderWeight = { borderWeight }
1686+ borderColor = { borderColor }
1687+ borderOpacity = { borderOpacity }
1688+ borderType = { borderType }
16591689 onPaddingChange = { setPadding }
16601690 onCornerRadiusChange = { setCornerRadius }
16611691 onShadowSizeChange = { setShadowSize }
@@ -1665,6 +1695,11 @@ function App() {
16651695 onInsetChange = { setInset }
16661696 onAutoBackgroundChange = { handleAutoBackgroundChange }
16671697 onInsetBackgroundColorChange = { setInsetBackgroundColor }
1698+ onBorderEnabledChange = { setBorderEnabled }
1699+ onBorderWeightChange = { setBorderWeight }
1700+ onBorderColorChange = { setBorderColor }
1701+ onBorderOpacityChange = { setBorderOpacity }
1702+ onBorderTypeChange = { setBorderType }
16681703 />
16691704 ) }
16701705 </ div >
0 commit comments