diff --git a/mainApk.pas b/mainApk.pas index 322f8e7..20d6f93 100644 --- a/mainApk.pas +++ b/mainApk.pas @@ -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;