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

Commit 27c3153

Browse files
authored
Unified room context menus (#7072)
1 parent 720b092 commit 27c3153

File tree

23 files changed

+660
-133
lines changed

23 files changed

+660
-133
lines changed

res/css/_components.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@
266266
@import "./views/settings/_UpdateCheckButton.scss";
267267
@import "./views/settings/tabs/_SettingsTab.scss";
268268
@import "./views/settings/tabs/room/_GeneralRoomSettingsTab.scss";
269+
@import "./views/settings/tabs/room/_NotificationSettingsTab.scss";
269270
@import "./views/settings/tabs/room/_RolesRoomSettingsTab.scss";
270271
@import "./views/settings/tabs/room/_SecurityRoomSettingsTab.scss";
271272
@import "./views/settings/tabs/user/_AppearanceUserSettingsTab.scss";

res/css/views/context_menus/_IconizedContextMenu.scss

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
// A context menu that largely fits the | [icon] [label] | format.
1818
.mx_IconizedContextMenu {
1919
min-width: 146px;
20+
width: max-content;
2021

2122
.mx_IconizedContextMenu_optionList {
2223
& > * {
@@ -119,7 +120,7 @@ limitations under the License.
119120
mask-position: center;
120121
mask-size: contain;
121122
mask-repeat: no-repeat;
122-
background: $primary-content;
123+
background-color: $secondary-content;
123124
}
124125
}
125126

@@ -133,6 +134,14 @@ limitations under the License.
133134
}
134135
}
135136

137+
.mx_IconizedContextMenu_option_red {
138+
color: $alert !important;
139+
140+
.mx_IconizedContextMenu_icon::before {
141+
background-color: $alert;
142+
}
143+
}
144+
136145
.mx_IconizedContextMenu_active {
137146
&.mx_AccessibleButton, .mx_AccessibleButton {
138147
color: $accent !important;
@@ -162,4 +171,9 @@ limitations under the License.
162171
.mx_IconizedContextMenu_unchecked::before {
163172
content: unset;
164173
}
174+
175+
.mx_IconizedContextMenu_sublabel {
176+
margin-left: 20px;
177+
color: $tertiary-content;
178+
}
165179
}

res/css/views/right_panel/_BaseCard.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ limitations under the License.
9999
}
100100

101101
.mx_BaseCard_Button {
102-
padding: 10px 38px 10px 12px;
102+
padding: 10px 32px 10px 12px;
103103
margin: 0;
104104
position: relative;
105105
font-size: $font-13px;
@@ -109,6 +109,12 @@ limitations under the License.
109109
overflow: hidden;
110110
white-space: nowrap;
111111
text-overflow: ellipsis;
112+
display: flex;
113+
114+
.mx_BaseCard_Button_sublabel {
115+
color: $tertiary-content;
116+
margin-left: auto;
117+
}
112118

113119
&:hover {
114120
background-color: rgba(141, 151, 165, 0.1);

res/css/views/rooms/_RoomHeader.scss

Lines changed: 51 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ limitations under the License.
3333
}
3434

3535
.mx_RoomHeader_wrapper {
36-
margin: auto;
37-
height: 50px;
36+
height: 44px;
3837
display: flex;
3938
align-items: center;
4039
min-width: 0;
41-
padding: 0 10px 0 18px;
40+
margin: 0 20px 0 16px;
41+
padding-top: 8px;
42+
border-bottom: 1px solid $system;
4243

4344
.mx_InviteOnlyIcon_large {
4445
margin: 0;
@@ -85,40 +86,65 @@ limitations under the License.
8586

8687
.mx_RoomHeader_simpleHeader {
8788
line-height: $font-52px;
88-
color: $roomheader-color;
89+
color: $primary-content;
8990
font-size: $font-18px;
90-
font-weight: 600;
91+
font-weight: $font-semi-bold;
9192
overflow: hidden;
9293
margin-left: 63px;
9394
text-overflow: ellipsis;
9495
width: 100%;
95-
}
9696

97-
.mx_RoomHeader_simpleHeader .mx_RoomHeader_cancelButton {
98-
float: right;
99-
}
97+
.mx_RoomHeader_cancelButton {
98+
float: right;
99+
}
100100

101-
.mx_RoomHeader_simpleHeader .mx_RoomHeader_icon {
102-
margin-left: 14px;
103-
margin-right: 24px;
104-
vertical-align: -4px;
101+
.mx_RoomHeader_icon {
102+
margin-left: 14px;
103+
margin-right: 24px;
104+
vertical-align: -4px;
105+
}
105106
}
106107

107108
.mx_RoomHeader_name {
108109
flex: 0 1 auto;
109110
overflow: hidden;
110-
color: $roomheader-color;
111-
font-weight: 600;
111+
color: $primary-content;
112+
font-weight: $font-semi-bold;
112113
font-size: $font-18px;
114+
border-radius: 6px;
113115
margin: 0 7px;
114-
border-bottom: 1px solid transparent;
116+
padding: 1px 4px;
115117
display: flex;
116-
}
118+
user-select: none;
117119

118-
.mx_RoomHeader_nametext {
119-
white-space: nowrap;
120-
text-overflow: ellipsis;
121-
overflow: hidden;
120+
&:hover {
121+
background-color: $quinary-content;
122+
}
123+
124+
.mx_RoomHeader_nametext {
125+
white-space: nowrap;
126+
text-overflow: ellipsis;
127+
overflow: hidden;
128+
}
129+
130+
.mx_RoomHeader_chevron {
131+
align-self: center;
132+
width: 16px;
133+
height: 16px;
134+
mask-position: center;
135+
mask-size: contain;
136+
mask-repeat: no-repeat;
137+
mask-image: url('$(res)/img/feather-customised/chevron-down.svg');
138+
background-color: $tertiary-content;
139+
}
140+
141+
&[aria-expanded=true] {
142+
background-color: $quinary-content;
143+
144+
.mx_RoomHeader_chevron {
145+
transform: rotate(180deg);
146+
}
147+
}
122148
}
123149

124150
.mx_RoomHeader_settingsHint {
@@ -131,46 +157,17 @@ limitations under the License.
131157
}
132158

133159
.mx_RoomHeader_name,
134-
.mx_RoomHeader_avatar,
135-
.mx_RoomHeader_avatarPicker,
136-
.mx_RoomHeader_avatarPicker_edit,
137-
.mx_RoomHeader_avatarPicker_remove {
160+
.mx_RoomHeader_avatar {
138161
cursor: pointer;
139162
}
140163

141-
.mx_RoomHeader_avatarPicker_remove {
142-
position: absolute;
143-
top: -11px;
144-
right: -9px;
145-
}
146-
147-
.mx_RoomHeader_name:hover div:not(.mx_RoomHeader_editable) {
148-
color: $accent;
149-
}
150-
151-
.mx_RoomHeader_placeholder {
152-
color: $settings-grey-fg-color !important;
153-
}
154-
155-
.mx_RoomHeader_editable {
156-
border-bottom: 1px solid $strong-input-border-color !important;
157-
min-width: 150px;
158-
cursor: text;
159-
}
160-
161-
.mx_RoomHeader_editable:focus {
162-
border-bottom: 1px solid $accent !important;
163-
outline: none;
164-
box-shadow: none;
165-
}
166-
167164
.mx_RoomHeader_topic {
168165
flex: 1;
169166
color: $roomtopic-color;
170167
font-weight: 400;
171168
font-size: $font-13px;
172-
margin: 0 7px;
173-
margin-top: 4px; // to align baseline of topic with room name
169+
// to align baseline of topic with room name
170+
margin: 4px 7px 0;
174171
overflow: hidden;
175172
text-overflow: ellipsis;
176173
border-bottom: 1px solid transparent;
@@ -188,24 +185,6 @@ limitations under the License.
188185
object-fit: cover;
189186
}
190187

191-
.mx_RoomHeader_avatarPicker {
192-
position: relative;
193-
}
194-
195-
.mx_RoomHeader_avatarPicker_edit {
196-
position: absolute;
197-
left: 16px;
198-
top: 18px;
199-
}
200-
201-
.mx_RoomHeader_avatarPicker_edit > label {
202-
cursor: pointer;
203-
}
204-
205-
.mx_RoomHeader_avatarPicker_edit > input {
206-
display: none;
207-
}
208-
209188
.mx_RoomHeader_button {
210189
position: relative;
211190
margin-left: 1px;
@@ -265,21 +244,10 @@ limitations under the License.
265244
mask-image: url('$(res)/img/element-icons/call/video-call.svg');
266245
}
267246

268-
.mx_RoomHeader_showPanel {
269-
height: 16px;
270-
}
271-
272-
.mx_RoomHeader_voipButton {
273-
display: table-cell;
274-
}
275-
276-
.mx_RoomHeader_voipButtons {
277-
margin-top: 18px;
278-
}
279-
280247
@media only screen and (max-width: 480px) {
281248
.mx_RoomHeader_wrapper {
282249
padding: 0;
250+
margin: 0;
283251
}
284252
.mx_RoomHeader {
285253
overflow: hidden;

res/css/views/rooms/_RoomTile.scss

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,42 @@ limitations under the License.
189189
mask-image: url('$(res)/img/element-icons/roomlist/low-priority.svg');
190190
}
191191

192+
.mx_RoomTile_iconNotificationsDefault::before {
193+
mask-image: url('$(res)/img/element-icons/notifications.svg');
194+
}
195+
196+
.mx_RoomTile_iconNotificationsAllMessages::before {
197+
mask-image: url('$(res)/img/element-icons/roomlist/notifications-default.svg');
198+
}
199+
200+
.mx_RoomTile_iconNotificationsMentionsKeywords::before {
201+
mask-image: url('$(res)/img/element-icons/roomlist/notifications-dm.svg');
202+
}
203+
204+
.mx_RoomTile_iconNotificationsNone::before {
205+
mask-image: url('$(res)/img/element-icons/roomlist/notifications-off.svg');
206+
}
207+
208+
.mx_RoomTile_iconPeople::before {
209+
mask-image: url('$(res)/img/element-icons/room/members.svg');
210+
}
211+
212+
.mx_RoomTile_iconFiles::before {
213+
mask-image: url('$(res)/img/element-icons/room/files.svg');
214+
}
215+
216+
.mx_RoomTile_iconWidgets::before {
217+
mask-image: url('$(res)/img/element-icons/room/apps.svg');
218+
}
219+
192220
.mx_RoomTile_iconSettings::before {
193221
mask-image: url('$(res)/img/element-icons/settings.svg');
194222
}
195223

224+
.mx_RoomTile_iconExport::before {
225+
mask-image: url('$(res)/img/element-icons/export.svg');
226+
}
227+
196228
.mx_RoomTile_iconCopyLink::before {
197229
mask-image: url('$(res)/img/element-icons/link.svg');
198230
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
Copyright 2021 The Matrix.org Foundation C.I.C.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
.mx_NotificationSettingsTab_notificationsSection {
18+
width: 360px;
19+
20+
.mx_StyledRadioButton {
21+
flex-direction: row-reverse;
22+
color: $primary-content;
23+
font-size: $font-15px;
24+
line-height: $font-18px;
25+
font-weight: $font-semi-bold;
26+
margin-top: 16px;
27+
position: relative;
28+
padding-left: 8px;
29+
align-items: center;
30+
31+
&::before {
32+
content: "";
33+
position: absolute;
34+
height: 24px;
35+
width: 24px;
36+
left: 0;
37+
mask-repeat: no-repeat;
38+
mask-position: center;
39+
mask-size: contain;
40+
background-color: $secondary-content;
41+
}
42+
43+
input + div {
44+
margin-top: 8px;
45+
}
46+
47+
.mx_NotificationSettingsTab_microCopy {
48+
color: $secondary-content;
49+
font-weight: normal;
50+
font-size: $font-12px;
51+
line-height: $font-15px;
52+
margin-right: 32px;
53+
54+
.mx_AccessibleButton_kind_link {
55+
padding: 0;
56+
font-size: inherit;
57+
}
58+
}
59+
}
60+
61+
.mx_NotificationSettingsTab_defaultEntry::before {
62+
mask-image: url('$(res)/img/element-icons/notifications.svg');
63+
}
64+
65+
.mx_NotificationSettingsTab_allMessagesEntry::before {
66+
mask-image: url('$(res)/img/element-icons/roomlist/notifications-default.svg');
67+
}
68+
69+
.mx_NotificationSettingsTab_mentionsKeywordsEntry::before {
70+
mask-image: url('$(res)/img/element-icons/roomlist/notifications-dm.svg');
71+
}
72+
73+
.mx_NotificationSettingsTab_noneEntry::before {
74+
mask-image: url('$(res)/img/element-icons/roomlist/notifications-off.svg');
75+
}
76+
}

0 commit comments

Comments
 (0)