Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 8e457f1

Browse files
authored
Introduce new copy icon (#8942)
PSG-110
1 parent 2468e58 commit 8e457f1

File tree

8 files changed

+44
-16
lines changed

8 files changed

+44
-16
lines changed

res/css/components/views/beacon/_ShareLatestLocation.scss

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,20 @@ limitations under the License.
2020
color: $secondary-content;
2121
}
2222

23-
.mx_ShareLatestLocation_copy {
23+
// double class to be more specific than the general mx_CopyableText CSS rule
24+
.mx_CopyableText.mx_ShareLatestLocation_copy {
2425
// override copyable text style to make compact
2526
.mx_CopyableText_copyButton {
27+
height: 13px;
2628
margin-left: $spacing-8 !important;
29+
position: relative;
30+
top: -1px;
31+
width: 13px;
32+
33+
&::before {
34+
background-color: $secondary-content;
35+
height: 13px;
36+
width: 13px;
37+
}
2738
}
2839
}

res/css/views/context_menus/_MessageContextMenu.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ limitations under the License.
9191
}
9292

9393
.mx_MessageContextMenu_iconCopy::before {
94+
height: 12px;
95+
left: 2px;
9496
mask-image: url($copy-button-url);
97+
position: relative;
98+
width: 12px;
99+
top: 3px;
95100
}
96101

97102
.mx_MessageContextMenu_iconEdit::before {

res/css/views/elements/_CopyableText.scss

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ limitations under the License.
1616
*/
1717

1818
.mx_CopyableText {
19+
align-items: flex-start;
1920
display: flex;
2021
justify-content: space-between;
2122
width: max-content;
@@ -31,19 +32,25 @@ limitations under the License.
3132

3233
.mx_CopyableText_copyButton {
3334
flex-shrink: 0;
34-
width: 20px;
35-
height: 20px;
35+
// using em here to adapt to the local font size
36+
width: 1em;
37+
height: 1em;
3638
cursor: pointer;
3739
margin-left: 20px;
3840
display: block;
41+
// center to first line
42+
position: relative;
43+
top: .15em;
3944

4045
&::before {
4146
content: "";
42-
4347
mask-image: url($copy-button-url);
48+
mask-position: center center;
49+
mask-repeat: no-repeat;
50+
mask-size: contain;
4451
background-color: $message-action-bar-fg-color;
45-
width: 20px;
46-
height: 20px;
52+
width: 1em;
53+
height: 1em;
4754
display: block;
4855
background-repeat: no-repeat;
4956
}

res/css/views/rooms/_EventTile.scss

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,16 @@ $threadInfoLineHeight: calc(2 * $font-12px); // See: _commons.scss
611611
mask-size: 75%;
612612
}
613613
}
614+
615+
.mx_EventTile_copyButton {
616+
height: 17px;
617+
mask-image: url($copy-button-url);
618+
mask-position: center center;
619+
mask-repeat: no-repeat;
620+
mask-size: contain;
621+
right: 9px;
622+
width: 17px;
623+
}
614624
}
615625
}
616626

@@ -631,10 +641,6 @@ $threadInfoLineHeight: calc(2 * $font-12px); // See: _commons.scss
631641
cursor: pointer;
632642
}
633643

634-
.mx_EventTile_copyButton {
635-
mask-image: url($copy-button-url);
636-
}
637-
638644
.mx_EventTile_collapseButton,
639645
.mx_EventTile_expandButton {
640646
mask-position: center;

res/img/element-icons/copy.svg

Lines changed: 3 additions & 0 deletions
Loading

res/img/feather-customised/clipboard.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

res/themes/legacy-light/css/_legacy-light.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ $event-highlight-bg-color: $yellow-background;
210210
// event timestamp
211211
$event-timestamp-color: #acacac;
212212

213-
$copy-button-url: "$(res)/img/feather-customised/clipboard.svg";
213+
$copy-button-url: "$(res)/img/element-icons/copy.svg";
214214

215215
// e2e
216216
$e2e-verified-color: #76cfa5; // N.B. *NOT* the same as $accent

res/themes/light/css/_light.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ $focus-brightness: 105%;
325325

326326
// Icon URLs
327327
// ********************
328-
$copy-button-url: "$(res)/img/feather-customised/clipboard.svg";
328+
$copy-button-url: "$(res)/img/element-icons/copy.svg";
329329
// ********************
330330

331331
// Location sharing

0 commit comments

Comments
 (0)