mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 21:18:01 +02:00
LCL: Prevent a crash in Coolbar when clicking a Grabber in an empty band.
git-svn-id: trunk@62283 -
This commit is contained in:
parent
09c0c58381
commit
88ac636e41
@ -1002,7 +1002,7 @@ begin
|
||||
end;
|
||||
|
||||
procedure TCustomCoolBar.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
var aBand, w, h: Integer;
|
||||
var aBand, w, h, offs: Integer;
|
||||
newRowBelow, needRecalc, needBandMaximize, aGrabber: Boolean;
|
||||
begin
|
||||
inherited MouseUp(Button, Shift, X, Y);
|
||||
@ -1014,14 +1014,16 @@ begin
|
||||
end;
|
||||
if needBandMaximize then begin
|
||||
MouseToBandPos(X, Y, aBand, aGrabber);
|
||||
if aGrabber then begin
|
||||
if aGrabber and Assigned(FVisiBands[aBand].control) then begin
|
||||
w:=0;
|
||||
h:=0;
|
||||
FVisiBands[aBand].control.GetPreferredSize(w,h);
|
||||
offs:=FVisiBands[aBand].CalcControlLeft
|
||||
+FVisiBands[aBand].cDivider + HorizontalSpacing;
|
||||
if vertical then
|
||||
FVisiBands[aBand].width:=FVisiBands[aBand].CalcControlLeft+h+HorizontalSpacing+FVisiBands[aBand].cDivider
|
||||
FVisiBands[aBand].width:=offs+h
|
||||
else
|
||||
FVisiBands[aBand].width:=FVisiBands[aBand].CalcControlLeft+w+HorizontalSpacing+FVisiBands[aBand].cDivider;
|
||||
FVisiBands[aBand].width:=offs+w;
|
||||
FDraggedBandIndex:=-1;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user