mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-09 17:18:13 +02:00
Gtk3: use cached lcl value for page_size
This commit is contained in:
parent
83ef9dce86
commit
357feec170
@ -5806,20 +5806,27 @@ var
|
|||||||
Msg: TLMVScroll;
|
Msg: TLMVScroll;
|
||||||
MaxValue: gdouble;
|
MaxValue: gdouble;
|
||||||
StateFlags: TGtkStateFlags;
|
StateFlags: TGtkStateFlags;
|
||||||
|
ACtl: TGtk3ScrollableWin;
|
||||||
begin
|
begin
|
||||||
Result := gtk_false;
|
Result := gtk_false;
|
||||||
|
|
||||||
{$IFDEF GTK3DEBUGSCROLL}
|
{$IFDEF GTK3DEBUGSCROLL}
|
||||||
DebugLn(Format('>TGtk3ScrollableWin.RangeChangeValue Value: %d', [Round(AValue)]),' IsHScrollBar ',dbgs(PGtkOrientable(ARange)^.get_orientation = GTK_ORIENTATION_HORIZONTAL),' InUpdate=',dbgs(TGtk3Widget(AData).InUpdate));
|
DebugLn(Format('>TGtk3ScrollableWin.RangeChangeValue Value: %d', [Round(AValue)]),' IsHScrollBar ',dbgs(PGtkOrientable(ARange)^.get_orientation = GTK_ORIENTATION_HORIZONTAL),' InUpdate=',dbgs(TGtk3Widget(AData).InUpdate));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
ACtl := TGtk3ScrollableWin(aData);
|
||||||
if PGtkOrientable(ARange)^.get_orientation = GTK_ORIENTATION_HORIZONTAL then
|
if PGtkOrientable(ARange)^.get_orientation = GTK_ORIENTATION_HORIZONTAL then
|
||||||
Msg.Msg := LM_HSCROLL
|
Msg.Msg := LM_HSCROLL
|
||||||
else
|
else
|
||||||
Msg.Msg := LM_VSCROLL;
|
Msg.Msg := LM_VSCROLL;
|
||||||
|
|
||||||
if ARange^.adjustment^.page_size > 0 then
|
if ARange^.adjustment^.page_size > 0 then
|
||||||
MaxValue := ARange^.adjustment^.upper - ARange^.adjustment^.page_size
|
begin
|
||||||
|
{we must use cached values since gtk3 has it's own meaning about page_size}
|
||||||
|
if Msg.Msg = LM_HSCROLL then
|
||||||
|
MaxValue := ACtl.LCLHAdj^.upper - ACtl.LCLHAdj^.page_size
|
||||||
else
|
else
|
||||||
|
MaxValue := ACtl.LCLVAdj^.upper - ACtl.LCLVAdj^.page_size;
|
||||||
|
end else
|
||||||
MaxValue := ARange^.adjustment^.upper;
|
MaxValue := ARange^.adjustment^.upper;
|
||||||
|
|
||||||
if (AValue > MaxValue) then
|
if (AValue > MaxValue) then
|
||||||
|
Loading…
Reference in New Issue
Block a user