Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign: resizeable/collapsible sections #2210

Merged
merged 28 commits into from
Oct 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
313956d
make left panel adapt to width
bwindels Sep 24, 2018
928b6d4
add resize handles between 3 main app columns
bwindels Sep 24, 2018
e5d1b33
make resize handles have correct color + bidirectional cursor
bwindels Oct 11, 2018
d6774fd
make the left panel collapse by only adding collapse class on container
bwindels Oct 11, 2018
4f006b0
collapse left panel when 50px past min-width
bwindels Oct 11, 2018
3331a29
put sizing of right panel in RightPanel style file, plus min-width
bwindels Oct 11, 2018
01471ab
Merge branch 'bwindels/redesign' into bwindels/resizehandles
bwindels Oct 16, 2018
c56975d
dont base collapse toggle size on min-width, as it's not available in…
bwindels Oct 16, 2018
99bf6b0
put dm icon back in it's correct location
bwindels Oct 16, 2018
cc29dd0
don't always show badge (leftover)
bwindels Oct 16, 2018
8fa22d6
align badge and make it non-flex when collapsed
bwindels Oct 16, 2018
529845d
group collapsed styles
bwindels Oct 16, 2018
c095e30
provide collapsed callback to also collapse on react side of things
bwindels Oct 16, 2018
30003d8
turn resizer into class to make programmatic interaction/cleanup easier
bwindels Oct 16, 2018
650e19f
don't expose direction, handleIndex to distributor ctor
bwindels Oct 16, 2018
bb184a4
support programmatic access to a distributor (to set size from storage)
bwindels Oct 16, 2018
1d2e1d4
make it work for now, probably want to rename this back later on
bwindels Oct 16, 2018
28ec0f7
onResized callback
bwindels Oct 16, 2018
3a26f0f
only fire onCollapsed once when changing
bwindels Oct 16, 2018
110e452
store/load lhs & rhs sizes to/from localStorage
bwindels Oct 16, 2018
6fdcebb
add copyright headers
bwindels Oct 17, 2018
8d3347b
fix lint
bwindels Oct 17, 2018
d8ead8a
add some description to some classes
bwindels Oct 17, 2018
8d414d0
more docs
bwindels Oct 17, 2018
c926aa2
remove .collapsed class on mx_LeftPanel as the container already has it
bwindels Oct 17, 2018
3552326
more lint fixes
bwindels Oct 17, 2018
eb1ee1c
bind instead of second member var
bwindels Oct 19, 2018
7ece134
dont cause rerender with anon func
bwindels Oct 19, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions res/css/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
39 changes: 18 additions & 21 deletions res/css/structures/_LeftPanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
Expand All @@ -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;
}

Expand All @@ -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;
}

Expand Down
22 changes: 0 additions & 22 deletions res/css/structures/_MatrixChat.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
4 changes: 3 additions & 1 deletion res/css/structures/_RightPanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
81 changes: 37 additions & 44 deletions res/css/structures/_RoomSubList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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 */
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
}
Expand All @@ -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;
Expand Down Expand Up @@ -165,21 +139,13 @@ limitations under the License.
background-color: $secondary-accent-color;
}

.collapsed .mx_RoomSubList_ellipsis {
height: 20px;
}

.mx_RoomSubList_line {
display: inline-block;
width: 159px;
border-top: dotted 2px $accent-color;
vertical-align: middle;
}

.collapsed .mx_RoomSubList_line {
display: none;
}

.mx_RoomSubList_more {
display: inline-block;
text-transform: uppercase;
Expand All @@ -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;
Expand Down Expand Up @@ -233,16 +195,47 @@ 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;
left: 2px;
}


.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;
}
}
32 changes: 32 additions & 0 deletions res/css/views/elements/_ResizeHandle.scss
Original file line number Diff line number Diff line change
@@ -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;
}