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

Commit fb3b5d2

Browse files
authored
Merge pull request #5266 from matrix-org/t3chguy/feat/widgets
Pinned widgets work
2 parents 4222871 + a5468c9 commit fb3b5d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1117
-925
lines changed

res/css/_components.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@
5151
@import "./views/avatars/_DecoratedRoomAvatar.scss";
5252
@import "./views/avatars/_MemberStatusMessageAvatar.scss";
5353
@import "./views/avatars/_PulsedAvatar.scss";
54+
@import "./views/avatars/_WidgetAvatar.scss";
5455
@import "./views/context_menus/_IconizedContextMenu.scss";
5556
@import "./views/context_menus/_MessageContextMenu.scss";
5657
@import "./views/context_menus/_StatusMessageContextMenu.scss";
5758
@import "./views/context_menus/_TagTileContextMenu.scss";
58-
@import "./views/context_menus/_WidgetContextMenu.scss";
5959
@import "./views/dialogs/_AddressPickerDialog.scss";
6060
@import "./views/dialogs/_Analytics.scss";
6161
@import "./views/dialogs/_BugReportDialog.scss";

res/css/structures/_MatrixChat.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ limitations under the License.
7979
height: 100%;
8080
}
8181

82-
.mx_MatrixChat > .mx_LeftPanel2:hover + .mx_ResizeHandle_horizontal,
8382
.mx_MatrixChat > .mx_ResizeHandle_horizontal:hover {
8483
position: relative;
8584

src/dispatcher/payloads/AppTileActionPayload.ts renamed to res/css/views/avatars/_WidgetAvatar.scss

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
import { ActionPayload } from "../payloads";
18-
import { Action } from "../actions";
19-
20-
export interface AppTileActionPayload extends ActionPayload {
21-
action: Action.AppTileDelete | Action.AppTileRevoke;
22-
widgetId: string;
17+
.mx_WidgetAvatar {
18+
border-radius: 4px;
2319
}

res/css/views/context_menus/_WidgetContextMenu.scss

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

res/css/views/right_panel/_BaseCard.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@ limitations under the License.
128128
mask-size: 20px;
129129
mask-image: url('$(res)/img/feather-customised/chevron-down.svg');
130130
}
131+
132+
&.mx_AccessibleButton_disabled {
133+
padding-right: 12px;
134+
&::after {
135+
content: unset;
136+
}
137+
}
131138
}
132139
}
133140

res/css/views/right_panel/_RoomSummaryCard.scss

Lines changed: 91 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,28 +110,107 @@ limitations under the License.
110110

111111
.mx_RoomSummaryCard_appsGroup {
112112
.mx_RoomSummaryCard_Button {
113-
padding-left: 12px;
113+
// this button is special so we have to override some of the original styling
114+
// as we will be applying it in its children
115+
padding: 0;
116+
height: auto;
114117
color: $tertiary-fg-color;
115118

116-
span {
117-
color: $primary-fg-color;
119+
.mx_RoomSummaryCard_icon_app {
120+
padding: 10px 48px 10px 12px; // based on typical mx_RoomSummaryCard_Button padding
121+
text-overflow: ellipsis;
122+
overflow: hidden;
123+
124+
.mx_BaseAvatar_image {
125+
vertical-align: top;
126+
margin-right: 12px;
127+
}
128+
129+
span {
130+
color: $primary-fg-color;
131+
}
132+
}
133+
134+
.mx_RoomSummaryCard_app_pinToggle,
135+
.mx_RoomSummaryCard_app_options {
136+
position: absolute;
137+
top: 0;
138+
height: 100%; // to give bigger interactive zone
139+
width: 24px;
140+
padding: 12px 4px;
141+
box-sizing: border-box;
142+
min-width: 24px; // prevent flexbox crushing
143+
144+
&:hover {
145+
&::after {
146+
content: '';
147+
position: absolute;
148+
height: 24px;
149+
width: 24px;
150+
top: 8px; // equal to padding-top of parent
151+
left: 0;
152+
border-radius: 12px;
153+
background-color: rgba(141, 151, 165, 0.1);
154+
}
155+
}
156+
157+
&::before {
158+
content: '';
159+
position: absolute;
160+
height: 16px;
161+
width: 16px;
162+
mask-repeat: no-repeat;
163+
mask-position: center;
164+
mask-size: 16px;
165+
background-color: $icon-button-color;
166+
}
167+
}
168+
169+
.mx_RoomSummaryCard_app_pinToggle {
170+
right: 24px;
171+
172+
&::before {
173+
mask-image: url('$(res)/img/element-icons/room/pin-upright.svg');
174+
}
175+
}
176+
177+
.mx_RoomSummaryCard_app_options {
178+
right: 48px;
179+
display: none;
180+
181+
&::before {
182+
mask-image: url('$(res)/img/element-icons/room/ellipsis.svg');
183+
}
184+
}
185+
186+
&.mx_RoomSummaryCard_Button_pinned {
187+
&::after {
188+
opacity: 0.2;
189+
}
190+
191+
.mx_RoomSummaryCard_app_pinToggle::before {
192+
background-color: $accent-color;
193+
}
118194
}
119195

120-
img {
121-
vertical-align: top;
122-
margin-right: 12px;
123-
border-radius: 4px;
196+
&:hover {
197+
.mx_RoomSummaryCard_icon_app {
198+
padding-right: 72px;
199+
}
200+
201+
.mx_RoomSummaryCard_app_options {
202+
display: unset;
203+
}
124204
}
125205

126206
&::before {
127207
content: unset;
128208
}
129-
}
130209

131-
.mx_RoomSummaryCard_icon_app_pinned::after {
132-
mask-image: url('$(res)/img/element-icons/room/pin-upright.svg');
133-
background-color: $accent-color;
134-
transform: unset;
210+
&::after {
211+
top: 8px; // re-align based on the height change
212+
pointer-events: none; // pass through to the real button
213+
}
135214
}
136215
}
137216

res/css/views/right_panel/_WidgetCard.scss

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,35 @@ limitations under the License.
2424
border: 0;
2525
}
2626

27-
&.mx_WidgetCard_noEdit {
28-
.mx_AccessibleButton_kind_secondary {
29-
margin: 0 12px;
27+
.mx_BaseCard_header {
28+
display: inline-flex;
3029

31-
&:first-child {
32-
// expand the Pin to room primary action
33-
flex-grow: 1;
34-
}
30+
& > h2 {
31+
margin-right: 0;
32+
flex-grow: 1;
3533
}
36-
}
37-
38-
.mx_WidgetCard_optionsButton {
39-
position: relative;
40-
height: 18px;
41-
width: 26px;
4234

43-
&::before {
44-
content: "";
45-
position: absolute;
46-
width: 20px;
35+
.mx_WidgetCard_optionsButton {
36+
position: relative;
37+
margin-right: 44px;
4738
height: 20px;
48-
top: 6px;
49-
left: 20px;
50-
mask-repeat: no-repeat;
51-
mask-position: center;
52-
mask-size: contain;
53-
mask-image: url('$(res)/img/element-icons/room/ellipsis.svg');
54-
background-color: $secondary-fg-color;
39+
width: 20px;
40+
min-width: 20px; // prevent crushing by the flexbox
41+
padding: 0;
42+
43+
&::before {
44+
content: "";
45+
position: absolute;
46+
width: 20px;
47+
height: 20px;
48+
top: 0;
49+
left: 4px;
50+
mask-repeat: no-repeat;
51+
mask-position: center;
52+
mask-size: contain;
53+
mask-image: url('$(res)/img/element-icons/room/ellipsis.svg');
54+
background-color: $secondary-fg-color;
55+
}
5556
}
5657
}
5758
}

0 commit comments

Comments
 (0)