ADD: "Open Stash" Item in Modern Toolbar on macOS

This commit is contained in:
rich2014 2026-06-23 19:50:56 +08:00
commit 04f8285fe7

View file

@ -459,6 +459,11 @@ begin
frmMain.Commands.DoOpenVirtualFileSystemList( frmMain.ActiveFrame );
end;
procedure stashAction( const Sender: id );
begin
frmMain.Commands.cm_OpenStash([]);
end;
procedure terminalAction( const Sender: id );
begin
frmMain.Commands.cm_RunTerm([]);
@ -560,6 +565,17 @@ const
onAction: @networkAction;
);
stashItemConfig: TCocoaConfigToolBarItem = (
identifier: 'MainForm.Stash';
priority: NSToolbarItemVisibilityPriorityStandard;
navigational: False;
iconName: 'square.stack';
title: rsStashName;
tips: rsStashName;
bordered: True;
onAction: @stashAction;
);
showBriefItemConfig: TCocoaConfigToolBarItem = (
identifier: 'MainForm.ShowMode.Brief';
@ -817,6 +833,7 @@ const
'MainForm.iCloud',
'MainForm.network',
'MainForm.Stash',
'NSToolbarFlexibleSpaceItem',
'MainForm.ShowMode',
@ -845,6 +862,7 @@ const
'MainForm.GoBackward',
'MainForm.GoForward',
'MainForm.Stash',
'MainForm.iCloud',
'MainForm.network',
'MainForm.ShowMode',
@ -874,6 +892,8 @@ procedure addMainFormShortCutTips;
begin
addShortCutTipsToItemConfig( 'Main', 'cm_ViewHistoryPrev', goBackwardItemConfig );
addShortCutTipsToItemConfig( 'Main', 'cm_ViewHistoryNext', goForwardItemConfig );
addShortCutTipsToItemConfig( 'Main', 'cm_OpenVirtualFileSystemList', networkItemConfig );
addShortCutTipsToItemConfig( 'Main', 'cm_OpenStash', stashItemConfig );
end;
procedure joinPrivilegeTips;
@ -902,6 +922,7 @@ procedure doInitMainFormConfig;
begin
loadVectorImageWithName( 'airdrop.svg', 'doublecmd.airdrop' );
loadVectorImageWithName( 'finder.svg', 'doublecmd.finder' );
addMainFormShortCutTips;
joinPrivilegeTips;
@ -936,6 +957,7 @@ begin
TCocoaToolBarUtils.toClass(syncItemConfig),
TCocoaToolBarUtils.toClass(editItemConfig),
TCocoaToolBarUtils.toClass(stashItemConfig),
TCocoaToolBarUtils.toClass(iCloudItemConfig),
TCocoaToolBarUtils.toClass(networkItemConfig)
];