Skip to content

Commit aaa96f1

Browse files
committed
vicious rewrite of the CSS to support the notifications toolbar, removing all height: 100%'s and letting the flexbox stuff calculate auto-height instead. may have slowed down the rendering, especially when the toolbar is visible
1 parent e03809b commit aaa96f1

9 files changed

Lines changed: 102 additions & 31 deletions

File tree

‎skins/base/css/molecules/MatrixToolbar.css‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ limitations under the License.
1515
*/
1616

1717
.mx_MatrixToolbar {
18+
width: 100%;
1819
text-align: center;
19-
height: 25px;
20-
background-color: #a9dbf4;
21-
border-bottom: 1px solid #000;
20+
background-color: #ff0064;
21+
color: #fff;
22+
font-weight: bold;
2223
padding: 6px;
23-
z-index: 50;
24+
}
25+
26+
.mx_MatrixToolbar button {
27+
margin-left: 12px;
2428
}

‎skins/base/css/molecules/MemberTile.css‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,15 @@ limitations under the License.
3737
background-color: #dbdbdb;
3838
}
3939

40+
.mx_MemberTile_inviteEditing {
41+
display: initial ! important;
42+
}
43+
4044
.mx_MemberTile_inviteEditing .mx_MemberTile_avatar {
4145
display: none;
4246
}
4347

4448
.mx_MemberTile_inviteEditing .mx_MemberTile_name {
45-
position: absolute;
4649
width: 200px;
4750
}
4851

‎skins/base/css/organisms/RoomDirectory.css‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ limitations under the License.
1515
*/
1616

1717
.mx_RoomDirectory {
18-
max-width: 720px;
19-
margin: auto;
18+
width: 720px;
19+
margin-left: auto;
20+
margin-right: auto;
2021
}
2122

2223
.mx_RoomDirectory_input {

‎skins/base/css/organisms/RoomView.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ limitations under the License.
2424
display: -webkit-flex;
2525
display: flex;
2626
width: 100%;
27-
height: 100%;
27+
2828
flex-direction: column;
2929
-webkit-flex-direction: column;
3030
}

‎skins/base/css/organisms/UserSettings.css‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ limitations under the License.
1515
*/
1616

1717
.mx_UserSettings {
18-
max-width: 720px;
19-
margin: auto;
18+
width: 720px;
19+
margin-left: auto;
20+
margin-right: auto;
2021
}

‎skins/base/css/pages/MatrixChat.css‎

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

17+
.mx_MatrixChat_wrapper {
18+
display: -webkit-box;
19+
display: -moz-box;
20+
display: -ms-flexbox;
21+
display: -webkit-flex;
22+
display: flex;
23+
24+
flex-direction: column;
25+
-webkit-flex-direction: column;
26+
27+
width: 100%;
28+
height: 100%;
29+
}
30+
31+
.mx_MatrixToolbar {
32+
-webkit-box-ordinal-group: 1;
33+
-moz-box-ordinal-group: 1;
34+
-ms-flex-order: 1;
35+
-webkit-order: 1;
36+
order: 1;
37+
38+
height: 21px;
39+
}
40+
41+
.mx_MatrixChat_toolbarShowing {
42+
height: auto;
43+
}
44+
1745
.mx_MatrixChat {
18-
position: relative;
1946
width: 100%;
2047
height: 100%;
2148

@@ -24,6 +51,15 @@ limitations under the License.
2451
display: -ms-flexbox;
2552
display: -webkit-flex;
2653
display: flex;
54+
55+
-webkit-box-ordinal-group: 2;
56+
-moz-box-ordinal-group: 2;
57+
-ms-flex-order: 2;
58+
-webkit-order: 2;
59+
order: 2;
60+
61+
-webkit-flex: 1;
62+
flex: 1;
2763
}
2864

2965
.mx_MatrixChat .mx_LeftPanel {
@@ -35,7 +71,6 @@ limitations under the License.
3571

3672
-webkit-flex: 0 0 230px;
3773
flex: 0 0 230px;
38-
height: 100%;
3974
}
4075

4176
.mx_MatrixChat .mx_MatrixChat_middlePanel {
@@ -49,7 +84,20 @@ limitations under the License.
4984
padding-right: 12px;
5085
background-color: #f3f8fa;
5186
width: 100%;
52-
height: 100%;
87+
88+
/* XXX: Hack: apparently if you try to nest a flex-box
89+
* within a non-flex-box within a flex-box, the height
90+
* of the innermost element gets miscalculated if the
91+
* parents are both auto.
92+
* Ideally we'd launch straight into the RoomView at this
93+
* point, but instead we fudge it and make the middlePanel
94+
* flex itself.
95+
*/
96+
display: -webkit-box;
97+
display: -moz-box;
98+
display: -ms-flexbox;
99+
display: -webkit-flex;
100+
display: flex;
53101
}
54102

55103
.mx_MatrixChat .mx_RightPanel {
@@ -62,5 +110,5 @@ limitations under the License.
62110
background-color: #f3f8fa;
63111
-webkit-flex: 0 0 230px;
64112
flex: 0 0 230px;
65-
height: 100%;
113+
height: 100%;
66114
}

‎skins/base/views/organisms/RoomView.js‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ var RoomHeader = ComponentBroker.get('molecules/RoomHeader');
3131
var MessageComposer = ComponentBroker.get('molecules/MessageComposer');
3232
var CallView = ComponentBroker.get("molecules/voip/CallView");
3333
var RoomSettings = ComponentBroker.get("molecules/RoomSettings");
34-
var Notifier = ComponentBroker.get('organisms/Notifier');
35-
var MatrixToolbar = ComponentBroker.get('molecules/MatrixToolbar');
3634
var RoomViewController = require("../../../../src/controllers/organisms/RoomView");
3735

3836
var Loader = require("react-loader");
@@ -143,14 +141,8 @@ module.exports = React.createClass({
143141
roomEdit = <Loader/>;
144142
}
145143

146-
var top_bar;
147-
if (!Notifier.isEnabled()) {
148-
top_bar = <MatrixToolbar />;
149-
}
150-
151144
return (
152145
<div className="mx_RoomView">
153-
{top_bar}
154146
<RoomHeader ref="header" room={this.state.room} editing={this.state.editingRoomSettings}
155147
onSettingsClick={this.onSettingsClick} onSaveClick={this.onSaveClick}/>
156148
<div className="mx_RoomView_auxPanel">

‎skins/base/views/pages/MatrixChat.js‎

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@ var UserSettings = ComponentBroker.get('organisms/UserSettings');
2727
var Register = ComponentBroker.get('templates/Register');
2828
var CreateRoom = ComponentBroker.get('organisms/CreateRoom');
2929
var RoomDirectory = ComponentBroker.get('organisms/RoomDirectory');
30+
var MatrixToolbar = ComponentBroker.get('molecules/MatrixToolbar');
31+
var Notifier = ComponentBroker.get('organisms/Notifier');
3032

3133
var MatrixChatController = require("../../../../src/controllers/pages/MatrixChat");
3234

3335
// should be atomised
3436
var Loader = require("react-loader");
37+
var classNames = require("classnames");
3538

3639
var dis = require("../../../../src/dispatcher");
3740

@@ -72,15 +75,31 @@ module.exports = React.createClass({
7275
break;
7376
}
7477

75-
return (
76-
<div className="mx_MatrixChat">
77-
<LeftPanel selectedRoom={this.state.currentRoom} />
78-
<div className="mx_MatrixChat_middlePanel">
79-
{page_element}
80-
</div>
81-
{right_panel}
82-
</div>
83-
);
78+
if (!Notifier.isEnabled()) {
79+
return (
80+
<div className="mx_MatrixChat_wrapper">
81+
<MatrixToolbar />
82+
<div className="mx_MatrixChat mx_MatrixChat_toolbarShowing">
83+
<LeftPanel selectedRoom={this.state.currentRoom} />
84+
<div className="mx_MatrixChat_middlePanel">
85+
{page_element}
86+
</div>
87+
{right_panel}
88+
</div>
89+
</div>
90+
);
91+
}
92+
else {
93+
return (
94+
<div className="mx_MatrixChat">
95+
<LeftPanel selectedRoom={this.state.currentRoom} />
96+
<div className="mx_MatrixChat_middlePanel">
97+
{page_element}
98+
</div>
99+
{right_panel}
100+
</div>
101+
);
102+
}
84103
} else if (this.state.logged_in) {
85104
return (
86105
<Loader />

‎src/controllers/pages/MatrixChat.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ module.exports = {
169169
page_type: this.PageTypes.RoomDirectory,
170170
});
171171
break;
172+
case 'notifier_enabled':
173+
this.forceUpdate();
174+
break;
172175
}
173176
},
174177

0 commit comments

Comments
 (0)