Merge pull request #388 from pangeachat/limit-topic-height

Limit topic height
pull/1384/head
ggurdin 1 year ago committed by GitHub
commit 0eb8762cd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -102,6 +102,13 @@ class ChatDetailsView extends StatelessWidget {
backgroundColor: Theme.of(context).appBarTheme.backgroundColor,
),
body: MaxWidthBody(
// #Pangea
// Chat description title has its own scrollbar so we disable the parent one
// otherwise they scroll with each other
child: ScrollConfiguration(
behavior:
ScrollConfiguration.of(context).copyWith(scrollbars: false),
// Pangea#
child: ListView.builder(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
@ -133,8 +140,8 @@ class ChatDetailsView extends StatelessWidget {
),
),
child: Hero(
tag: controller
.widget.embeddedCloseButton !=
tag: controller.widget
.embeddedCloseButton !=
null
? 'embedded_content_banner'
: 'content_banner',
@ -174,7 +181,8 @@ class ChatDetailsView extends StatelessWidget {
: room.canChangeStateEvent(
EventTypes.RoomName,
)
? controller.setDisplaynameAction()
? controller
.setDisplaynameAction()
: FluffyShare.share(
displayname,
context,
@ -260,7 +268,8 @@ class ChatDetailsView extends StatelessWidget {
title: Text(
L10n.of(context)!.spaceAnalytics,
style: TextStyle(
color: Theme.of(context).colorScheme.secondary,
color:
Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),
@ -390,7 +399,8 @@ class ChatDetailsView extends StatelessWidget {
title: Text(
L10n.of(context)!.editChatPermissions,
style: TextStyle(
color: Theme.of(context).colorScheme.secondary,
color:
Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),
@ -409,8 +419,9 @@ class ChatDetailsView extends StatelessWidget {
// #Pangea
// trailing: const Icon(Icons.chevron_right_outlined),
// Pangea#
onTap: () => context
.push('/rooms/${room.id}/details/permissions'),
onTap: () => context.push(
'/rooms/${room.id}/details/permissions',
),
),
Divider(
height: 1,
@ -426,20 +437,24 @@ class ChatDetailsView extends StatelessWidget {
? L10n.of(context)!.inviteUsersFromPangea
: L10n.of(context)!.inviteStudentByUserName,
style: TextStyle(
color: Theme.of(context).colorScheme.secondary,
color:
Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),
leading: CircleAvatar(
backgroundColor:
Theme.of(context).scaffoldBackgroundColor,
foregroundColor:
Theme.of(context).textTheme.bodyLarge!.color,
foregroundColor: Theme.of(context)
.textTheme
.bodyLarge!
.color,
child: const Icon(
Icons.add,
),
),
onTap: () => context.go('/rooms/${room.id}/invite'),
onTap: () =>
context.go('/rooms/${room.id}/invite'),
),
if (room.showClassEditOptions && room.isSpace)
SpaceDetailsToggleAddStudentsTile(
@ -593,7 +608,8 @@ class ChatDetailsView extends StatelessWidget {
? L10n.of(context)!.lockSpace
: L10n.of(context)!.lockChat,
style: TextStyle(
color: Theme.of(context).colorScheme.secondary,
color:
Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),
@ -659,7 +675,8 @@ class ChatDetailsView extends StatelessWidget {
: ListTile(
title: Text(
L10n.of(context)!.loadCountMoreParticipants(
(actualMembersCount - members.length).toString(),
(actualMembersCount - members.length)
.toString(),
),
),
leading: CircleAvatar(
@ -677,6 +694,7 @@ class ChatDetailsView extends StatelessWidget {
),
),
),
),
);
},
);

@ -17,6 +17,7 @@ class ClassDescriptionButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
final iconColor = Theme.of(context).textTheme.bodyLarge!.color;
final ScrollController scrollController = ScrollController();
return Column(
children: [
ListTile(
@ -26,7 +27,17 @@ class ClassDescriptionButton extends StatelessWidget {
foregroundColor: iconColor,
child: const Icon(Icons.topic_outlined),
),
subtitle: Text(
subtitle: ConstrainedBox(
constraints: const BoxConstraints(
maxHeight: 190,
),
child: Scrollbar(
controller: scrollController,
interactive: true,
child: SingleChildScrollView(
controller: scrollController,
primary: false,
child: Text(
room.topic.isEmpty
? (room.isRoomAdmin
? (room.isSpace
@ -35,6 +46,9 @@ class ClassDescriptionButton extends StatelessWidget {
: L10n.of(context)!.topicNotSet)
: room.topic,
),
),
),
),
title: Text(
room.isSpace
? L10n.of(context)!.classDescription

Loading…
Cancel
Save