Changeset 612


Ignore:
Timestamp:
Sep 13, 2024, 8:37:17 PM (6 days ago)
Author:
chronos
Message:
  • Fixed: Scrollbars behave differently on Linux and Windows. Use conditional code to make it work correctly.
Location:
trunk/LocalPlayer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/PVSB.pas

    r611 r612  
    5555  Self.Max := Max;
    5656  ScrollBar.Position := 0;
     57  {$IFDEF UNIX}
    5758  ScrollBar.Visible := Max > ScrollBar.PageSize;
     59  {$ELSE}
     60  ScrollBar.Visible := Max >= ScrollBar.PageSize;
     61  {$ENDIF}
    5862end;
    5963
  • trunk/LocalPlayer/Term.pas

    r611 r612  
    68626862  trixFocus, uix, uixDefender: Integer;
    68636863  Prio: Boolean;
     6864  RowsCount: Integer;
    68646865begin
    68656866  TroopLoc := Loc;
     
    68896890  else
    68906891  begin
    6891     VerticalScrollBar.Init(Ceil(TrCnt / TrRow), 1);
     6892    {$IFDEF UNIX}
     6893    RowsCount := Ceil(TrCnt / TrRow);
     6894    {$ELSE}
     6895    RowsCount := (TrCnt + TrRow - 1) div TrRow - 1;
     6896    {$ENDIF}
     6897    VerticalScrollBar.Init(RowsCount, 1);
    68926898    if (VerticalScrollBar.Max >= VerticalScrollBar.PageSize) and (trixFocus >= 0) then
    68936899      VerticalScrollBar.Position := trixFocus div TrRow;
Note: See TracChangeset for help on using the changeset viewer.