From 3fa4c5e2cd16e3568c8272f5814d94fb0ad58fde Mon Sep 17 00:00:00 2001 From: olorin99 Date: Thu, 28 May 2026 14:35:36 +1000 Subject: [PATCH] Make markdown editor tabs and content reply buttons horizonally scrollable to better fit narrow screens. --- .../widgets/content_item/content_reply.dart | 98 ++++++++++--------- lib/src/widgets/markdown/markdown_editor.dart | 2 + 2 files changed, 52 insertions(+), 48 deletions(-) diff --git a/lib/src/widgets/content_item/content_reply.dart b/lib/src/widgets/content_item/content_reply.dart index c056de61..01ce1931 100644 --- a/lib/src/widgets/content_item/content_reply.dart +++ b/lib/src/widgets/content_item/content_reply.dart @@ -78,56 +78,58 @@ class _ContentReplyState extends State { ), ), const SizedBox(height: 10), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - if (context.read().serverSoftware == - ServerSoftware.mbin) - ImageSelector( - _imageFile, - (file, altText) => setState(() { - _imageFile = file; - _altText = altText; - }), - inline: true, - ), - IconButton( - onPressed: () async { - final newLang = await languageSelectionMenu( - context, - ).askSelection(context, _replyLanguage); + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + spacing: 8, + children: [ + if (context.read().serverSoftware == + ServerSoftware.mbin) + ImageSelector( + _imageFile, + (file, altText) => setState(() { + _imageFile = file; + _altText = altText; + }), + inline: true, + ), + IconButton( + onPressed: () async { + final newLang = await languageSelectionMenu( + context, + ).askSelection(context, _replyLanguage); - if (newLang != null) { - setState(() { - _replyLanguage = newLang; - }); - } - }, - icon: const Icon(Symbols.globe_rounded), - tooltip: getLanguageName(context, _replyLanguage), - ), - const SizedBox(width: 8), - OutlinedButton( - onPressed: widget.onComplete, - child: Text(l(context).cancel), - ), - const SizedBox(width: 8), - LoadingFilledButton( - onPressed: () async { - await widget.onReply( - _textController.text, - _replyLanguage, - image: _imageFile, - alt: _altText, - ); + if (newLang != null) { + setState(() { + _replyLanguage = newLang; + }); + } + }, + icon: const Icon(Symbols.globe_rounded), + tooltip: getLanguageName(context, _replyLanguage), + ), + OutlinedButton( + onPressed: widget.onComplete, + child: Text(l(context).cancel), + ), + LoadingFilledButton( + onPressed: () async { + await widget.onReply( + _textController.text, + _replyLanguage, + image: _imageFile, + alt: _altText, + ); - await replyDraftController.discard(); - widget.onComplete(); - }, - label: Text(l(context).submit), - uesHaptics: true, - ), - ], + await replyDraftController.discard(); + widget.onComplete(); + }, + label: Text(l(context).submit), + uesHaptics: true, + ), + ], + ), ), ], ), diff --git a/lib/src/widgets/markdown/markdown_editor.dart b/lib/src/widgets/markdown/markdown_editor.dart index 51ff5d11..0b4ce218 100644 --- a/lib/src/widgets/markdown/markdown_editor.dart +++ b/lib/src/widgets/markdown/markdown_editor.dart @@ -107,6 +107,8 @@ class _MarkdownEditorState extends State { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ TabBar( + isScrollable: true, + tabAlignment: TabAlignment.center, tabs: [ Tab( child: Row(