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

@ -17,6 +17,7 @@ class ClassDescriptionButton extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final iconColor = Theme.of(context).textTheme.bodyLarge!.color; final iconColor = Theme.of(context).textTheme.bodyLarge!.color;
final ScrollController scrollController = ScrollController();
return Column( return Column(
children: [ children: [
ListTile( ListTile(
@ -26,7 +27,17 @@ class ClassDescriptionButton extends StatelessWidget {
foregroundColor: iconColor, foregroundColor: iconColor,
child: const Icon(Icons.topic_outlined), 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.topic.isEmpty
? (room.isRoomAdmin ? (room.isRoomAdmin
? (room.isSpace ? (room.isSpace
@ -35,6 +46,9 @@ class ClassDescriptionButton extends StatelessWidget {
: L10n.of(context)!.topicNotSet) : L10n.of(context)!.topicNotSet)
: room.topic, : room.topic,
), ),
),
),
),
title: Text( title: Text(
room.isSpace room.isSpace
? L10n.of(context)!.classDescription ? L10n.of(context)!.classDescription

Loading…
Cancel
Save