feat(android): copy from the list, framed entries, one radius everywhere
The cross moves inside the search field, where it belonged. My first attempt failed with a TLabel, whose HitTest is false by default, and I concluded too quickly that no child of a TEdit can take a touch. A TRectangle takes it. Buttons drop the pill and take the fields' radius: a stadium beside a 14-radius field put two shape vocabularies on one line, and consistency is worth more here than fidelity to the reference. List entries get their own block, like the detail fields - on a gradient a bare line of text has no readable edge. And each row carries User and Pass buttons, so the commonest gesture no longer requires opening the entry. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,10 @@ const
|
||||
COL_MUTED = TAlphaColor($B3E8F0FA);
|
||||
COL_ON_ACC = TAlphaColor($FFFFFFFF); // le blanc reste lisible sur 30 %
|
||||
|
||||
/// Un seul arrondi pour tout ce qui se touche - champs comme boutons. Il
|
||||
/// doit suivre celui de make-style.ps1, qui l'applique aux champs natifs.
|
||||
RADIUS = 14;
|
||||
|
||||
/// A appeler une fois, avant la creation de la forme.
|
||||
procedure ApplyDarkTheme;
|
||||
|
||||
@@ -105,10 +109,6 @@ type
|
||||
procedure Up(Sender: TObject; Button: TMouseButton; Shift: TShiftState;
|
||||
X, Y: Single);
|
||||
procedure Leave(Sender: TObject);
|
||||
/// L'arrondi se recalcule a chaque changement de taille : la hauteur est
|
||||
/// posee APRES la creation, et un arrondi fixe superieur a la moitie de
|
||||
/// celle-ci transforme le bouton en ellipse.
|
||||
procedure Resized(Sender: TObject);
|
||||
end;
|
||||
|
||||
procedure TPressFeedback.Down(Sender: TObject; Button: TMouseButton;
|
||||
@@ -128,16 +128,6 @@ begin
|
||||
if Sender is TRectangle then TRectangle(Sender).Opacity := 1;
|
||||
end;
|
||||
|
||||
procedure TPressFeedback.Resized(Sender: TObject);
|
||||
var
|
||||
LR: TRectangle;
|
||||
begin
|
||||
if not (Sender is TRectangle) then Exit;
|
||||
LR := TRectangle(Sender);
|
||||
LR.XRadius := LR.Height / 2;
|
||||
LR.YRadius := LR.Height / 2;
|
||||
end;
|
||||
|
||||
function Surface(AParent: TFmxObject): TRectangle;
|
||||
begin
|
||||
Result := TRectangle.Create(AParent);
|
||||
@@ -178,9 +168,11 @@ var
|
||||
begin
|
||||
Result := TRectangle.Create(AParent);
|
||||
Result.Parent := AParent;
|
||||
// Pilule : l'arrondi vaut exactement la moitie de la hauteur, et se
|
||||
// recalcule quand elle change (voir TPressFeedback.Resized). Tout ce qui se
|
||||
// touche est arrondi ainsi dans la reference.
|
||||
// MEME ARRONDI QUE LES CHAMPS. Un bouton en pilule a cote d'un champ a 14
|
||||
// donnait deux vocabulaires de forme sur la meme ligne ; la coherence vaut
|
||||
// mieux que la fidelite a la reference sur ce point.
|
||||
Result.XRadius := RADIUS;
|
||||
Result.YRadius := RADIUS;
|
||||
Result.Cursor := crHandPoint;
|
||||
Result.Stroke.Kind := TBrushKind.None;
|
||||
// La difference entre principal et secondaire tient a l'opacite du blanc,
|
||||
@@ -208,8 +200,6 @@ begin
|
||||
Result.OnMouseDown := LFeedback.Down;
|
||||
Result.OnMouseUp := LFeedback.Up;
|
||||
Result.OnMouseLeave := LFeedback.Leave;
|
||||
Result.OnResize := LFeedback.Resized;
|
||||
LFeedback.Resized(Result);
|
||||
end;
|
||||
|
||||
procedure SetCornerRadius(AButton: TRectangle; AValue: Single);
|
||||
|
||||
Reference in New Issue
Block a user