mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 11:19:26 +02:00
cocoa: if closewindow button (red-x) is pressed, cancel color selection, instead of accepting the color
git-svn-id: trunk@62710 -
This commit is contained in:
parent
45ac9380f3
commit
04ca721bfc
@ -92,7 +92,7 @@ type
|
||||
public
|
||||
colorPanel: NSColorPanel;
|
||||
ColorDialog: TColorDialog;
|
||||
DontPickColorOnClose: Boolean;
|
||||
didPickColor: Boolean;
|
||||
// NSWindowDelegateProtocol
|
||||
procedure windowWillClose(notification: NSNotification); message 'windowWillClose:';
|
||||
//
|
||||
@ -621,7 +621,7 @@ end;
|
||||
|
||||
procedure TColorPanelDelegate.windowWillClose(notification: NSNotification);
|
||||
begin
|
||||
if not DontPickColorOnClose then
|
||||
if didPickColor then
|
||||
begin
|
||||
ColorDialog.UserChoice := mrOk;
|
||||
doPickColor();
|
||||
@ -637,15 +637,13 @@ end;
|
||||
procedure TColorPanelDelegate.pickColor();
|
||||
begin
|
||||
ColorDialog.UserChoice := mrCancel;
|
||||
DontPickColorOnClose := True;
|
||||
didPickColor := True;
|
||||
doPickColor();
|
||||
exit();
|
||||
end;
|
||||
|
||||
procedure TColorPanelDelegate.exit();
|
||||
begin
|
||||
ColorDialog.UserChoice := mrOk;
|
||||
DontPickColorOnClose := True;
|
||||
colorPanel.close();
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user