ObjectInspector: Reduce calls to ComponentTree.Invalidate (changing the positon of FCurrentButton or FCurrentEdit in the OI-Grid can trigger a call to Resize of the Form, even so the Size did not change / Win10)

git-svn-id: trunk@59622 -
This commit is contained in:
martin 2018-11-22 10:21:27 +00:00
parent a08b455ead
commit 8765ceb4f1

View File

@ -701,6 +701,8 @@ type
FOnShowOptions: TNotifyEvent; FOnShowOptions: TNotifyEvent;
FOnUpdateRestricted: TNotifyEvent; FOnUpdateRestricted: TNotifyEvent;
FOnViewRestricted: TNotifyEvent; FOnViewRestricted: TNotifyEvent;
FLastTreeSize: TRect;
// These event handlers are assigned at run-time, no need for default published section. // These event handlers are assigned at run-time, no need for default published section.
procedure ComponentTreeDblClick(Sender: TObject); procedure ComponentTreeDblClick(Sender: TObject);
procedure ComponentTreeGetNodeImageIndex(APersistent: TPersistent; var AIndex: integer); procedure ComponentTreeGetNodeImageIndex(APersistent: TPersistent; var AIndex: integer);
@ -5616,8 +5618,11 @@ end;
procedure TObjectInspectorDlg.Resize; procedure TObjectInspectorDlg.Resize;
begin begin
inherited Resize; inherited Resize;
if Assigned(ComponentTree) then // BUG: resize gets called, even if nothing changed
if Assigned(ComponentTree) and (FLastTreeSize <> ComponentTree.BoundsRect) then begin
ComponentTree.Invalidate; // Update Scrollbars. ComponentTree.Invalidate; // Update Scrollbars.
FLastTreeSize := ComponentTree.BoundsRect;
end;
end; end;
procedure TObjectInspectorDlg.ComponentTreeModified(Sender: TObject); procedure TObjectInspectorDlg.ComponentTreeModified(Sender: TObject);