diff --git a/res/css/_components.scss b/res/css/_components.scss index 1e1d3e6596..c43d9edc16 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -57,6 +57,7 @@ @import "./views/elements/_MemberEventListSummary.scss"; @import "./views/elements/_ProgressBar.scss"; @import "./views/elements/_ReplyThread.scss"; +@import "./views/elements/_ResizeHandle.scss"; @import "./views/elements/_RichText.scss"; @import "./views/elements/_RoleButton.scss"; @import "./views/elements/_Spinner.scss"; diff --git a/res/css/structures/_LeftPanel.scss b/res/css/structures/_LeftPanel.scss index c0298a048a..ca4a5ea6f3 100644 --- a/res/css/structures/_LeftPanel.scss +++ b/res/css/structures/_LeftPanel.scss @@ -15,32 +15,20 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_LeftPanel { - position: relative; - - display: flex; - flex-direction: column; - - border-right: 1px solid $panel-divider-color; -} - .mx_LeftPanel_container { display: flex; /* LeftPanel 260px */ - flex: 0 0 260px; + min-width: 260px; + flex: 0 0 auto; } -.mx_LeftPanel_container.mx_LeftPanel_container_hasTagPanel { - /* TagPanel 70px + LeftPanel 260px */ - flex: 0 0 330px; -} - -.mx_LeftPanel_container_collapsed { +.mx_LeftPanel_container.collapsed { + min-width: unset; /* Collapsed LeftPanel 70px */ flex: 0 0 70px; } -.mx_LeftPanel_container_collapsed.mx_LeftPanel_container_hasTagPanel { +.mx_LeftPanel_container.collapsed.mx_LeftPanel_container_hasTagPanel { /* TagPanel 70px + Collapsed LeftPanel 70px */ flex: 0 0 140px; } @@ -57,6 +45,15 @@ limitations under the License. } +.mx_LeftPanel { + background-color: $secondary-accent-color; + flex: 1; + position: relative; + overflow-x: hidden; + display: flex; + flex-direction: column; +} + .mx_LeftPanel .mx_AppTile_mini { height: 132px; } @@ -70,7 +67,7 @@ limitations under the License. z-index: 6; } -.mx_LeftPanel.collapsed .mx_BottomLeftMenu { +.mx_LeftPanel_container.collapsed .mx_BottomLeftMenu { flex: 0 0 160px; margin-bottom: 9px; } @@ -93,7 +90,7 @@ limitations under the License. pointer-events: none; } -.collapsed .mx_RoleButton { +.mx_LeftPanel_container.collapsed .mx_RoleButton { margin-right: 0px ! important; padding-top: 3px ! important; padding-bottom: 3px ! important; @@ -117,7 +114,7 @@ limitations under the License. margin-right: 0px; } -.mx_LeftPanel.collapsed .mx_BottomLeftMenu_settings { +.mx_LeftPanel_container.collapsed .mx_BottomLeftMenu_settings { float: none; } @@ -126,7 +123,7 @@ limitations under the License. flex: 0 0 50px; } - .mx_LeftPanel.collapsed .mx_BottomLeftMenu { + .mx_LeftPanel_container.collapsed .mx_BottomLeftMenu { flex: 0 0 160px; } diff --git a/res/css/structures/_MatrixChat.scss b/res/css/structures/_MatrixChat.scss index 9fdf972a4f..4f817eef44 100644 --- a/res/css/structures/_MatrixChat.scss +++ b/res/css/structures/_MatrixChat.scss @@ -68,19 +68,7 @@ limitations under the License. transform: translateX(-50%); } -.mx_MatrixChat .mx_LeftPanel { - order: 1; - background-color: $secondary-accent-color; - flex: 0 0 260px; -} - -.mx_MatrixChat .mx_LeftPanel.collapsed { - flex: 0 0 60px; -} - .mx_MatrixChat .mx_MatrixChat_middlePanel { - order: 2; - background-color: $primary-bg-color; flex: 1; @@ -100,13 +88,3 @@ limitations under the License. */ height: 100%; } - -.mx_MatrixChat .mx_RightPanel { - order: 3; - - flex: 0 0 235px; -} - -.mx_MatrixChat .mx_RightPanel.collapsed { - flex: 0 0 122px; -} diff --git a/res/css/structures/_RightPanel.scss b/res/css/structures/_RightPanel.scss index b4dff612ed..e0fb95e99c 100644 --- a/res/css/structures/_RightPanel.scss +++ b/res/css/structures/_RightPanel.scss @@ -15,8 +15,10 @@ limitations under the License. */ .mx_RightPanel { + overflow-x: hidden; + flex: 0 0 auto; position: relative; - + min-width: 250px; display: flex; flex-direction: column; } diff --git a/res/css/structures/_RoomSubList.scss b/res/css/structures/_RoomSubList.scss index 3cebc0b75f..2ddf383fde 100644 --- a/res/css/structures/_RoomSubList.scss +++ b/res/css/structures/_RoomSubList.scss @@ -29,7 +29,6 @@ limitations under the License. .mx_RoomSubList_labelContainer { height: 31px; /* mx_RoomSubList_label height including border */ - width: 235px; /* LHS Panel width */ position: relative; } @@ -39,7 +38,6 @@ limitations under the License. color: $roomsublist-label-fg-color; font-weight: 700; font-size: 12px; - width: 203px; /* padding + width = LHS Panel width */ height: 19px; /* height + padding = 31px = mx_RoomSubList_label height */ margin-left: 16px; padding-left: 16px; /* gutter */ @@ -57,15 +55,6 @@ limitations under the License. /* pointer-events: none; */ } -.collapsed .mx_RoomSubList_label { - height: 17px; - width: 28px; /* collapsed LHS Panel width */ -} - -.collapsed .mx_RoomSubList_labelContainer { - width: 28px; /* collapsed LHS Panel width */ -} - .mx_RoomSubList_roomCount { display: inline-block; font-size: 12px; @@ -75,10 +64,6 @@ limitations under the License. text-transform: none; } -.collapsed .mx_RoomSubList_roomCount { - display: none; -} - .mx_RoomSubList_badge { display: inline-block; min-width: 15px; @@ -101,12 +86,6 @@ limitations under the License. filter: brightness($focus-brightness); } -/* -.collapsed .mx_RoomSubList_badge { - display: none; -} -*/ - .mx_RoomSubList_badgeHighlight { background-color: $warning-color; } @@ -123,11 +102,6 @@ limitations under the License. border-right: 7px solid transparent; } -/* Hide the bottom of speech bubble */ -.collapsed .mx_RoomSubList_badgeHighlight:after { - display: none; -} - .mx_RoomSubList_chevron { left: 0px; pointer-events: none; @@ -165,10 +139,6 @@ limitations under the License. background-color: $secondary-accent-color; } -.collapsed .mx_RoomSubList_ellipsis { - height: 20px; -} - .mx_RoomSubList_line { display: inline-block; width: 159px; @@ -176,10 +146,6 @@ limitations under the License. vertical-align: middle; } -.collapsed .mx_RoomSubList_line { - display: none; -} - .mx_RoomSubList_more { display: inline-block; text-transform: uppercase; @@ -193,10 +159,6 @@ limitations under the License. vertical-align: middle; } -.collapsed .mx_RoomSubList_more { - display: none; -} - .mx_RoomSubList_moreBadge { display: inline-block; min-width: 15px; @@ -233,12 +195,6 @@ limitations under the License. padding-right: 4px; } -.collapsed .mx_RoomSubList_moreBadge { - position: static; - margin-left: 16px; - margin-top: 2px; -} - .mx_RoomSubList_ellipsis .mx_RoomSubList_chevronDown { position: relative; top: 4px; @@ -246,3 +202,40 @@ limitations under the License. } +.collapsed { + .mx_RoomSubList_label { + height: 17px; + width: 28px; /* collapsed LHS Panel width */ + } + + .mx_RoomSubList_labelContainer { + width: 28px; /* collapsed LHS Panel width */ + } + + .mx_RoomSubList_roomCount { + display: none; + } + + /* Hide the bottom of speech bubble */ + .mx_RoomSubList_badgeHighlight:after { + display: none; + } + + .mx_RoomSubList_line { + display: none; + } + + .mx_RoomSubList_moreBadge { + position: static; + margin-left: 16px; + margin-top: 2px; + } + + .mx_RoomSubList_ellipsis { + height: 20px; + } + + .mx_RoomSubList_more { + display: none; + } +} diff --git a/res/css/views/elements/_ResizeHandle.scss b/res/css/views/elements/_ResizeHandle.scss new file mode 100644 index 0000000000..e9aa91fe25 --- /dev/null +++ b/res/css/views/elements/_ResizeHandle.scss @@ -0,0 +1,32 @@ +/* +Copyright 2018 New Vector Ltd. + +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. +*/ + +.mx_ResizeHandle { + cursor: row-resize; + flex: 0 0 auto; + background: $panel-divider-color; + padding: 1px +} + +.mx_ResizeHandle.mx_ResizeHandle_horizontal { + width: 1px; + cursor: col-resize; +} + +.mx_ResizeHandle.mx_ResizeHandle_vertical { + height: 1px; + cursor: row-resize; +} diff --git a/res/css/views/rooms/_RoomTile.scss b/res/css/views/rooms/_RoomTile.scss index a2ca96cda8..4ad057e3d6 100644 --- a/res/css/views/rooms/_RoomTile.scss +++ b/res/css/views/rooms/_RoomTile.scss @@ -15,12 +15,13 @@ limitations under the License. */ .mx_RoomTile { - position: relative; + display: flex; + flex-direction: row; + align-items: center; cursor: pointer; - display: block; height: 40px; - margin: 0px 9px 0px 9px; - + margin: 0px 3px; + position: relative; background-color: $secondary-accent-color; } @@ -31,26 +32,18 @@ limitations under the License. left: -12px; } - -.mx_RoomTile_nameContainer { - display: inline-block; - width: 180px; - height: 24px; -} - -.mx_RoomTile_avatar_container { - position: relative; -} - .mx_RoomTile_avatar { - display: inline-block; + flex: 0; padding-top: 4px; padding-bottom: 4px; padding-left: 14px; padding-right: 12px; width: 32px; height: 32px; - vertical-align: middle; +} + +.mx_RoomTile_avatar_container { + position: relative; } .mx_RoomTile_dm { @@ -62,19 +55,13 @@ limitations under the License. } .mx_RoomTile_name { - display: inline-block; + flex: 1 5 auto; font-size: 14px; font-weight: 600; - position: relative; - width: 165px; - vertical-align: middle; - padding-left: 6px; - padding-right: 6px; - padding-top: 2px; - padding-bottom: 3px; + padding: 6px; color: $roomtile-name-color; white-space: nowrap; - overflow: hidden; + overflow-x: hidden; text-overflow: ellipsis; } @@ -82,25 +69,30 @@ limitations under the License. /* color: rgba(69, 69, 69, 0.5); */ } -.collapsed .mx_RoomTile_nameContainer { - width: 60px; /* colapsed panel width */ -} +.collapsed { + .mx_RoomTile_name { + display: none; + } -.collapsed .mx_RoomTile_name { - display: none; -} + .mx_RoomTile_badge { + min-width: 12px; + border-radius: 16px; + padding: 0px 4px 0px 4px; + z-index: 3; + } -.collapsed .mx_RoomTile_badge { - top: 0px; - min-width: 12px; - border-radius: 16px; - padding: 0px 4px 0px 4px; - z-index: 3; -} + /* Hide the bottom of speech bubble */ + .mx_RoomTile_highlight .mx_RoomTile_badge:after { + display: none; + } -/* Hide the bottom of speech bubble */ -.collapsed .mx_RoomTile_highlight .mx_RoomTile_badge:after { - display: none; + .mx_RoomTile_badge { + display: block; + position: absolute; + height: 15px; + right: 5px; + top: 2px; + } } /* This is the bottom of the speech bubble */ @@ -116,12 +108,8 @@ limitations under the License. } .mx_RoomTile_badge { - display: inline-block; + flex: 0 1 content; min-width: 15px; - height: 15px; - position: absolute; - right: 8px; /*gutter */ - top: 9px; border-radius: 8px; color: $accent-fg-color; font-weight: 600; diff --git a/src/Tinter.js b/src/Tinter.js index cd87d31ca8..de9ae94097 100644 --- a/src/Tinter.js +++ b/src/Tinter.js @@ -155,7 +155,7 @@ class Tinter { tint(primaryColor, secondaryColor, tertiaryColor) { return; - + // eslint-disable-next-line no-unreachable this.currentTint[0] = primaryColor; this.currentTint[1] = secondaryColor; this.currentTint[2] = tertiaryColor; diff --git a/src/components/structures/LeftPanel.js b/src/components/structures/LeftPanel.js index a181482814..ab491cc65e 100644 --- a/src/components/structures/LeftPanel.js +++ b/src/components/structures/LeftPanel.js @@ -192,20 +192,13 @@ var LeftPanel = React.createClass({ topBox = ; } */ - const classes = classNames( - "mx_LeftPanel", - { - "collapsed": this.props.collapsed, - }, - ); - const tagPanelEnabled = !SettingsStore.getValue("TagPanel.disableTagPanel"); const tagPanel = tagPanelEnabled ? :
; const containerClasses = classNames( "mx_LeftPanel_container", "mx_fadable", { - "mx_LeftPanel_container_collapsed": this.props.collapsed, + "collapsed": this.props.collapsed, "mx_LeftPanel_container_hasTagPanel": tagPanelEnabled, "mx_fadable_faded": this.props.disabled, }, @@ -214,7 +207,7 @@ var LeftPanel = React.createClass({ return (
{ tagPanel } -