mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 04:39:22 +02:00
LCL: Improved docking of coolbar/controlbar (another patch by Andrey Zubarev), Issue #32027
git-svn-id: trunk@55428 -
This commit is contained in:
parent
8532170a20
commit
e5fe561452
@ -541,7 +541,7 @@ end;
|
|||||||
|
|
||||||
procedure TCustomCoolBar.CalculateAndAlign;
|
procedure TCustomCoolBar.CalculateAndAlign;
|
||||||
var i, x, y, aBandHeight, aBorderLeft, aCountM1, aLeft,
|
var i, x, y, aBandHeight, aBorderLeft, aCountM1, aLeft,
|
||||||
aPrefSize, aStartIndex, aTop, aWidth: Integer;
|
aPrefSize, aStartIndex, aTop, aWidth, NewWidth,NewHeight: Integer;
|
||||||
aRowEnd: Boolean;
|
aRowEnd: Boolean;
|
||||||
begin
|
begin
|
||||||
//DebugLn('CalculateAndAlign');
|
//DebugLn('CalculateAndAlign');
|
||||||
@ -577,6 +577,16 @@ begin
|
|||||||
for i := 0 to aCountM1 do begin
|
for i := 0 to aCountM1 do begin
|
||||||
if aRowEnd or FVisiBands[i].Break then
|
if aRowEnd or FVisiBands[i].Break then
|
||||||
aLeft := aBorderLeft;
|
aLeft := aBorderLeft;
|
||||||
|
if Assigned(FVisiBands[i].Control)then
|
||||||
|
if FVisiBands[i].Control is TToolBar then
|
||||||
|
begin
|
||||||
|
if TToolBar(FVisiBands[i].Control).IsVertical then
|
||||||
|
TToolBar(FVisiBands[i].Control).WrapButtons(Height,NewWidth,NewHeight,true)
|
||||||
|
else
|
||||||
|
TToolBar(FVisiBands[i].Control).WrapButtons(Width,NewWidth,NewHeight,true);
|
||||||
|
FVisiBands[i].Control.Width:=NewWidth;
|
||||||
|
FVisiBands[i].Control.Height:=NewHeight;
|
||||||
|
end;
|
||||||
aBandHeight := Max(aBandHeight, FVisiBands[i].CalcPreferredHeight);
|
aBandHeight := Max(aBandHeight, FVisiBands[i].CalcPreferredHeight);
|
||||||
aRowEnd := (i = aCountM1);
|
aRowEnd := (i = aCountM1);
|
||||||
inc(aLeft, FVisiBands[i].Width);
|
inc(aLeft, FVisiBands[i].Width);
|
||||||
@ -687,7 +697,7 @@ begin
|
|||||||
if aCountM1 >= 0 then
|
if aCountM1 >= 0 then
|
||||||
PreferredHeight := FVisiBands[aCountM1].FTop+FVisiBands[aCountM1].FHeight+FBorderBottom
|
PreferredHeight := FVisiBands[aCountM1].FTop+FVisiBands[aCountM1].FHeight+FBorderBottom
|
||||||
else
|
else
|
||||||
PreferredHeight := FBorderTop+TCoolBand.cDefMinHeight+FBorderBottom;
|
PreferredHeight := FBorderTop+FBorderBottom;
|
||||||
PreferredWidth := 0
|
PreferredWidth := 0
|
||||||
end else begin
|
end else begin
|
||||||
PreferredHeight := 0;
|
PreferredHeight := 0;
|
||||||
@ -701,7 +711,7 @@ begin
|
|||||||
FVisiBands[i].FTop := FVisiBands[i].FTop-x;
|
FVisiBands[i].FTop := FVisiBands[i].FTop-x;
|
||||||
end;
|
end;
|
||||||
end else
|
end else
|
||||||
PreferredWidth := FBorderLeft+TCoolBand.cDefMinHeight+FBorderRight;
|
PreferredWidth := FBorderLeft+FBorderRight;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user