From 7098ca9df0675debe7351480ba3dad22750c8150 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Tue, 6 Jun 2017 00:24:30 +0100 Subject: [PATCH 1/2] Added styling for copy to clipboard button - currently using the edit button's image as a placeholder Signed-off-by: Oliver Hunt --- .../views/rooms/_EventTile.scss | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/_EventTile.scss b/src/skins/vector/css/matrix-react-sdk/views/rooms/_EventTile.scss index 9d970ad45..e99609e03 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/rooms/_EventTile.scss +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/_EventTile.scss @@ -332,6 +332,24 @@ limitations under the License. .mx_EventTile_content .markdown-body code { background-color: #f8f8f8; } +.mx_EventTile_copyButton { + position: absolute; + display: inline-block; + visibility: hidden; + cursor: pointer; + top: 6px; + right: 6px; + width: 19px; + height: 19px; + background-image: url($edit-button-url); +} +.mx_EventTile_body pre { + position: relative; +} +.mx_EventTile_body pre:hover .mx_EventTile_copyButton +{ + visibility: visible; +} .mx_EventTile_content .markdown-body h1, .mx_EventTile_content .markdown-body h2, From fd42698cf02a750cd94a9854cf74a2cf847f750f Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Tue, 6 Jun 2017 13:21:50 +0100 Subject: [PATCH 2/2] Added svg for copy icon - I'm not a designer, someone else should probably replace these! Signed-off-by: Oliver Hunt --- .../views/rooms/_EventTile.scss | 2 +- src/skins/vector/css/themes/_base.scss | 3 +- src/skins/vector/css/themes/_dark.scss | 1 + src/skins/vector/img/icon_copy_message.svg | 86 +++++++++++++++++++ .../vector/img/icon_copy_message_dark.svg | 77 +++++++++++++++++ 5 files changed, 167 insertions(+), 2 deletions(-) create mode 100644 src/skins/vector/img/icon_copy_message.svg create mode 100644 src/skins/vector/img/icon_copy_message_dark.svg diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/_EventTile.scss b/src/skins/vector/css/matrix-react-sdk/views/rooms/_EventTile.scss index e99609e03..8f3c6d6c7 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/rooms/_EventTile.scss +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/_EventTile.scss @@ -341,7 +341,7 @@ limitations under the License. right: 6px; width: 19px; height: 19px; - background-image: url($edit-button-url); + background-image: url($copy-button-url); } .mx_EventTile_body pre { position: relative; diff --git a/src/skins/vector/css/themes/_base.scss b/src/skins/vector/css/themes/_base.scss index b60119134..fc24af93e 100644 --- a/src/skins/vector/css/themes/_base.scss +++ b/src/skins/vector/css/themes/_base.scss @@ -102,6 +102,7 @@ $event-redacted-img: url('../../img/redacted.jpg'); $event-timestamp-color: #acacac; $edit-button-url: "../../img/icon_context_message.svg"; +$copy-button-url: "../../img/icon_copy_message.svg"; // e2e $e2e-verified-color: #76cfa5; // N.B. *NOT* the same as $accent-color @@ -114,4 +115,4 @@ $lightbox-fg-color: #ffffff; $lightbox-border-color: #ffffff; // unused? -$progressbar-color: #000; \ No newline at end of file +$progressbar-color: #000; diff --git a/src/skins/vector/css/themes/_dark.scss b/src/skins/vector/css/themes/_dark.scss index 72c21b757..fe2e7591c 100644 --- a/src/skins/vector/css/themes/_dark.scss +++ b/src/skins/vector/css/themes/_dark.scss @@ -102,6 +102,7 @@ $event-redacted-img: url('../../img/redacted-dark.jpg'); $event-timestamp-color: #acacac; $edit-button-url: "../../img/icon_context_message_dark.svg"; +$copy-button-url: "../../img/icon_copy_message_dark.svg"; // e2e $e2e-verified-color: #76cfa5; // N.B. *NOT* the same as $accent-color diff --git a/src/skins/vector/img/icon_copy_message.svg b/src/skins/vector/img/icon_copy_message.svg new file mode 100644 index 000000000..8d8887bb2 --- /dev/null +++ b/src/skins/vector/img/icon_copy_message.svg @@ -0,0 +1,86 @@ + + + + + + image/svg+xml + + ED5D3E59-2561-4AC1-9B43-82FBC51767FC + + + + + + ED5D3E59-2561-4AC1-9B43-82FBC51767FC + Created with sketchtool. + + + + + + + + + diff --git a/src/skins/vector/img/icon_copy_message_dark.svg b/src/skins/vector/img/icon_copy_message_dark.svg new file mode 100644 index 000000000..b81e617d8 --- /dev/null +++ b/src/skins/vector/img/icon_copy_message_dark.svg @@ -0,0 +1,77 @@ + + + + + + image/svg+xml + + ED5D3E59-2561-4AC1-9B43-82FBC51767FC + + + + + + ED5D3E59-2561-4AC1-9B43-82FBC51767FC + Created with sketchtool. + + + + + + +