Object Inspector: Align only "normal" CheckBox vertically, not CheckBoxThemed. Issue #29412.

git-svn-id: trunk@51416 -
This commit is contained in:
juha 2016-01-25 19:50:21 +00:00
parent 44a263b11d
commit cf3a735d93

View File

@ -2641,8 +2641,7 @@ end;
procedure TOICustomPropertyGrid.AlignEditComponents; procedure TOICustomPropertyGrid.AlignEditComponents;
var var
RRect,EditCompRect,EditBtnRect:TRect; RRect, EditCompRect, EditBtnRect: TRect;
TopMargin: Integer;
function CompareRectangles(r1,r2:TRect):boolean; function CompareRectangles(r1,r2:TRect):boolean;
begin begin
@ -2686,12 +2685,14 @@ begin
Dec(EditCompRect.Left); Dec(EditCompRect.Left);
{$ENDIF} {$ENDIF}
Dec(EditCompRect.Top); Dec(EditCompRect.Top);
{$IFnDEF UseOICheckBoxThemed}
end end
else if FCurrentEdit is {$IFDEF UseOICheckBoxThemed} TCheckBoxThemed {$ELSE} TCheckBox {$ENDIF} then else if FCurrentEdit is TCheckBox then
begin // Align CheckBox to the middle vertically begin
TopMargin := (EditCompRect.Bottom - EditCompRect.Top - ValueCheckBox.Height) div 2; with EditCompRect do // Align "normal" CheckBox to the middle vertically
Inc(EditCompRect.Top, TopMargin); Inc(Top, (Bottom - Top - ValueCheckBox.Height) div 2);
Inc(EditCompRect.Left); // and move it a little right. Inc(EditCompRect.Left); // and move it a little right.
{$ENDIF}
end; end;
//debugln('TOICustomPropertyGrid.AlignEditComponents A ',dbgsName(FCurrentEdit),' ',dbgs(EditCompRect)); //debugln('TOICustomPropertyGrid.AlignEditComponents A ',dbgsName(FCurrentEdit),' ',dbgs(EditCompRect));
if not CompareRectangles(FCurrentEdit.BoundsRect,EditCompRect) then if not CompareRectangles(FCurrentEdit.BoundsRect,EditCompRect) then