mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 05:28:17 +02:00
TScrollBox: fix flicker when Form.AutoSizeAll is called. Do not call ShowScrollBar when nothing changed.
This commit is contained in:
parent
07025f3b9c
commit
4891f1f0e1
@ -107,6 +107,7 @@ type
|
||||
FTracking: Boolean;
|
||||
FVisible: Boolean;
|
||||
FOldScrollInfo: TScrollInfo;
|
||||
FOldVisible: Boolean;
|
||||
FOldScrollInfoValid: Boolean;
|
||||
protected
|
||||
FControl: TWinControl;
|
||||
|
@ -230,14 +230,18 @@ begin
|
||||
if (not FOldScrollInfoValid) or (not CompareMem(@ScrollInfo, @FOldScrollInfo, SizeOf(TScrollInfo))) then
|
||||
begin
|
||||
FOldScrollInfo := ScrollInfo;
|
||||
FOldScrollInfoValid := True;
|
||||
SetScrollInfo(ControlHandle, IntfBarKind[Kind], ScrollInfo, NewVisible);
|
||||
// update policy too
|
||||
ScrollInfo.fMask := SIF_UPDATEPOLICY;
|
||||
ScrollInfo.nTrackPos := TrackToPolicyMap[FTracking];
|
||||
SetScrollInfo(ControlHandle, IntfBarKind[Kind], ScrollInfo, NewVisible);
|
||||
end;
|
||||
ShowScrollBar(ControlHandle, IntfBarKind[Kind], NewVisible);
|
||||
ShowScrollBar(ControlHandle, IntfBarKind[Kind], NewVisible);
|
||||
end
|
||||
else
|
||||
if (not FOldScrollInfoValid) or (FOldVisible <> NewVisible) then
|
||||
ShowScrollBar(ControlHandle, IntfBarKind[Kind], NewVisible);
|
||||
FOldVisible := NewVisible;
|
||||
FOldScrollInfoValid := True;
|
||||
{$IFDEF VerboseScrollingWinControl}
|
||||
//if DebugCondition then
|
||||
DebugLn(['TControlScrollBar.UpdateScrollBar ',DbgSName(FControl),' ',DbgSName(Self),' ',dbgs(Kind),' FVisible=',FVisible,' Range=',FRange,' FPosition=',FPosition,' FPage=',FPage,' FAutoRange=',FAutoRange,' ShouldVisible=',NewVisible,' IsVisible=',IsScrollBarVisible]);
|
||||
|
Loading…
Reference in New Issue
Block a user