~emersion/goguma-dev

page/buffer: Make whole AppBar title area clickable v1 PROPOSED

delthas: 1
 page/buffer: Make whole AppBar title area clickable

 1 files changed, 17 insertions(+), 11 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/goguma-dev/patches/31959/mbox | git am -3
Learn more about email & git

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

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