Merge branch 'krille/better-pinned' into 'main'

design: Make pinned events use less vertical space

See merge request famedly/fluffychat!781
This commit is contained in:
Krille Fear 2022-03-20 14:42:44 +00:00
commit b22dbed734

View File

@ -67,39 +67,56 @@ 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: [
tooltip: L10n.of(context)!.unpin, IconButton(
onPressed: () => controller.unpinEvent(event.eventId), splashRadius: 20,
), iconSize: 20,
title: LinkText( icon: const Icon(Icons.push_pin),
text: event.getLocalizedBody( tooltip: L10n.of(context)!.unpin,
MatrixLocals(L10n.of(context)!), onPressed: controller.room
withSenderNamePrefix: true, ?.canSendEvent(EventTypes.RoomPinnedEvents) ??
hideReply: true, false
), ? () => controller.unpinEvent(event.eventId)
maxLines: 3, : null,
textStyle: TextStyle( ),
fontSize: fontSize, Expanded(
decoration: child: Padding(
event.redacted ? TextDecoration.lineThrough : null, padding: const EdgeInsets.symmetric(horizontal: 4.0),
), child: LinkText(
linkStyle: TextStyle( text: event.getLocalizedBody(
color: Theme.of(context) MatrixLocals(L10n.of(context)!),
.textTheme withSenderNamePrefix: true,
.bodyText1 hideReply: true,
?.color ),
?.withAlpha(150), maxLines: 2,
fontSize: fontSize, textStyle: TextStyle(
decoration: TextDecoration.underline, overflow: TextOverflow.ellipsis,
), fontSize: fontSize,
onLinkTap: (url) => UrlLauncher(context, url).launchUrl(), decoration: event.redacted
? TextDecoration.lineThrough
: null,
),
linkStyle: TextStyle(
color: Theme.of(context)
.textTheme
.bodyText1
?.color
?.withAlpha(150),
fontSize: fontSize,
decoration: TextDecoration.underline,
),
onLinkTap: (url) =>
UrlLauncher(context, url).launchUrl(),
),
),
),
],
), ),
), ),
); );