From a92c21770a07066c837ef8886fc03cb26123ffa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Tue, 30 Nov 2021 14:36:56 +0100 Subject: [PATCH] content: Move ItemRow's Event actions to its own trait This will allow to use the same actions on other widgets. --- data/resources/resources.gresource.xml | 2 +- data/resources/ui/content-message-file.ui | 4 +- ...content-item-row-menu.ui => event-menu.ui} | 23 +-- po/POTFILES.in | 3 +- src/meson.build | 1 + src/session/content/room_history/item_row.rs | 185 +----------------- .../content/room_history/message_row/text.rs | 14 +- src/session/room/event.rs | 38 +++- src/session/room/event_actions.rs | 182 +++++++++++++++++ src/session/room/mod.rs | 2 + 10 files changed, 251 insertions(+), 203 deletions(-) rename data/resources/ui/{content-item-row-menu.ui => event-menu.ui} (71%) create mode 100644 src/session/room/event_actions.rs diff --git a/data/resources/resources.gresource.xml b/data/resources/resources.gresource.xml index 0aa5e481..607d1544 100644 --- a/data/resources/resources.gresource.xml +++ b/data/resources/resources.gresource.xml @@ -10,7 +10,6 @@ ui/content-explore-item.ui ui/content-public-room-row.ui ui/content-item.ui - ui/content-item-row-menu.ui ui/content-message-file.ui ui/content-member-page.ui ui/content-member-row.ui @@ -20,6 +19,7 @@ ui/content-state-row.ui ui/content-markdown-popover.ui ui/content-invite.ui + ui/event-menu.ui ui/event-source-dialog.ui ui/login.ui ui/session.ui diff --git a/data/resources/ui/content-message-file.ui b/data/resources/ui/content-message-file.ui index 5dc22bfe..fc7dff38 100644 --- a/data/resources/ui/content-message-file.ui +++ b/data/resources/ui/content-message-file.ui @@ -20,14 +20,14 @@ document-open-symbolic Open - item-row.file-open + event.file-open document-save-symbolic Save - item-row.file-save + event.file-save