~emersion/goguma-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH] page/buffer: Make whole AppBar title area clickable

Details
Message ID
<20220505090442.18839-1-delthas@dille.cc>
DKIM signature
pass
Download raw message
Patch: +17 -11
To achieve this we need to make the AppBar title child take all the
available space.

The width constraint AppBar gives to its title child is a max size based
on the available space in its row. We can simply use an Align to fill
that space.

For some reason the height constrint AppBar gives to its title child is
infinite (unbounded) but eventually cropped to its height. So we can't
use Align. Here we simply use a SizedBox to fill the available height
with the toolbar height, which we get from the theme.
---
 lib/page/buffer.dart | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/lib/page/buffer.dart b/lib/page/buffer.dart
index f82f15c..d4c7580 100644
--- a/lib/page/buffer.dart
+++ b/lib/page/buffer.dart
@@ -467,18 +467,24 @@ class BufferPageState extends State<BufferPage> with WidgetsBindingObserver {

		return Scaffold(
			appBar: AppBar(
				title: InkResponse(
					child: Column(
						mainAxisAlignment: MainAxisAlignment.center,
						crossAxisAlignment: CrossAxisAlignment.start,
						children: [
							Text(buffer.name, overflow: TextOverflow.fade),
							if (subtitle != null) Text(
								stripAnsiFormatting(subtitle),
								style: TextStyle(fontSize: 12.0),
								overflow: TextOverflow.fade,
				title: InkWell(
					child: Align(
						alignment: Alignment.centerLeft,
						child: SizedBox(
							height: AppBarTheme.of(context).toolbarHeight ?? kToolbarHeight,
							child: Column(
								mainAxisAlignment: MainAxisAlignment.center,
								crossAxisAlignment: CrossAxisAlignment.start,
								children: [
									Text(buffer.name, overflow: TextOverflow.fade),
									if (subtitle != null) Text(
										stripAnsiFormatting(subtitle),
										style: TextStyle(fontSize: 12.0),
										overflow: TextOverflow.fade,
									),
								],
							),
						],
						),
					),
					onTap: () {
						Navigator.pushNamed(context, BufferDetailsPage.routeName, arguments: buffer);

base-commit: 4aed5bb5be5eb64a47ecf668b09edff810dd2386
-- 
2.17.1
Reply to thread Export thread (mbox)