Merge pull request #202 from krawieck/small-fixes

This commit is contained in:
Filip Krawczyk 2021-04-06 18:54:30 +02:00 committed by GitHub
commit 9d90aa9aeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 39 additions and 13 deletions

View File

@ -2,6 +2,12 @@
### Changed ### Changed
- Disable commenting on locked posts
### Fixed
- When writing a comment the parent text is now selectable
- Text of a post is now selectable
- Account actions in settings are more obvious to access: long press an account/instance to see possible actions such as setting as default or removal - Account actions in settings are more obvious to access: long press an account/instance to see possible actions such as setting as default or removal
## v0.4.1 - 2021-04-06 ## v0.4.1 - 2021-04-06

View File

@ -94,9 +94,16 @@ class MyHomePage extends HookWidget {
return Scaffold( return Scaffold(
extendBody: true, extendBody: true,
body: IndexedStack( body: Column(
index: currentTab.value, children: [
children: pages, Expanded(
child: IndexedStack(
index: currentTab.value,
children: pages,
),
),
const SizedBox(height: kMinInteractiveDimension / 2),
],
), ),
floatingActionButton: const CreatePostFab(), floatingActionButton: const CreatePostFab(),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,

View File

@ -115,9 +115,12 @@ class FullPostPage extends HookWidget {
onPressed: () => PostWidget.showMoreMenu(context, post)), onPressed: () => PostWidget.showMoreMenu(context, post)),
], ],
), ),
floatingActionButton: FloatingActionButton( floatingActionButton: post.post.locked
onPressed: loggedInAction((_) => comment()), ? null
child: const Icon(Icons.comment)), : FloatingActionButton(
onPressed: loggedInAction((_) => comment()),
child: const Icon(Icons.comment),
),
body: RefreshIndicator( body: RefreshIndicator(
onRefresh: refresh, onRefresh: refresh,
child: ListView( child: ListView(

View File

@ -39,7 +39,7 @@ class ManageAccountPage extends HookWidget {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text('@$instanceHost@$username'), title: Text('$username@$instanceHost'),
), ),
body: FutureBuilder<LocalUserSettingsView>( body: FutureBuilder<LocalUserSettingsView>(
future: userFuture, future: userFuture,

View File

@ -297,7 +297,9 @@ class CommentWidget extends HookWidget {
tooltip: L10n.of(context).more, tooltip: L10n.of(context).more,
), ),
_SaveComment(commentTree.comment), _SaveComment(commentTree.comment),
if (!isDeleted.value && !comment.comment.removed) if (!isDeleted.value &&
!comment.comment.removed &&
!comment.post.locked)
TileAction( TileAction(
icon: Icons.reply, icon: Icons.reply,
onPressed: loggedInAction((_) => reply()), onPressed: loggedInAction((_) => reply()),

View File

@ -415,9 +415,13 @@ class PostWidget extends HookWidget {
linkPreview(), linkPreview(),
if (post.post.body != null && fullPost) if (post.post.body != null && fullPost)
Padding( Padding(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: MarkdownText(post.post.body, child: MarkdownText(
instanceHost: instanceHost)), post.post.body,
instanceHost: instanceHost,
selectable: true,
),
),
if (post.post.body != null && !fullPost) if (post.post.body != null && !fullPost)
LayoutBuilder( LayoutBuilder(
builder: (context, constraints) { builder: (context, constraints) {

View File

@ -31,13 +31,17 @@ class WriteComment extends HookWidget {
final body = () { final body = () {
final text = comment?.content ?? post.body; final text = comment?.content ?? post.body;
if (text == null) return const SizedBox.shrink(); if (text == null) return const SizedBox.shrink();
return MarkdownText(text, instanceHost: post.instanceHost); return MarkdownText(
text,
instanceHost: post.instanceHost,
selectable: true,
);
}(); }();
if (post != null) { if (post != null) {
return Column( return Column(
children: [ children: [
Text( SelectableText(
post.name, post.name,
style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w600), style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w600),
), ),