fix(fillbar): l'onglet Fill bar se met a jour quand la barrette change par clic droit ou par le tray

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-09-18 11:19:00 +01:00
parent ba06d4584e
commit 891abf7a9d
2 changed files with 15 additions and 0 deletions
+7
View File
@@ -117,6 +117,7 @@ type
FShutdownPending: Boolean; FShutdownPending: Boolean;
FOnTrayRestore: TProc; FOnTrayRestore: TProc;
FOnFillBarSettings: TProc; FOnFillBarSettings: TProc;
FOnFillBarChanged: TProc;
FOnLockRequest: TProc; FOnLockRequest: TProc;
FOnQuit: TProc; FOnQuit: TProc;
FOnQuickSearchRequest: TProc; FOnQuickSearchRequest: TProc;
@@ -301,6 +302,9 @@ type
// Clic droit sur la barrette -> "Fill bar settings..." : la fenetre revient // Clic droit sur la barrette -> "Fill bar settings..." : la fenetre revient
// (OnTrayRestore) puis l'hote ouvre l'onglet Fill bar des reglages. // (OnTrayRestore) puis l'hote ouvre l'onglet Fill bar des reglages.
property OnFillBarSettings: TProc read FOnFillBarSettings write FOnFillBarSettings; 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 // Fired when the user picks "Lock vault" from the tray menu. Handler
// should trigger the JS lockVault() (typically via ExecuteJavaScript). // should trigger the JS lockVault() (typically via ExecuteJavaScript).
property OnLockRequest: TProc read FOnLockRequest write FOnLockRequest; property OnLockRequest: TProc read FOnLockRequest write FOnLockRequest;
@@ -1290,6 +1294,7 @@ begin
FLazyAlphaPct := LCmd; FLazyAlphaPct := LCmd;
SetPref(LAZY_ALPHA_KEY, IntToStr(FLazyAlphaPct)); SetPref(LAZY_ALPHA_KEY, IntToStr(FLazyAlphaPct));
ApplyLazyAlpha(FLazyHover); ApplyLazyAlpha(FLazyHover);
if Assigned(FOnFillBarChanged) then FOnFillBarChanged();
end; end;
finally finally
DestroyMenu(LMenu); DestroyMenu(LMenu);
@@ -1523,6 +1528,7 @@ begin
begin begin
DeallocateHWnd(FLazyWnd); // the child buttons go with their parent DeallocateHWnd(FLazyWnd); // the child buttons go with their parent
FLazyWnd := 0; FLazyWnd := 0;
if Assigned(FOnFillBarChanged) then FOnFillBarChanged();
Exit; Exit;
end; end;
@@ -1594,6 +1600,7 @@ begin
FLazyHover := False; FLazyHover := False;
ApplyLazyAlpha(False); ApplyLazyAlpha(False);
SetTimer(FLazyWnd, LAZY_TIMER_ID, LAZY_POLL_MS, nil); SetTimer(FLazyWnd, LAZY_TIMER_ID, LAZY_POLL_MS, nil);
if Assigned(FOnFillBarChanged) then FOnFillBarChanged();
end; end;
procedure TPMBridge.MsgWindowHandler(var AMsg: TMessage); procedure TPMBridge.MsgWindowHandler(var AMsg: TMessage);
+8
View File
@@ -314,6 +314,14 @@ begin
FFileSaveChunks := TDictionary<string, TStringBuilder>.Create; FFileSaveChunks := TDictionary<string, TStringBuilder>.Create;
FBridge.OnSystemLock := BridgeSystemLock; FBridge.OnSystemLock := BridgeSystemLock;
FBridge.OnTrayRestore := BridgeTrayRestore; 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 := FBridge.OnFillBarSettings :=
procedure procedure
begin begin