Skip to content

Commit

Permalink
fixup! fixup! fixup! TW-1255: Support selectable pinned events
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian KOUNE committed Jan 8, 2024
1 parent 594945c commit a96ecfb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 48 deletions.
2 changes: 1 addition & 1 deletion lib/pages/chat/chat_pinned_events/pinned_messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class PinnedMessagesController extends State<PinnedMessages>
);

void closeSelectionMode() {
selectedEvents.value.clear();
selectedEvents.value = [];
}

void handleContextMenuActionInMore(
Expand Down
53 changes: 12 additions & 41 deletions lib/pages/chat/chat_pinned_events/pinned_messages_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -192,48 +192,19 @@ class PinnedMessagesScreen extends StatelessWidget {
),
),
const Spacer(),
responsiveUtils.isMobile(context)
? IconButton(
onPressed: () =>
controller.unpinSelectedEvents(),
icon: PinnedMessagesStyle.unpinIcon(),
)
: TextButton.icon(
onPressed: () =>
controller.unpinSelectedEvents(),
icon: PinnedMessagesStyle.unpinIcon(),
label: Text(
L10n.of(context)!.unpin,
style: Theme.of(context)
.textTheme
.labelLarge
?.copyWith(
color: Theme.of(context)
.colorScheme
.primary,
),
),
),
responsiveUtils.isMobile(context)
? IconButton(
onPressed: () =>
controller.unpinSelectedEvents(),
icon: PinnedMessagesStyle.deleteIcon(context),
)
: TextButton.icon(
onPressed: () => {},
icon: PinnedMessagesStyle.deleteIcon(context),
label: Text(
L10n.of(context)!.delete,
style: Theme.of(context)
.textTheme
.labelLarge
?.copyWith(
color:
Theme.of(context).colorScheme.error,
),
TextButton.icon(
onPressed: () => controller.unpinSelectedEvents(),
icon: PinnedMessagesStyle.unpinIcon(),
label: Text(
L10n.of(context)!.unpin,
style: Theme.of(context)
.textTheme
.labelLarge
?.copyWith(
color: Theme.of(context).colorScheme.primary,
),
),
),
),
],
),
),
Expand Down
6 changes: 0 additions & 6 deletions lib/pages/chat/chat_pinned_events/pinned_messages_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ class PinnedMessagesStyle {
);
static const double actionBarBorderRadius = 16.0;

static Icon deleteIcon(BuildContext context) => Icon(
Icons.delete,
size: 18,
color: Theme.of(context).colorScheme.error,
);

static Widget unpinIcon() => SvgPicture.asset(ImagePaths.icUnpin, height: 18);

static const double paddingAllContextMenuItem = 12;
Expand Down

0 comments on commit a96ecfb

Please sign in to comment.