feat(fillbar): Fill bar settings... au clic droit, ouvre l'onglet par-dessus l'entree en cours

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-09-18 11:08:52 +01:00
parent af6e8a2d9a
commit 9947ce5718
3 changed files with 29 additions and 1 deletions
+12 -1
View File
@@ -116,6 +116,7 @@ type
// force-killed (which leaves -shm / -wal files behind). // force-killed (which leaves -shm / -wal files behind).
FShutdownPending: Boolean; FShutdownPending: Boolean;
FOnTrayRestore: TProc; FOnTrayRestore: TProc;
FOnFillBarSettings: TProc;
FOnLockRequest: TProc; FOnLockRequest: TProc;
FOnQuit: TProc; FOnQuit: TProc;
FOnQuickSearchRequest: TProc; FOnQuickSearchRequest: TProc;
@@ -297,6 +298,9 @@ type
property ShutdownPending: Boolean read FShutdownPending; property ShutdownPending: Boolean read FShutdownPending;
// Fired on main thread when the user clicks the tray icon. // Fired on main thread when the user clicks the tray icon.
property OnTrayRestore: TProc read FOnTrayRestore write FOnTrayRestore; 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 // 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;
@@ -436,6 +440,7 @@ const
LAZY_ID_ADD = 106; // nouvelle entree depuis la fenetre en avant (Ctrl+Shift+A) LAZY_ID_ADD = 106; // nouvelle entree depuis la fenetre en avant (Ctrl+Shift+A)
LAZY_ID_SEARCH = 107; // recherche rapide (Ctrl+Shift+Q) 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_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 // LE SONDAGE PLUTOT QUE TrackMouseEvent. La barrette a quatre fenetres
// enfants : passer d'elle a un bouton envoie deja un WM_MOUSELEAVE au parent, // 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 // 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'; if FLazyIcons then LIconsLabel := 'Show text' else LIconsLabel := 'Show icons';
AppendMenu(LMenu, MF_SEPARATOR, 0, nil); AppendMenu(LMenu, MF_SEPARATOR, 0, nil);
AppendMenu(LMenu, MF_STRING, LAZY_MENU_ICONS, PChar(LIconsLabel)); 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 // 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 // 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)); LPt.X, LPt.Y, 0, FMsgWindow, nil));
PostMessage(FMsgWindow, WM_NULL, 0, 0); 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 begin
if FLazyIcons then SetPref(LAZY_ICONS_KEY, '0') else SetPref(LAZY_ICONS_KEY, '1'); if FLazyIcons then SetPref(LAZY_ICONS_KEY, '0') else SetPref(LAZY_ICONS_KEY, '1');
ReloadLazyBar; ReloadLazyBar;
+6
View File
@@ -314,6 +314,12 @@ begin
FFileSaveChunks := TDictionary<string, TStringBuilder>.Create; FFileSaveChunks := TDictionary<string, TStringBuilder>.Create;
FBridge.OnSystemLock := BridgeSystemLock; FBridge.OnSystemLock := BridgeSystemLock;
FBridge.OnTrayRestore := BridgeTrayRestore; FBridge.OnTrayRestore := BridgeTrayRestore;
FBridge.OnFillBarSettings :=
procedure
begin
WebBrowser.ExecuteJavaScript(
'if(window.Bridge&&Bridge.onOpenFillBarSettings)Bridge.onOpenFillBarSettings()');
end;
FBridge.OnLockRequest := BridgeLockRequest; FBridge.OnLockRequest := BridgeLockRequest;
FBridge.OnQuit := BridgeQuit; FBridge.OnQuit := BridgeQuit;
FBridge.OnAutofillRequest := BridgeAutofillRequest; FBridge.OnAutofillRequest := BridgeAutofillRequest;
+11
View File
@@ -6709,6 +6709,17 @@ Bridge.onFillBar = function (st) {
$('#fbStyle').value = st.icons ? 'icons' : 'text'; $('#fbStyle').value = st.icons ? 'icons' : 'text';
$('#fbAlpha').value = String(parseInt(st.alpha, 10) || 60); $('#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() { function fillBarPush() {
const keys = Array.from($$('.fb-btn')).filter(c => c.checked).map(c => c.dataset.key); const keys = Array.from($$('.fb-btn')).filter(c => c.checked).map(c => c.dataset.key);
window.location.href = 'cmd://fillbar/set' window.location.href = 'cmd://fillbar/set'