From c1e602d56f6657390b77d586e6b03fa6589506ae Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 18 Oct 2018 15:19:45 +0200 Subject: [PATCH] scrollbars and resize handles around room sub lists --- res/css/views/rooms/_RoomList.scss | 25 ++++++++++------------ src/components/views/rooms/RoomList.js | 29 ++++++++++++++++++++------ 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/res/css/views/rooms/_RoomList.scss b/res/css/views/rooms/_RoomList.scss index 581016d5ba..30d5272574 100644 --- a/res/css/views/rooms/_RoomList.scss +++ b/res/css/views/rooms/_RoomList.scss @@ -16,8 +16,11 @@ limitations under the License. */ .mx_RoomList { - padding-bottom: 12px; - min-height: 400px; + /* take up remaining space below TopLeftMenu */ + flex: 1; + /* use flexbox to layout sublists */ + display: flex; + flex-direction: column; } .mx_RoomList_expandButton { @@ -27,18 +30,6 @@ limitations under the License. padding-right: 12px; } -/* Evil hacky override until Chrome fixes drop and drag table cells - and we can correctly fix horizontal wrapping in the sidebar again */ -.mx_RoomList_scrollbar .gm-scroll-view { - overflow-x: hidden ! important; - overflow-y: scroll ! important; -} - -/* Make sure the scrollbar is above the sticky headers from RoomList */ -.mx_RoomList_scrollbar .gm-scrollbar.-vertical { - z-index: 6; -} - .mx_RoomList_emptySubListTip_container { background-color: $secondary-accent-color; padding-left: 18px; @@ -65,3 +56,9 @@ limitations under the License. position: absolute; right: 60px; } + +.mx_RoomList_itemsSubList { + min-height: 80px; + flex: 1; +} + diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index 4e9f0af28e..b6585c4e1f 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -34,6 +34,8 @@ import TagOrderStore from '../../../stores/TagOrderStore'; import RoomListStore from '../../../stores/RoomListStore'; import GroupStore from '../../../stores/GroupStore'; +import ResizeHandle from '../elements/ResizeHandle'; +import {Resizer, CollapseDistributor} from '../../../resizer' const HIDE_CONFERENCE_CHANS = true; const STANDARD_TAGS_REGEX = /^(m\.(favourite|lowpriority|server_notice)|im\.vector\.fake\.(invite|recent|direct|archived))$/; @@ -518,11 +520,29 @@ module.exports = React.createClass({ showEmpty: showEmpty, incomingCall: self.state.incomingCall, }; - return subListsProps.map((props) => { + return subListsProps.reduce((components, props, i) => { + props = Object.assign({}, defaultProps, props); + const isLast = i === subListsProps.length - 1; + const len = props.list.length + (props.extraTiles ? props.extraTiles.length : 0); + if (!len) { + return components; //dont render + } const {key, label, ... otherProps} = props; const chosenKey = key || label; - return ; - }); + + let subList = + { } + ; + + if (!isLast) { + return components.concat( + subList, + + ); + } else { + return components.concat(subList); + } + }, []); } let subLists = [ @@ -612,12 +632,9 @@ module.exports = React.createClass({ const subListComponents = mapProps(subLists); return ( -
{ subListComponents }
-
); }, });