ADD: MacCloud/DropBox step-39: support ESC and Command+W in Options Dialog

This commit is contained in:
rich2014 2025-04-10 22:39:35 +08:00
commit 265223acdb

View file

@ -149,6 +149,8 @@ type
procedure onSelectedConnectionChanged( const selectedIndex: Integer );
public
procedure windowWillClose (notification: NSNotification);
procedure cancelOperation(sender: id); override;
function performKeyEquivalent(theEvent: NSEvent): ObjCBOOL; override;
end;
{ TConnectionConfigItems }
@ -491,6 +493,21 @@ begin
NSApplication(NSAPP).stopModal;
end;
procedure TCloudOptionsWindow.cancelOperation(sender: id);
begin
self.close;
end;
function TCloudOptionsWindow.performKeyEquivalent(theEvent: NSEvent): ObjCBOOL;
begin
if theEvent.charactersIgnoringModifiers.isEqualToString(NSSTR('w')) and
((theEvent.modifierFlags and NSCommandKeyMask) <> 0 ) then begin
self.close;
Result:= True;
end else
Result:= inherited;
end;
{ TConnectionListView }
function TConnectionListView.numberOfRowsInTableView(tableView: NSTableView