From 65e6ba6a54c5186032f0e930a572cc462f99fc6a Mon Sep 17 00:00:00 2001 From: r-zakarya <82443831+r-zakarya@users.noreply.github.com> Date: Sat, 15 Aug 2026 16:04:01 +0100 Subject: [PATCH] fix(android): draw the search hint ourselves, TextPrompt needs a style object Dark.style has no object for the prompt text, so the search field sat there empty and mute. A label inside the field, hit-test off so the tap goes through, shown only while the field is empty. Fourth time today the same conclusion: whatever FMX renders through a style template may or may not exist in the style actually loaded. Built explicitly, it is there. Also noted: the row height was never wrong. 56 logical units on a 3x display are the ~166 device pixels the screenshot showed - only the second line was missing. Co-Authored-By: Claude Opus 5 --- mainApk.pas | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mainApk.pas b/mainApk.pas index 18a4a76..26242a3 100644 --- a/mainApk.pas +++ b/mainApk.pas @@ -98,6 +98,7 @@ type // --- ecran 2 : liste FLayList: TLayout; FSearch: TEdit; + FSearchHint: TLabel; FFolderBox: TComboBox; FList: TListBox; FCount: TLabel; @@ -398,8 +399,19 @@ begin FSearch := TEdit.Create(Self); FSearch.Parent := LTop; FSearch.Align := TAlignLayout.Client; - FSearch.TextPrompt := 'Rechercher'; FSearch.OnChangeTracking := OnSearchChanged; + + // Invite dessinee par nous, pas par TextPrompt : Dark.style ne comporte pas + // l'objet que le style est cense fournir pour l'afficher, et le champ + // restait donc vide et muet. HitTest desactive pour que le clic traverse + // jusqu'au champ. + FSearchHint := TLabel.Create(FSearch); + FSearchHint.Parent := FSearch; + FSearchHint.Align := TAlignLayout.Client; + FSearchHint.Margins.Left := 10; + FSearchHint.HitTest := False; + FSearchHint.Opacity := 0.45; + FSearchHint.Text := 'Rechercher'; end; /// Intitule discret au-dessus d'une valeur. Meme forme pour toutes les @@ -1163,6 +1175,7 @@ begin // quelques centaines d'entrees c'est imperceptible ; passer a un modele // virtuel (TListView) le jour ou ca rame. Touch; + FSearchHint.Visible := FSearch.Text = ''; LFolder := ''; if FFolderBox.ItemIndex > 0 then // 0 = tous les dossiers LFolder := FFolderBox.Items[FFolderBox.ItemIndex];