From 9947ce5718927f5d4a7e0ac9ba54900ac6d9c280 Mon Sep 17 00:00:00 2001 From: r-zakarya <82443831+r-zakarya@users.noreply.github.com> Date: Fri, 18 Sep 2026 11:08:52 +0100 Subject: [PATCH] feat(fillbar): Fill bar settings... au clic droit, ouvre l'onglet par-dessus l'entree en cours Co-Authored-By: Claude Opus 5 --- delphi-backend/Source/PM.Bridge.pas | 13 ++++++++++++- delphi-backend/UMainForm.pas | 6 ++++++ js/app.js | 11 +++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/delphi-backend/Source/PM.Bridge.pas b/delphi-backend/Source/PM.Bridge.pas index 7386ff7..5c7d9b6 100644 --- a/delphi-backend/Source/PM.Bridge.pas +++ b/delphi-backend/Source/PM.Bridge.pas @@ -116,6 +116,7 @@ type // force-killed (which leaves -shm / -wal files behind). FShutdownPending: Boolean; FOnTrayRestore: TProc; + FOnFillBarSettings: TProc; FOnLockRequest: TProc; FOnQuit: TProc; FOnQuickSearchRequest: TProc; @@ -297,6 +298,9 @@ type property ShutdownPending: Boolean read FShutdownPending; // Fired on main thread when the user clicks the tray icon. property OnTrayRestore: TProc read FOnTrayRestore write FOnTrayRestore; + // 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; // 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; @@ -436,6 +440,7 @@ const LAZY_ID_ADD = 106; // nouvelle entree depuis la fenetre en avant (Ctrl+Shift+A) LAZY_ID_SEARCH = 107; // recherche rapide (Ctrl+Shift+Q) LAZY_MENU_ICONS = 1; // hors des valeurs d'opacite (25..100) du meme menu + LAZY_MENU_SETTINGS = 2; // LE SONDAGE PLUTOT QUE TrackMouseEvent. La barrette a quatre fenetres // enfants : passer d'elle a un bouton envoie deja un WM_MOUSELEAVE au parent, // et il faudrait donc suivre la souris sur les cinq fenetres pour recoller @@ -1250,6 +1255,7 @@ begin if FLazyIcons then LIconsLabel := 'Show text' else LIconsLabel := 'Show icons'; AppendMenu(LMenu, MF_SEPARATOR, 0, nil); AppendMenu(LMenu, MF_STRING, LAZY_MENU_ICONS, PChar(LIconsLabel)); + AppendMenu(LMenu, MF_STRING, LAZY_MENU_SETTINGS, 'Fill bar settings...'); // LE BATTEMENT DOIT S'ARRETER PENDANT LE MENU. Il repose la barrette en // tete de la bande TOPMOST cinq fois par seconde - or le menu deroulant est @@ -1267,7 +1273,12 @@ begin LPt.X, LPt.Y, 0, FMsgWindow, nil)); PostMessage(FMsgWindow, WM_NULL, 0, 0); - if LCmd = LAZY_MENU_ICONS then + if LCmd = LAZY_MENU_SETTINGS then + begin + if Assigned(FOnTrayRestore) then FOnTrayRestore(); + if Assigned(FOnFillBarSettings) then FOnFillBarSettings(); + end + else if LCmd = LAZY_MENU_ICONS then begin if FLazyIcons then SetPref(LAZY_ICONS_KEY, '0') else SetPref(LAZY_ICONS_KEY, '1'); ReloadLazyBar; diff --git a/delphi-backend/UMainForm.pas b/delphi-backend/UMainForm.pas index 81d12f1..ec102ce 100644 --- a/delphi-backend/UMainForm.pas +++ b/delphi-backend/UMainForm.pas @@ -314,6 +314,12 @@ begin FFileSaveChunks := TDictionary.Create; FBridge.OnSystemLock := BridgeSystemLock; FBridge.OnTrayRestore := BridgeTrayRestore; + FBridge.OnFillBarSettings := + procedure + begin + WebBrowser.ExecuteJavaScript( + 'if(window.Bridge&&Bridge.onOpenFillBarSettings)Bridge.onOpenFillBarSettings()'); + end; FBridge.OnLockRequest := BridgeLockRequest; FBridge.OnQuit := BridgeQuit; FBridge.OnAutofillRequest := BridgeAutofillRequest; diff --git a/js/app.js b/js/app.js index 978da08..b7ed773 100644 --- a/js/app.js +++ b/js/app.js @@ -6709,6 +6709,17 @@ Bridge.onFillBar = function (st) { $('#fbStyle').value = st.icons ? 'icons' : 'text'; $('#fbAlpha').value = String(parseInt(st.alpha, 10) || 60); }; +// Clic droit sur la barrette -> "Fill bar settings..." : l'exe a deja ramene la +// fenetre. Les reglages s'ouvrent PAR-DESSUS une entree en cours d'edition, +// qui reste intacte dessous (Echap ferme d'abord les reglages). +Bridge.onOpenFillBarSettings = function () { + if (!state.cryptoKey) { + toast('Unlock the vault to open its settings', 'warning'); + return; + } + openSettings(); + applySettingsTab('fillbar'); +}; function fillBarPush() { const keys = Array.from($$('.fb-btn')).filter(c => c.checked).map(c => c.dataset.key); window.location.href = 'cmd://fillbar/set'