diff --git a/delphi-backend/Source/PM.Bridge.pas b/delphi-backend/Source/PM.Bridge.pas index ae7e54b..88e2b83 100644 --- a/delphi-backend/Source/PM.Bridge.pas +++ b/delphi-backend/Source/PM.Bridge.pas @@ -117,6 +117,7 @@ type FShutdownPending: Boolean; FOnTrayRestore: TProc; FOnFillBarSettings: TProc; + FOnFillBarChanged: TProc; FOnLockRequest: TProc; FOnQuit: TProc; FOnQuickSearchRequest: TProc; @@ -301,6 +302,9 @@ type // Clic droit sur la barrette -> "Fill bar settings..." : la fenetre revient // (OnTrayRestore) puis l'hote ouvre l'onglet Fill bar des reglages. property OnFillBarSettings: TProc read FOnFillBarSettings write FOnFillBarSettings; + // La barrette a change hors des reglages (clic droit, menu du tray) : l'hote + // rafraichit l'onglet Fill bar s'il est affiche. + property OnFillBarChanged: TProc read FOnFillBarChanged write FOnFillBarChanged; // Fired when the user picks "Lock vault" from the tray menu. Handler // should trigger the JS lockVault() (typically via ExecuteJavaScript). property OnLockRequest: TProc read FOnLockRequest write FOnLockRequest; @@ -1290,6 +1294,7 @@ begin FLazyAlphaPct := LCmd; SetPref(LAZY_ALPHA_KEY, IntToStr(FLazyAlphaPct)); ApplyLazyAlpha(FLazyHover); + if Assigned(FOnFillBarChanged) then FOnFillBarChanged(); end; finally DestroyMenu(LMenu); @@ -1523,6 +1528,7 @@ begin begin DeallocateHWnd(FLazyWnd); // the child buttons go with their parent FLazyWnd := 0; + if Assigned(FOnFillBarChanged) then FOnFillBarChanged(); Exit; end; @@ -1594,6 +1600,7 @@ begin FLazyHover := False; ApplyLazyAlpha(False); SetTimer(FLazyWnd, LAZY_TIMER_ID, LAZY_POLL_MS, nil); + if Assigned(FOnFillBarChanged) then FOnFillBarChanged(); end; procedure TPMBridge.MsgWindowHandler(var AMsg: TMessage); diff --git a/delphi-backend/UMainForm.pas b/delphi-backend/UMainForm.pas index ec102ce..581e389 100644 --- a/delphi-backend/UMainForm.pas +++ b/delphi-backend/UMainForm.pas @@ -314,6 +314,14 @@ begin FFileSaveChunks := TDictionary.Create; FBridge.OnSystemLock := BridgeSystemLock; FBridge.OnTrayRestore := BridgeTrayRestore; + // Changement fait sur la barrette elle-meme : l'onglet se relit (fillbar/get). + FBridge.OnFillBarChanged := + procedure + begin + // Pas avant l'init de WebView2 : RestoreLazyBar passe ici au demarrage. + if FBrowserInitialized then + WebBrowser.ExecuteJavaScript('if(window.fillBarRequest)fillBarRequest()'); + end; FBridge.OnFillBarSettings := procedure begin