mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 16:37:54 +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;
|
FTracking: Boolean;
|
||||||
FVisible: Boolean;
|
FVisible: Boolean;
|
||||||
FOldScrollInfo: TScrollInfo;
|
FOldScrollInfo: TScrollInfo;
|
||||||
|
FOldVisible: Boolean;
|
||||||
FOldScrollInfoValid: Boolean;
|
FOldScrollInfoValid: Boolean;
|
||||||
protected
|
protected
|
||||||
FControl: TWinControl;
|
FControl: TWinControl;
|
||||||
|
@ -230,14 +230,18 @@ begin
|
|||||||
if (not FOldScrollInfoValid) or (not CompareMem(@ScrollInfo, @FOldScrollInfo, SizeOf(TScrollInfo))) then
|
if (not FOldScrollInfoValid) or (not CompareMem(@ScrollInfo, @FOldScrollInfo, SizeOf(TScrollInfo))) then
|
||||||
begin
|
begin
|
||||||
FOldScrollInfo := ScrollInfo;
|
FOldScrollInfo := ScrollInfo;
|
||||||
FOldScrollInfoValid := True;
|
|
||||||
SetScrollInfo(ControlHandle, IntfBarKind[Kind], ScrollInfo, NewVisible);
|
SetScrollInfo(ControlHandle, IntfBarKind[Kind], ScrollInfo, NewVisible);
|
||||||
// update policy too
|
// update policy too
|
||||||
ScrollInfo.fMask := SIF_UPDATEPOLICY;
|
ScrollInfo.fMask := SIF_UPDATEPOLICY;
|
||||||
ScrollInfo.nTrackPos := TrackToPolicyMap[FTracking];
|
ScrollInfo.nTrackPos := TrackToPolicyMap[FTracking];
|
||||||
SetScrollInfo(ControlHandle, IntfBarKind[Kind], ScrollInfo, NewVisible);
|
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}
|
{$IFDEF VerboseScrollingWinControl}
|
||||||
//if DebugCondition then
|
//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]);
|
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