fix(android): the detail rows were upside down

Inside a TVertScrollBox, Align=Top children stack in creation order - the opposite of a TLayout, where the last created ends up on top. The convention that is right for the unlock screen produced an inverted form here, with the 2FA code relegated to the bottom when it is the reason you pull the phone out.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-08-15 15:09:08 +01:00
parent 7229028060
commit 4c6376edbf
+21 -17
View File
@@ -602,9 +602,24 @@ begin
SetLength(FRowShown, Length(FRows));
SetLength(FRowCtls, Length(FRows));
// A REBOURS : des controles alignes en haut s'empilent dans l'ordre inverse
// de leur creation, donc la derniere ligne se cree en premier.
for I := High(FRows) downto 0 do
// Le TOTP EN PREMIER, donc en tete d'ecran : c'est ce qu'on vient chercher
// sur un telephone. Seule ligne vivante, rafraichie chaque seconde.
if FCurrent.Totp <> '' then
begin
LRow := MakeRow(FDetBody, 'Code 2FA', FTotpValue);
SetLength(FRowCtls, Length(FRowCtls) + 1);
FRowCtls[High(FRowCtls)] := LRow;
FTotpValue.TextSettings.Font.Size := 26;
AddRowButton(LRow, 'Copier', -1, OnCopyTap);
OnTotpTick(nil); // pas d'attente d'une seconde a l'ouverture
FTotpTimer.Enabled := True;
end;
// DANS L'ORDRE, ici : au sein d'un TVertScrollBox les enfants alignes en
// haut s'empilent dans l'ordre de creation - l'inverse d'un TLayout, ou le
// dernier cree se retrouve en tete. Se tromper de convention renvoie le
// formulaire a l'envers, sans rien casser d'autre.
for I := 0 to High(FRows) do
begin
LRow := MakeRow(FDetBody, FRows[I].Caption, LValue);
FRowCtls[I] := LRow;
@@ -621,22 +636,11 @@ begin
end;
// La derniere ligne affichee touche sinon le bord du defilement, ce qui la
// fait passer pour tronquee alors qu'elle est juste collee.
if Length(FRowCtls) > 0 then
// La derniere ligne affichee touche sinon le bord du defilement, ce qui la
// fait passer pour tronquee alors qu'elle est juste collee.
if Length(FRows) > 0 then
FRowCtls[High(FRows)].Margins.Bottom := 12;
// Le TOTP est la seule ligne vivante : creee en dernier, donc affichee en
// tete, parce que c'est ce qu'on vient chercher sur un telephone.
if FCurrent.Totp <> '' then
begin
LRow := MakeRow(FDetBody, 'Code 2FA', FTotpValue);
SetLength(FRowCtls, Length(FRowCtls) + 1);
FRowCtls[High(FRowCtls)] := LRow;
FTotpValue.TextSettings.Font.Size := 26;
AddRowButton(LRow, 'Copier', -1, OnCopyTap);
OnTotpTick(nil); // pas d'attente d'une seconde a l'ouverture
FTotpTimer.Enabled := True;
end;
FLayList.Visible := False;
FLayDetail.Visible := True;
end;