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:
@@ -30,13 +30,18 @@ foreach ($style in 'editstyle', 'memostyle') {
|
||||
$at = ($lines | Select-String -Pattern "StyleName = '$style'" | Select-Object -First 1).LineNumber
|
||||
if (-not $at) { Write-Warning "$style introuvable"; continue }
|
||||
|
||||
# Un champ de saisie prend la forme d'une pilule, comme la barre de
|
||||
# recherche d'Android ; un memo garde ses coins sobres.
|
||||
if ($style -eq 'editstyle') { $radius = '24.000000000000000000' }
|
||||
else { $radius = '10.000000000000000000' }
|
||||
|
||||
# La fenetre couvre le bloc 'background' qui suit immediatement le nom.
|
||||
for ($i = $at; $i -lt [Math]::Min($at + 24, $lines.Count); $i++) {
|
||||
switch -Regex ($lines[$i]) {
|
||||
'Fill\.Color = x' { $lines[$i] = $lines[$i] -replace 'x[0-9A-Fa-f]{8}', $surface; $patched++ }
|
||||
'Stroke\.Color = x' { $lines[$i] = $lines[$i] -replace 'x[0-9A-Fa-f]{8}', $border; $patched++ }
|
||||
'XRadius = ' { $lines[$i] = $lines[$i] -replace '[\d.]+$', '10.000000000000000000' }
|
||||
'YRadius = ' { $lines[$i] = $lines[$i] -replace '[\d.]+$', '10.000000000000000000' }
|
||||
'XRadius = ' { $lines[$i] = $lines[$i] -replace '[\d.]+$', $radius }
|
||||
'YRadius = ' { $lines[$i] = $lines[$i] -replace '[\d.]+$', $radius }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2080,8 +2080,8 @@
|
||||
Height = 22.000000000000000000
|
||||
HitTest = False
|
||||
Stroke.Color = xFF334155
|
||||
XRadius = 10.000000000000000000
|
||||
YRadius = 10.000000000000000000
|
||||
XRadius = 24.000000000000000000
|
||||
YRadius = 24.000000000000000000
|
||||
Width = 107.000000000000000000
|
||||
end
|
||||
object TBrushObject
|
||||
|
||||
+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