@@ -199,7 +199,9 @@ public static Flyout CreateSettings(string currentTheme, string currentBackdropT
199199 Action < Flyout > ? onShowAi = null , Action < Flyout > ? onShowPrompts = null ,
200200 string ? currentNoteStyle = null , Action < string > ? onNoteStyleSelected = null ,
201201 string ? currentFont = null , Action < string > ? onFontSelected = null ,
202- Action ? onResetPassword = null , Action ? onResetNotes = null )
202+ Action ? onResetPassword = null , Action ? onResetNotes = null ,
203+ bool startWithWindows = false , bool startMinimized = false ,
204+ Action < bool > ? onStartWithWindowsToggled = null , Action < bool > ? onStartMinimizedToggled = null )
203205 {
204206 var flyout = new Flyout ( ) ;
205207 flyout . FlyoutPresenterStyle = CreateFlyoutPresenterStyle ( 260 , 320 ) ;
@@ -333,6 +335,17 @@ static string FindLabel((string key, string label)[] items, string current)
333335 panel . Children . Add ( langBtn ) ;
334336 }
335337
338+ // Startup
339+ if ( onStartWithWindowsToggled != null || onStartMinimizedToggled != null )
340+ {
341+ var startupBtn = CreateNavigateButton ( Lang . T ( "startup" ) , ( ) =>
342+ ShowStartupSubPanel ( flyout , startWithWindows , startMinimized ,
343+ onStartWithWindowsToggled , onStartMinimizedToggled ) ) ;
344+ startupBtn . Tag = Lang . T ( "startup" ) + " Démarrage Startup Windows Tray" ;
345+ allButtons . Add ( startupBtn ) ;
346+ panel . Children . Add ( startupBtn ) ;
347+ }
348+
336349 // Reset
337350 if ( onResetPassword != null || onResetNotes != null )
338351 {
@@ -693,6 +706,52 @@ internal static Button CreateButton(ActionItem action, Action handler)
693706
694707 // ── Reset sub-panel ──
695708
709+ private static void ShowStartupSubPanel ( Flyout flyout ,
710+ bool startWithWindows , bool startMinimized ,
711+ Action < bool > ? onStartWithWindowsToggled , Action < bool > ? onStartMinimizedToggled )
712+ {
713+ var panel = CreateSubPanelWithHeader ( Lang . T ( "startup" ) , ( ) =>
714+ {
715+ flyout . Hide ( ) ;
716+ } ) ;
717+
718+ if ( onStartWithWindowsToggled != null )
719+ {
720+ var swBtn = CreateCheckItem ( Lang . T ( "startup_with_windows" ) , startWithWindows , ( ) =>
721+ {
722+ startWithWindows = ! startWithWindows ;
723+ onStartWithWindowsToggled ( startWithWindows ) ;
724+ ShowStartupSubPanel ( flyout , startWithWindows , startMinimized ,
725+ onStartWithWindowsToggled , onStartMinimizedToggled ) ;
726+ } ) ;
727+ panel . Children . Add ( swBtn ) ;
728+ }
729+
730+ if ( onStartMinimizedToggled != null )
731+ {
732+ var smBtn = CreateCheckItem ( Lang . T ( "startup_minimized" ) , startMinimized , ( ) =>
733+ {
734+ startMinimized = ! startMinimized ;
735+ onStartMinimizedToggled ( startMinimized ) ;
736+ ShowStartupSubPanel ( flyout , startWithWindows , startMinimized ,
737+ onStartWithWindowsToggled , onStartMinimizedToggled ) ;
738+ } ) ;
739+ panel . Children . Add ( smBtn ) ;
740+
741+ var desc = new TextBlock
742+ {
743+ Text = Lang . T ( "startup_minimized_desc" ) ,
744+ FontSize = 11 ,
745+ Opacity = 0.45 ,
746+ Margin = new Thickness ( 12 , 0 , 8 , 4 ) ,
747+ TextWrapping = TextWrapping . Wrap
748+ } ;
749+ panel . Children . Add ( desc ) ;
750+ }
751+
752+ flyout . Content = panel ;
753+ }
754+
696755 private static void ShowResetSubPanel ( Flyout flyout , Action ? onResetPassword , Action ? onResetNotes )
697756 {
698757 var panel = CreateSubPanelWithHeader ( Lang . T ( "reset" ) , ( ) =>
0 commit comments