mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 20:21:04 +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
|
public
|
||||||
colorPanel: NSColorPanel;
|
colorPanel: NSColorPanel;
|
||||||
ColorDialog: TColorDialog;
|
ColorDialog: TColorDialog;
|
||||||
DontPickColorOnClose: Boolean;
|
didPickColor: Boolean;
|
||||||
// NSWindowDelegateProtocol
|
// NSWindowDelegateProtocol
|
||||||
procedure windowWillClose(notification: NSNotification); message 'windowWillClose:';
|
procedure windowWillClose(notification: NSNotification); message 'windowWillClose:';
|
||||||
//
|
//
|
||||||
@ -621,7 +621,7 @@ end;
|
|||||||
|
|
||||||
procedure TColorPanelDelegate.windowWillClose(notification: NSNotification);
|
procedure TColorPanelDelegate.windowWillClose(notification: NSNotification);
|
||||||
begin
|
begin
|
||||||
if not DontPickColorOnClose then
|
if didPickColor then
|
||||||
begin
|
begin
|
||||||
ColorDialog.UserChoice := mrOk;
|
ColorDialog.UserChoice := mrOk;
|
||||||
doPickColor();
|
doPickColor();
|
||||||
@ -637,15 +637,13 @@ end;
|
|||||||
procedure TColorPanelDelegate.pickColor();
|
procedure TColorPanelDelegate.pickColor();
|
||||||
begin
|
begin
|
||||||
ColorDialog.UserChoice := mrCancel;
|
ColorDialog.UserChoice := mrCancel;
|
||||||
DontPickColorOnClose := True;
|
didPickColor := True;
|
||||||
doPickColor();
|
doPickColor();
|
||||||
exit();
|
exit();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TColorPanelDelegate.exit();
|
procedure TColorPanelDelegate.exit();
|
||||||
begin
|
begin
|
||||||
ColorDialog.UserChoice := mrOk;
|
|
||||||
DontPickColorOnClose := True;
|
|
||||||
colorPanel.close();
|
colorPanel.close();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user