Cocoa: CocoaDatePicker: optimize code

This commit is contained in:
rich2014 2023-06-30 23:07:27 +08:00
parent 3d8dd85474
commit 484e6b3efd

View File

@ -59,12 +59,11 @@ begin
// After mouse event, has our date changed
newDate:= NSDateToDateTime(Self.dateValue);
dateClicked:= (oldDate <> newDate);
if dateClicked and Assigned(callback) then
if dateClicked then
callback.SendOnChange;
// This also calls OnClick....
if Assigned(Callback) then
callback.MouseUpDownEvent(event, true);
callback.MouseUpDownEvent(event, true);
end;
end;
end;