mirror of https://gitlab.com/basile.b/dexed.git
fix #11 - terminal scrollbar lacks of accuracy
This commit is contained in:
parent
a4a9a50a09
commit
580f8b2e1e
|
@ -18,7 +18,7 @@ uses
|
|||
type
|
||||
|
||||
TTerminalScrollInfo = record
|
||||
min, max, value: integer;
|
||||
min, max, value, pageSize: integer;
|
||||
end;
|
||||
|
||||
TTerminalTextScrolled = procedure(sender: TObject; delta: integer) of Object;
|
||||
|
@ -634,16 +634,18 @@ end;
|
|||
function TTerminal.getVScrollInfo: TTerminalScrollInfo;
|
||||
{$ifdef hasgtk2term}
|
||||
var
|
||||
a: PGtkAdjustment = nil;
|
||||
a: PGtkAdjustment;
|
||||
{$endif}
|
||||
begin
|
||||
FillChar(result, sizeOf(result), 0);
|
||||
{$ifdef hasgtk2term}
|
||||
if assigned(fTerminalHanlde) then
|
||||
begin
|
||||
a := vte_terminal_get_adjustment(fTerminalHanlde);
|
||||
result.max := round(a^.upper);
|
||||
result.min := round(a^.lower);
|
||||
result.value := round(a^.value);
|
||||
a := vte_terminal_get_adjustment(fTerminalHanlde);
|
||||
result.max := round(a^.upper);
|
||||
result.min := round(a^.lower);
|
||||
result.value := round(a^.value);
|
||||
result.pageSize := round(a^.page_size);
|
||||
end;
|
||||
{$endif}
|
||||
end;
|
||||
|
|
|
@ -329,9 +329,10 @@ var
|
|||
begin
|
||||
if fDisableScrollBarSync or not visible or fTerm.isNil then
|
||||
exit;
|
||||
i := fTerm.getVScrollInfo();
|
||||
ScrollBar1.Max := i.max;
|
||||
i := fTerm.getVScrollInfo();
|
||||
ScrollBar1.Max := i.max;
|
||||
ScrollBar1.Position := i.value;
|
||||
ScrollBar1.PageSize := i.pageSize;
|
||||
end;
|
||||
|
||||
procedure TTermWidget.FormShortCut(var Msg: TLMKey; var Handled: Boolean);
|
||||
|
|
Loading…
Reference in New Issue