design: Make pinned events use less vertical space

This commit is contained in:
Krille Fear 2022-03-20 15:22:27 +01:00
parent 4954f9219d
commit e236cdf85f

View File

@ -67,28 +67,40 @@ class PinnedEvents extends StatelessWidget {
color: Theme.of(context).appBarTheme.backgroundColor, color: Theme.of(context).appBarTheme.backgroundColor,
elevation: Theme.of(context).appBarTheme.elevation ?? 10, elevation: Theme.of(context).appBarTheme.elevation ?? 10,
shadowColor: Theme.of(context).appBarTheme.shadowColor, shadowColor: Theme.of(context).appBarTheme.shadowColor,
child: ListTile( child: InkWell(
tileColor: Colors.transparent,
onTap: () => _displayPinnedEventsDialog( onTap: () => _displayPinnedEventsDialog(
context, context,
pinnedEvents, pinnedEvents,
), ),
leading: IconButton( child: Row(
icon: const Icon(Icons.close), children: [
IconButton(
splashRadius: 20,
iconSize: 20,
icon: const Icon(Icons.push_pin),
tooltip: L10n.of(context)!.unpin, tooltip: L10n.of(context)!.unpin,
onPressed: () => controller.unpinEvent(event.eventId), onPressed: controller.room
?.canSendEvent(EventTypes.RoomPinnedEvents) ??
false
? () => controller.unpinEvent(event.eventId)
: null,
), ),
title: LinkText( Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: LinkText(
text: event.getLocalizedBody( text: event.getLocalizedBody(
MatrixLocals(L10n.of(context)!), MatrixLocals(L10n.of(context)!),
withSenderNamePrefix: true, withSenderNamePrefix: true,
hideReply: true, hideReply: true,
), ),
maxLines: 3, maxLines: 2,
textStyle: TextStyle( textStyle: TextStyle(
overflow: TextOverflow.ellipsis,
fontSize: fontSize, fontSize: fontSize,
decoration: decoration: event.redacted
event.redacted ? TextDecoration.lineThrough : null, ? TextDecoration.lineThrough
: null,
), ),
linkStyle: TextStyle( linkStyle: TextStyle(
color: Theme.of(context) color: Theme.of(context)
@ -99,7 +111,12 @@ class PinnedEvents extends StatelessWidget {
fontSize: fontSize, fontSize: fontSize,
decoration: TextDecoration.underline, decoration: TextDecoration.underline,
), ),
onLinkTap: (url) => UrlLauncher(context, url).launchUrl(), onLinkTap: (url) =>
UrlLauncher(context, url).launchUrl(),
),
),
),
],
), ),
), ),
); );