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,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(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user