Keep model and mode text off the action bar pill ends
Run 299 removed the model and mode buttons' horizontal padding on desktop so the island's gap sets the spacing, which left their text touching the pill's rounded ends. The island now insets its content by 12 px.
This commit is contained in:
@@ -155,14 +155,19 @@ class _ControlIsland extends StatelessWidget {
|
||||
final List<Widget> children;
|
||||
final double gap;
|
||||
|
||||
// With a gap (desktop) the buttons carry no horizontal padding of their
|
||||
// own, so the island keeps the text off its pill's rounded ends.
|
||||
@override
|
||||
Widget build(BuildContext context) => Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
for (final (index, child) in children.indexed) ...[
|
||||
if (index > 0) SizedBox(width: gap),
|
||||
Flexible(child: child),
|
||||
Widget build(BuildContext context) => Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: gap * 1.5),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
for (final (index, child) in children.indexed) ...[
|
||||
if (index > 0) SizedBox(width: gap),
|
||||
Flexible(child: child),
|
||||
],
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,20 @@ void main() {
|
||||
tester.getTopRight(find.byKey(Key(left))).dx;
|
||||
|
||||
expect(gap('header-control-1', 'header-control-2'), 8);
|
||||
expect(gap('header-control-2', 'header-action-1'), 8);
|
||||
// The model/mode island keeps its text 12 px off its pill's ends.
|
||||
final island = tester.getRect(
|
||||
find.byKey(const Key('chat-model-permission-island')),
|
||||
);
|
||||
expect(
|
||||
tester.getTopLeft(find.byKey(const Key('header-control-1'))).dx -
|
||||
island.left,
|
||||
12,
|
||||
);
|
||||
expect(
|
||||
island.right -
|
||||
tester.getTopRight(find.byKey(const Key('header-control-2'))).dx,
|
||||
12,
|
||||
);
|
||||
expect(gap('header-action-1', 'header-action-2'), 8);
|
||||
expect(
|
||||
tester.getTopLeft(find.byKey(segmentedMoreKey).first).dx -
|
||||
|
||||
Reference in New Issue
Block a user