From 62efea7e1995e95e54512e48daebb4f472ac0b95 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Tue, 23 Feb 2021 18:49:11 +0100 Subject: [PATCH] add message context menu icons Signed-off-by: Michael Weimann --- res/css/_components.scss | 1 + .../context_menus/_MessageContextMenu.scss | 71 +++++++++++++++++++ res/img/element-icons/message/chevron-up.svg | 1 + .../element-icons/message/corner-up-right.svg | 1 + res/img/element-icons/message/link.svg | 1 + res/img/element-icons/message/repeat.svg | 1 + res/img/element-icons/message/share.svg | 1 + .../views/context_menus/MessageContextMenu.js | 11 +++ 8 files changed, 88 insertions(+) create mode 100644 res/css/views/context_menus/_MessageContextMenu.scss create mode 100644 res/img/element-icons/message/chevron-up.svg create mode 100644 res/img/element-icons/message/corner-up-right.svg create mode 100644 res/img/element-icons/message/link.svg create mode 100644 res/img/element-icons/message/repeat.svg create mode 100644 res/img/element-icons/message/share.svg diff --git a/res/css/_components.scss b/res/css/_components.scss index 77f13437a2..ec3af8655e 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -57,6 +57,7 @@ @import "./views/beta/_BetaCard.scss"; @import "./views/context_menus/_CallContextMenu.scss"; @import "./views/context_menus/_IconizedContextMenu.scss"; +@import "./views/context_menus/_MessageContextMenu.scss"; @import "./views/context_menus/_StatusMessageContextMenu.scss"; @import "./views/context_menus/_TagTileContextMenu.scss"; @import "./views/dialogs/_AddExistingToSpaceDialog.scss"; diff --git a/res/css/views/context_menus/_MessageContextMenu.scss b/res/css/views/context_menus/_MessageContextMenu.scss new file mode 100644 index 0000000000..d4f5913064 --- /dev/null +++ b/res/css/views/context_menus/_MessageContextMenu.scss @@ -0,0 +1,71 @@ +.mx_MessageContextMenu { + + .mx_IconizedContextMenu_icon { + width: 16px; + height: 16px; + display: block; + + &::before { + content: ''; + width: 16px; + height: 16px; + display: block; + mask-position: center; + mask-size: contain; + mask-repeat: no-repeat; + background: $primary-fg-color; + } + } + + .mx_MessageContextMenu_iconCollapse::before { + mask-image: url('$(res)/img/element-icons/message/chevron-up.svg'); + } + + .mx_MessageContextMenu_iconReport::before { + mask-image: url('$(res)/img/feather-customised/warning-triangle.svg'); + } + + .mx_MessageContextMenu_iconLink::before { + mask-image: url('$(res)/img/element-icons/message/link.svg'); + } + + .mx_MessageContextMenu_iconPermalink::before { + mask-image: url('$(res)/img/element-icons/message/share.svg'); + } + + .mx_MessageContextMenu_iconUnhidePreview::before { + mask-image: url('$(res)/img/feather-customised/eye.svg'); + } + + .mx_MessageContextMenu_iconForward::before { + mask-image: url('$(res)/img/element-icons/message/corner-up-right.svg'); + } + + .mx_MessageContextMenu_iconCancel::before { + mask-image: url('$(res)/img/cancel.svg'); + } + + .mx_MessageContextMenu_iconRedact::before { + mask-image: url('$(res)/img/feather-customised/trash.custom.svg'); + } + + .mx_MessageContextMenu_iconResend::before { + mask-image: url('$(res)/img/element-icons/message/repeat.svg'); + } + + .mx_MessageContextMenu_iconSource::before { + mask-image: url('$(res)/img/element-icons/room/format-bar/code.svg'); + } + + .mx_MessageContextMenu_iconQuote::before { + mask-image: url('$(res)/img/format/quote.svg'); + } + + .mx_MessageContextMenu_iconPin::before { + mask-image: url('$(res)/img/element-icons/room/pin-upright.svg'); + } + + .mx_MessageContextMenu_iconUnpin::before { + mask-image: url('$(res)/img/element-icons/room/pin.svg'); + } +} diff --git a/res/img/element-icons/message/chevron-up.svg b/res/img/element-icons/message/chevron-up.svg new file mode 100644 index 0000000000..4eb5ecc33e --- /dev/null +++ b/res/img/element-icons/message/chevron-up.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/res/img/element-icons/message/corner-up-right.svg b/res/img/element-icons/message/corner-up-right.svg new file mode 100644 index 0000000000..0b8f961b7b --- /dev/null +++ b/res/img/element-icons/message/corner-up-right.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/res/img/element-icons/message/link.svg b/res/img/element-icons/message/link.svg new file mode 100644 index 0000000000..c89dd41c23 --- /dev/null +++ b/res/img/element-icons/message/link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/res/img/element-icons/message/repeat.svg b/res/img/element-icons/message/repeat.svg new file mode 100644 index 0000000000..c7657b08ed --- /dev/null +++ b/res/img/element-icons/message/repeat.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/res/img/element-icons/message/share.svg b/res/img/element-icons/message/share.svg new file mode 100644 index 0000000000..df38c14d63 --- /dev/null +++ b/res/img/element-icons/message/share.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index f0ee2cb259..c3f634231b 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -265,6 +265,7 @@ export default class MessageContextMenu extends React.Component { if (unsentReactionsCount !== 0) { resendReactionsButton = ( @@ -275,6 +276,7 @@ export default class MessageContextMenu extends React.Component { if (isSent && this.state.canRedact) { redactButton = ( @@ -284,6 +286,7 @@ export default class MessageContextMenu extends React.Component { if (isContentActionable(mxEvent)) { forwardButton = ( @@ -292,6 +295,7 @@ export default class MessageContextMenu extends React.Component { if (this.state.canPin) { pinButton = ( @@ -301,6 +305,7 @@ export default class MessageContextMenu extends React.Component { const viewSourceButton = ( @@ -310,6 +315,7 @@ export default class MessageContextMenu extends React.Component { if (this.props.eventTileOps.isWidgetHidden()) { unhidePreviewButton = ( @@ -324,6 +330,7 @@ export default class MessageContextMenu extends React.Component { // XXX: if we use room ID, we should also include a server where the event can be found (other than in the domain of the event ID) const permalinkButton = ( @@ -350,6 +358,7 @@ export default class MessageContextMenu extends React.Component { ) { externalURLButton = ( @@ -373,6 +383,7 @@ export default class MessageContextMenu extends React.Component { if (mxEvent.getSender() !== me) { reportEventButton = (