mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 19:50:28 +02:00
LCL, Grids: fix thumbtracking focusrect issues when scrolling, issue #35812
(cherry picked from commit a4db7e4e62
)
This commit is contained in:
parent
8a1d2d8a2f
commit
f3bd9119d6
@ -3225,13 +3225,22 @@ begin
|
||||
end;
|
||||
|
||||
procedure TCustomDBGrid.DrawFocusRect(aCol, aRow: Integer; ARect: TRect);
|
||||
var
|
||||
DrawBits: Byte;
|
||||
begin
|
||||
// Draw focused cell if we have the focus
|
||||
if Self.Focused and (dgAlwaysShowSelection in Options) and
|
||||
FDatalink.Active and DefaultDrawing then
|
||||
begin
|
||||
DrawBits := BF_RECT;
|
||||
if (dgRowSelect in Options) then begin
|
||||
if (LeftCol>FixedCols) or (GCache.TLColOff<>0) then
|
||||
DrawBits := DrawBits and not BF_LEFT;
|
||||
if (GCache.VisibleGrid.Right<ColCount-1) then
|
||||
DrawBits := DrawBits and not BF_RIGHT;
|
||||
end;
|
||||
CalcFocusRect(aRect);
|
||||
DrawRubberRect(Canvas, aRect, FocusColor);
|
||||
DrawRubberRect(Canvas, aRect, FocusColor, DrawBits);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -10750,8 +10750,12 @@ begin
|
||||
Canvas.Pen.Mode := pmXOR;
|
||||
end;
|
||||
DrawBits := BF_RECT;
|
||||
if (goRowSelect in Options) and ((fTopLeft.x<>FixedCols) or (FGCache.TLColOff<>0)) then
|
||||
DrawBits := DrawBits and not BF_LEFT;
|
||||
if (goRowSelect in Options) then begin
|
||||
if ((fTopLeft.x>FixedCols) or (FGCache.TLColOff<>0)) then
|
||||
DrawBits := DrawBits and not BF_LEFT;
|
||||
if (FGCache.VisibleGrid.Right<ColCount-1) then
|
||||
DrawBits := DrawBits and not BF_RIGHT;
|
||||
end;
|
||||
DrawRubberRect(Canvas, aRect, FFocusColor, DrawBits);
|
||||
if FUseXORFeatures then begin
|
||||
Canvas.Pen.Mode := OldPenMode;
|
||||
|
Loading…
Reference in New Issue
Block a user