mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 23:09:35 +01:00
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:
commit
b22dbed734
@ -67,28 +67,40 @@ class PinnedEvents extends StatelessWidget {
|
||||
color: Theme.of(context).appBarTheme.backgroundColor,
|
||||
elevation: Theme.of(context).appBarTheme.elevation ?? 10,
|
||||
shadowColor: Theme.of(context).appBarTheme.shadowColor,
|
||||
child: ListTile(
|
||||
tileColor: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => _displayPinnedEventsDialog(
|
||||
context,
|
||||
pinnedEvents,
|
||||
),
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(
|
||||
splashRadius: 20,
|
||||
iconSize: 20,
|
||||
icon: const Icon(Icons.push_pin),
|
||||
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(
|
||||
MatrixLocals(L10n.of(context)!),
|
||||
withSenderNamePrefix: true,
|
||||
hideReply: true,
|
||||
),
|
||||
maxLines: 3,
|
||||
maxLines: 2,
|
||||
textStyle: TextStyle(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontSize: fontSize,
|
||||
decoration:
|
||||
event.redacted ? TextDecoration.lineThrough : null,
|
||||
decoration: event.redacted
|
||||
? TextDecoration.lineThrough
|
||||
: null,
|
||||
),
|
||||
linkStyle: TextStyle(
|
||||
color: Theme.of(context)
|
||||
@ -99,7 +111,12 @@ class PinnedEvents extends StatelessWidget {
|
||||
fontSize: fontSize,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
onLinkTap: (url) => UrlLauncher(context, url).launchUrl(),
|
||||
onLinkTap: (url) =>
|
||||
UrlLauncher(context, url).launchUrl(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user