2020-06-04 05:16:53 +02:00
|
|
|
/*
|
|
|
|
Copyright 2020 The Matrix.org Foundation C.I.C.
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2020-06-05 22:08:20 +02:00
|
|
|
// TODO: Rename to mx_RoomSublist during replacement of old component
|
|
|
|
|
2020-06-05 05:21:04 +02:00
|
|
|
.mx_RoomSublist2 {
|
|
|
|
// The sublist is a column of rows, essentially
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
|
2020-06-10 23:05:17 +02:00
|
|
|
margin-left: 8px;
|
2020-06-05 05:21:04 +02:00
|
|
|
margin-top: 12px;
|
|
|
|
margin-bottom: 12px;
|
2020-06-10 07:09:15 +02:00
|
|
|
width: 100%;
|
2020-06-05 05:21:04 +02:00
|
|
|
|
|
|
|
.mx_RoomSublist2_headerContainer {
|
2020-06-14 03:07:19 +02:00
|
|
|
// Create a flexbox to make alignment easy
|
2020-06-08 21:42:18 +02:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2020-06-13 19:54:40 +02:00
|
|
|
|
|
|
|
// ***************************
|
|
|
|
// Sticky Headers Start
|
|
|
|
|
|
|
|
// Ideally we'd be able to use `position: sticky; top: 0; bottom: 0;` on the
|
|
|
|
// headerContainer, however due to our layout concerns we actually have to
|
|
|
|
// calculate it manually so we can sticky things in the right places. We also
|
|
|
|
// target the headerText instead of the container to reduce jumps when scrolling,
|
|
|
|
// and to help hide the badges/other buttons that could appear on hover. This
|
|
|
|
// all works by ensuring the header text has a fixed height when sticky so the
|
|
|
|
// fixed height of the container can maintain the scroll position.
|
|
|
|
|
|
|
|
// The combined height must be set in the LeftPanel2 component for sticky headers
|
|
|
|
// to work correctly.
|
2020-06-10 23:05:17 +02:00
|
|
|
padding-bottom: 8px;
|
|
|
|
height: 24px;
|
2020-06-08 21:42:18 +02:00
|
|
|
|
2020-06-14 03:07:19 +02:00
|
|
|
.mx_RoomSublist2_stickable {
|
|
|
|
flex: 1;
|
|
|
|
max-width: 100%;
|
2020-06-13 19:54:40 +02:00
|
|
|
z-index: 2; // Prioritize headers in the visible list over sticky ones
|
|
|
|
|
2020-06-14 03:07:19 +02:00
|
|
|
// Set the same background color as the room list for sticky headers
|
|
|
|
background-color: $roomlist2-bg-color;
|
|
|
|
|
|
|
|
// Create a flexbox to make ordering easy
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
|
2020-06-13 19:54:40 +02:00
|
|
|
// We use a generic sticky class for 2 reasons: to reduce style duplication and
|
|
|
|
// to identify when a header is sticky. If we didn't have a consistent sticky class,
|
|
|
|
// we'd have to do the "is sticky" checks again on click, as clicking the header
|
|
|
|
// when sticky scrolls instead of collapses the list.
|
|
|
|
&.mx_RoomSublist2_headerContainer_sticky {
|
|
|
|
position: fixed;
|
|
|
|
z-index: 1; // over top of other elements, but still under the ones in the visible list
|
|
|
|
height: 32px; // to match the header container
|
|
|
|
// width set by JS
|
|
|
|
}
|
|
|
|
|
|
|
|
&.mx_RoomSublist2_headerContainer_stickyBottom {
|
|
|
|
bottom: 0;
|
|
|
|
}
|
|
|
|
|
2020-06-17 16:28:22 +02:00
|
|
|
// We don't have a top style because the top is dependent on the room list header's
|
2020-06-13 19:54:40 +02:00
|
|
|
// height, and is therefore calculated in JS.
|
2020-06-17 16:28:22 +02:00
|
|
|
// The class, mx_RoomSublist2_headerContainer_stickyTop, is applied though.
|
2020-06-13 19:54:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Sticky Headers End
|
|
|
|
// ***************************
|
|
|
|
|
2020-06-08 21:42:18 +02:00
|
|
|
.mx_RoomSublist2_badgeContainer {
|
|
|
|
opacity: 0.8;
|
2020-06-10 23:05:17 +02:00
|
|
|
width: 16px;
|
|
|
|
margin-right: 5px; // aligns with the room tile's badge
|
2020-06-08 21:42:18 +02:00
|
|
|
|
2020-06-10 23:05:17 +02:00
|
|
|
// Create another flexbox row because it's super easy to position the badge this way.
|
2020-06-08 21:42:18 +02:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2020-06-10 23:05:17 +02:00
|
|
|
justify-content: center;
|
2020-06-08 21:42:18 +02:00
|
|
|
}
|
|
|
|
|
2020-06-10 05:12:49 +02:00
|
|
|
// Both of these buttons are hidden by default until the list is hovered
|
|
|
|
.mx_RoomSublist2_auxButton,
|
|
|
|
.mx_RoomSublist2_menuButton {
|
|
|
|
width: 0;
|
|
|
|
margin: 0;
|
|
|
|
visibility: hidden;
|
|
|
|
position: relative;
|
2020-06-11 22:39:28 +02:00
|
|
|
border-radius: 32px;
|
2020-06-10 05:12:49 +02:00
|
|
|
|
|
|
|
&::before {
|
|
|
|
content: '';
|
|
|
|
width: 16px;
|
|
|
|
height: 16px;
|
|
|
|
position: absolute;
|
|
|
|
top: 4px;
|
|
|
|
left: 4px;
|
|
|
|
mask-position: center;
|
|
|
|
mask-size: contain;
|
|
|
|
mask-repeat: no-repeat;
|
|
|
|
background: $muted-fg-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomSublist2_auxButton::before {
|
|
|
|
mask-image: url('$(res)/img/feather-customised/plus.svg');
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomSublist2_menuButton::before {
|
|
|
|
mask-image: url('$(res)/img/feather-customised/more-horizontal.svg');
|
|
|
|
}
|
|
|
|
|
2020-06-08 21:42:18 +02:00
|
|
|
.mx_RoomSublist2_headerText {
|
|
|
|
flex: 1;
|
2020-06-10 23:05:17 +02:00
|
|
|
max-width: calc(100% - 16px); // 16px is the badge width
|
2020-06-08 21:42:18 +02:00
|
|
|
text-transform: uppercase;
|
|
|
|
opacity: 0.5;
|
|
|
|
line-height: $font-16px;
|
|
|
|
font-size: $font-12px;
|
|
|
|
|
|
|
|
// Ellipsize any text overflow
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
2020-06-16 03:47:25 +02:00
|
|
|
|
|
|
|
.mx_RoomSublist2_collapseBtn {
|
|
|
|
display: inline-block;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
// Default hidden
|
|
|
|
visibility: hidden;
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
|
|
|
|
&::before {
|
|
|
|
content: '';
|
|
|
|
width: 12px;
|
|
|
|
height: 12px;
|
|
|
|
position: absolute;
|
|
|
|
top: 1px;
|
|
|
|
left: 1px;
|
|
|
|
mask-position: center;
|
|
|
|
mask-size: contain;
|
|
|
|
mask-repeat: no-repeat;
|
|
|
|
background: $primary-fg-color;
|
|
|
|
mask-image: url('$(res)/img/feather-customised/chevron-down.svg');
|
|
|
|
}
|
|
|
|
|
|
|
|
&.mx_RoomSublist2_collapseBtn_collapsed::before {
|
|
|
|
mask-image: url('$(res)/img/feather-customised/chevron-right.svg');
|
|
|
|
}
|
|
|
|
}
|
2020-06-08 21:42:18 +02:00
|
|
|
}
|
2020-06-05 05:21:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomSublist2_resizeBox {
|
2020-06-10 03:48:31 +02:00
|
|
|
margin-bottom: 4px; // for the resize handle
|
|
|
|
position: relative;
|
|
|
|
|
2020-06-05 05:21:04 +02:00
|
|
|
// Create another flexbox column for the tiles
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
overflow: hidden;
|
2020-06-05 16:48:23 +02:00
|
|
|
|
2020-06-16 04:00:09 +02:00
|
|
|
.mx_RoomSublist2_showNButton {
|
2020-06-05 16:48:23 +02:00
|
|
|
cursor: pointer;
|
2020-06-10 03:48:31 +02:00
|
|
|
font-size: $font-13px;
|
|
|
|
line-height: $font-18px;
|
|
|
|
color: $roomtile2-preview-color;
|
|
|
|
|
|
|
|
// This is the same color as the left panel background because it needs
|
|
|
|
// to occlude the lastmost tile in the list.
|
2020-06-12 21:52:54 +02:00
|
|
|
background-color: $roomlist2-bg-color;
|
2020-06-10 03:48:31 +02:00
|
|
|
|
|
|
|
// Update the render() function for RoomSublist2 if these change
|
|
|
|
// Update the ListLayout class for minVisibleTiles if these change.
|
|
|
|
//
|
|
|
|
// At 24px high and 8px padding on the top this equates to 0.65 of
|
|
|
|
// a tile due to how the padding calculations work.
|
|
|
|
height: 24px;
|
|
|
|
padding-top: 8px;
|
|
|
|
|
|
|
|
// We force this to the bottom so it will overlap rooms as needed.
|
|
|
|
// We account for the space it takes up (24px) in the code through padding.
|
|
|
|
position: absolute;
|
|
|
|
bottom: 4px; // the height of the resize handle
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
2020-06-05 16:48:23 +02:00
|
|
|
|
|
|
|
// We create a flexbox to cheat at alignment
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2020-06-10 03:48:31 +02:00
|
|
|
|
2020-06-16 04:00:09 +02:00
|
|
|
.mx_RoomSublist2_showNButtonChevron {
|
2020-06-10 03:48:31 +02:00
|
|
|
position: relative;
|
|
|
|
width: 16px;
|
|
|
|
height: 16px;
|
|
|
|
margin-left: 12px;
|
|
|
|
margin-right: 18px;
|
|
|
|
mask-position: center;
|
|
|
|
mask-size: contain;
|
|
|
|
mask-repeat: no-repeat;
|
|
|
|
background: $roomtile2-preview-color;
|
|
|
|
}
|
2020-06-16 04:00:09 +02:00
|
|
|
|
|
|
|
.mx_RoomSublist2_showMoreButtonChevron {
|
|
|
|
mask-image: url('$(res)/img/feather-customised/chevron-down.svg');
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomSublist2_showLessButtonChevron {
|
|
|
|
mask-image: url('$(res)/img/feather-customised/chevron-up.svg');
|
|
|
|
}
|
2020-06-10 03:48:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Class name comes from the ResizableBox component
|
|
|
|
// The hover state needs to use the whole sublist, not just the resizable box,
|
|
|
|
// so that selector is below and one level higher.
|
|
|
|
.react-resizable-handle {
|
|
|
|
cursor: ns-resize;
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
|
|
// This is positioned directly below the 'show more' button.
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
|
|
|
|
// This is to visually align the bar in the list. Should be 12px from
|
|
|
|
// either side of the list. We define this after the positioning to
|
|
|
|
// trick the browser.
|
|
|
|
margin-left: 4px;
|
2020-06-10 23:15:58 +02:00
|
|
|
margin-right: 4px;
|
2020-06-05 16:48:23 +02:00
|
|
|
}
|
2020-06-05 05:21:04 +02:00
|
|
|
}
|
2020-06-10 05:12:49 +02:00
|
|
|
|
2020-06-10 03:48:31 +02:00
|
|
|
// The aforementioned selector for the hover state.
|
2020-06-10 05:12:49 +02:00
|
|
|
&:hover, &.mx_RoomSublist2_hasMenuOpen {
|
2020-06-10 15:42:41 +02:00
|
|
|
.react-resizable-handle {
|
|
|
|
opacity: 0.2;
|
|
|
|
|
|
|
|
// Update the render() function for RoomSublist2 if this changes
|
|
|
|
border: 2px solid $primary-fg-color;
|
|
|
|
}
|
|
|
|
|
2020-06-11 22:39:28 +02:00
|
|
|
&:not(.mx_RoomSublist2_minimized) > .mx_RoomSublist2_headerContainer {
|
2020-06-10 05:12:49 +02:00
|
|
|
// If the header doesn't have an aux button we still need to hide the badge for
|
|
|
|
// the menu button.
|
|
|
|
.mx_RoomSublist2_badgeContainer {
|
|
|
|
// Completely hide the badge
|
|
|
|
width: 0;
|
|
|
|
margin: 0;
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:not(.mx_RoomSublist2_headerContainer_withAux) {
|
|
|
|
// The menu button will be the rightmost button, so make it correctly aligned.
|
|
|
|
.mx_RoomSublist2_menuButton {
|
2020-06-10 23:05:17 +02:00
|
|
|
margin-right: 1px; // line it up with the badges on the room tiles
|
2020-06-10 05:12:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Both of these buttons have circled backgrounds and are visible at this point,
|
|
|
|
// so make them so.
|
|
|
|
.mx_RoomSublist2_auxButton,
|
|
|
|
.mx_RoomSublist2_menuButton {
|
|
|
|
width: 24px;
|
|
|
|
height: 24px;
|
|
|
|
margin-left: 16px;
|
2020-06-11 22:39:28 +02:00
|
|
|
visibility: visible;
|
2020-06-12 21:52:54 +02:00
|
|
|
background-color: $roomlist2-button-bg-color;
|
2020-06-11 22:39:28 +02:00
|
|
|
}
|
|
|
|
}
|
2020-06-16 03:47:25 +02:00
|
|
|
|
|
|
|
.mx_RoomSublist2_headerContainer {
|
|
|
|
.mx_RoomSublist2_headerText {
|
|
|
|
.mx_RoomSublist2_collapseBtn {
|
|
|
|
visibility: visible;
|
|
|
|
width: 12px;
|
|
|
|
height: 12px;
|
|
|
|
margin-right: 4px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-06-11 22:39:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
&.mx_RoomSublist2_minimized {
|
|
|
|
.mx_RoomSublist2_headerContainer {
|
|
|
|
height: auto;
|
|
|
|
flex-direction: column;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
.mx_RoomSublist2_badgeContainer {
|
2020-06-22 20:51:53 +02:00
|
|
|
order: 0;
|
2020-06-11 22:39:28 +02:00
|
|
|
align-self: flex-end;
|
|
|
|
margin-right: 0;
|
|
|
|
}
|
|
|
|
|
2020-06-22 20:51:53 +02:00
|
|
|
.mx_RoomSublist2_stickable {
|
|
|
|
order: 1;
|
2020-06-11 22:39:28 +02:00
|
|
|
max-width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomSublist2_auxButton {
|
2020-06-22 20:51:53 +02:00
|
|
|
order: 2;
|
2020-06-11 22:39:28 +02:00
|
|
|
visibility: visible;
|
|
|
|
width: 32px !important; // !important to override hover styles
|
|
|
|
height: 32px !important; // !important to override hover styles
|
|
|
|
margin-left: 0 !important; // !important to override hover styles
|
2020-06-12 21:52:54 +02:00
|
|
|
background-color: $roomlist2-button-bg-color;
|
2020-06-11 22:39:28 +02:00
|
|
|
margin-top: 8px;
|
|
|
|
|
|
|
|
&::before {
|
|
|
|
top: 8px;
|
|
|
|
left: 8px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomSublist2_resizeBox {
|
|
|
|
align-items: center;
|
|
|
|
|
2020-06-16 04:00:09 +02:00
|
|
|
.mx_RoomSublist2_showNButton {
|
2020-06-11 22:41:35 +02:00
|
|
|
flex-direction: column;
|
|
|
|
|
2020-06-16 04:00:09 +02:00
|
|
|
.mx_RoomSublist2_showNButtonChevron {
|
2020-06-11 22:39:28 +02:00
|
|
|
margin-right: 12px; // to center
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover, &.mx_RoomSublist2_hasMenuOpen {
|
|
|
|
.mx_RoomSublist2_menuButton {
|
2020-06-10 05:12:49 +02:00
|
|
|
visibility: visible;
|
2020-06-11 22:39:28 +02:00
|
|
|
position: absolute;
|
|
|
|
bottom: 48px; // align to middle of name, 40px for aux button (with padding) and 8px for alignment
|
|
|
|
right: 0;
|
|
|
|
width: 16px;
|
|
|
|
height: 16px;
|
|
|
|
border-radius: 0;
|
|
|
|
z-index: 1; // occlude the list name
|
|
|
|
|
|
|
|
// This is the same color as the left panel background because it needs
|
|
|
|
// to occlude the sublist title
|
2020-06-12 21:52:54 +02:00
|
|
|
background-color: $roomlist2-bg-color;
|
2020-06-11 22:39:28 +02:00
|
|
|
|
|
|
|
&::before {
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomSublist2_headerContainer:not(.mx_RoomSublist2_headerContainer_withAux) {
|
|
|
|
.mx_RoomSublist2_menuButton {
|
|
|
|
bottom: 8px; // align to the middle of name, 40px less than the `bottom` above.
|
|
|
|
}
|
2020-06-10 05:12:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// We have a hover style on the room list with no specific list hovered, so account for that
|
2020-06-11 22:39:28 +02:00
|
|
|
.mx_RoomList2:hover .mx_RoomSublist2:not(.mx_RoomSublist2_minimized),
|
|
|
|
.mx_RoomSublist2_hasMenuOpen:not(.mx_RoomSublist2_minimized) {
|
2020-06-10 05:12:49 +02:00
|
|
|
.mx_RoomSublist2_headerContainer_withAux {
|
|
|
|
.mx_RoomSublist2_badgeContainer {
|
|
|
|
// Completely hide the badge
|
|
|
|
width: 0;
|
|
|
|
margin: 0;
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomSublist2_auxButton {
|
|
|
|
// Show the aux button, but not the list button
|
|
|
|
width: 24px;
|
|
|
|
height: 24px;
|
2020-06-10 23:05:17 +02:00
|
|
|
margin-right: 1px; // line it up with the badges on the room tiles
|
2020-06-10 05:12:49 +02:00
|
|
|
visibility: visible;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomSublist2_contextMenu {
|
|
|
|
padding: 20px 16px;
|
|
|
|
width: 250px;
|
|
|
|
|
|
|
|
hr {
|
|
|
|
margin-top: 16px;
|
|
|
|
margin-bottom: 16px;
|
|
|
|
margin-right: 16px; // additional 16px
|
|
|
|
border: 1px solid $roomsublist2-divider-color;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomSublist2_contextMenu_title {
|
|
|
|
font-size: $font-15px;
|
|
|
|
line-height: $font-20px;
|
|
|
|
font-weight: 600;
|
2020-06-12 06:04:10 +02:00
|
|
|
margin-bottom: 4px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RadioButton, .mx_Checkbox {
|
|
|
|
margin-top: 8px;
|
|
|
|
}
|
2020-06-04 18:07:41 +02:00
|
|
|
}
|