feat(android): the search field takes the shape Android uses for search
I had followed the desktop capture - a squared field with slightly rounded corners - without thinking of the search bar the phone itself uses. On a phone that pill is the reference, and the app should look like where it runs. Edits become pills; the memo keeps its sober corners. A magnifier is drawn inside the field, as a circle and a handle rather than a glyph, since no font is guaranteed across devices. Drawing inside a TEdit works - it is only the clickable that does not, which is why the clear cross stays beside it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+26
-1
@@ -387,6 +387,8 @@ var
|
||||
LBar, LTop, LSearchWrap: TLayout;
|
||||
LBtnLock: TRectangle;
|
||||
LClearMark: TLabel;
|
||||
LGlass: TCircle;
|
||||
LHandle: TLine;
|
||||
begin
|
||||
FLayList := TLayout.Create(Self);
|
||||
FLayList.Parent := Self;
|
||||
@@ -471,16 +473,39 @@ begin
|
||||
FSearch := TEdit.Create(Self);
|
||||
FSearch.Parent := LSearchWrap;
|
||||
FSearch.Align := TAlignLayout.Client;
|
||||
// Le texte saisi commence apres la loupe.
|
||||
FSearch.Padding.Left := 32;
|
||||
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.
|
||||
// Loupe DESSINEE dans le champ. Un enfant qui ne fait que se peindre y est
|
||||
// accepte - c'est le cliquable qui ne l'est pas. Un cercle et un manche
|
||||
// plutot qu'un glyphe : aucune police n'est garantie sur tous les appareils.
|
||||
LGlass := TCircle.Create(FSearch);
|
||||
LGlass.Parent := FSearch;
|
||||
LGlass.Align := TAlignLayout.None;
|
||||
LGlass.SetBounds(16, 15, 15, 15);
|
||||
LGlass.Fill.Kind := TBrushKind.None;
|
||||
LGlass.Stroke.Color := COL_MUTED;
|
||||
LGlass.Stroke.Thickness := 2;
|
||||
LGlass.HitTest := False;
|
||||
|
||||
LHandle := TLine.Create(FSearch);
|
||||
LHandle.Parent := FSearch;
|
||||
LHandle.Align := TAlignLayout.None;
|
||||
LHandle.SetBounds(29, 28, 6, 6);
|
||||
LHandle.LineType := TLineType.Diagonal;
|
||||
LHandle.Stroke.Color := COL_MUTED;
|
||||
LHandle.Stroke.Thickness := 2;
|
||||
LHandle.HitTest := False;
|
||||
|
||||
FSearchHint := TLabel.Create(FSearch);
|
||||
FSearchHint.Parent := FSearch;
|
||||
FSearchHint.Align := TAlignLayout.Client;
|
||||
FSearchHint.Margins.Left := 10;
|
||||
FSearchHint.Margins.Left := 42; // degage la loupe
|
||||
FSearchHint.HitTest := False;
|
||||
FSearchHint.Opacity := 0.45;
|
||||
FSearchHint.Text := 'Search';
|
||||
|
||||
Reference in New Issue
Block a user