Skip to content

Commit 6da2f88

Browse files
committed
Devtools styling tweaks
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent ea9b630 commit 6da2f88

3 files changed

Lines changed: 79 additions & 30 deletions

File tree

‎src/components/views/dialogs/DevtoolsDialog.js‎

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ class GenericEditor extends DevtoolsComponent {
5555
}
5656

5757
textInput(id, label) {
58-
return <div className="mx_UserSettings_profileTableRow">
59-
<div className="mx_UserSettings_profileLabelCell">
60-
<label htmlFor="displayName">{ label }</label>
58+
return <div className="mx_DevTools_inputRow">
59+
<div className="mx_DevTools_inputLabelCell">
60+
<label htmlFor={id}>{ label }</label>
6161
</div>
62-
<div className="mx_UserSettings_profileInputCell">
63-
<input id={id} onChange={this._onChange} value={this.state[id]} className="mx_EditableText" size="32" />
62+
<div className="mx_DevTools_inputCell">
63+
<input id={id} onChange={this._onChange} value={this.state[id]} size="32" />
6464
</div>
6565
</div>;
6666
}
@@ -148,8 +148,8 @@ class SendCustomEvent extends GenericEditor {
148148
<button onClick={this.onBack}>{ _t('Back') }</button>
149149
{ !this.state.message && <button onClick={this._send}>{ _t('Send') }</button> }
150150
{ !this.state.message && !this.props.forceStateEvent && <div style={{float: "right"}}>
151-
<input id="isStateEvent" className="tgl tgl-flip" type="checkbox" onChange={this._onChange} checked={this.state.isStateEvent} />
152-
<label className="tgl-btn" data-tg-off="Event" data-tg-on="State Event" htmlFor="isStateEvent" />
151+
<input id="isStateEvent" className="mx_DevTools_tgl mx_DevTools_tgl-flip" type="checkbox" onChange={this._onChange} checked={this.state.isStateEvent} />
152+
<label className="mx_DevTools_tgl-btn" data-tg-off="Event" data-tg-on="State Event" htmlFor="isStateEvent" />
153153
</div> }
154154
</div>
155155
</div>;
@@ -233,8 +233,8 @@ class SendAccountData extends GenericEditor {
233233
<button onClick={this.onBack}>{ _t('Back') }</button>
234234
{ !this.state.message && <button onClick={this._send}>{ _t('Send') }</button> }
235235
{ !this.state.message && <div style={{float: "right"}}>
236-
<input id="isRoomAccountData" className="tgl tgl-flip" type="checkbox" onChange={this._onChange} checked={this.state.isRoomAccountData} disabled={this.props.forceMode} />
237-
<label className="tgl-btn" data-tg-off="Account Data" data-tg-on="Room Data" htmlFor="isRoomAccountData" />
236+
<input id="isRoomAccountData" className="mx_DevTools_tgl mx_DevTools_tgl-flip" type="checkbox" onChange={this._onChange} checked={this.state.isRoomAccountData} disabled={this.props.forceMode} />
237+
<label className="mx_DevTools_tgl-btn" data-tg-off="Account Data" data-tg-on="Room Data" htmlFor="isRoomAccountData" />
238238
</div> }
239239
</div>
240240
</div>;
@@ -489,8 +489,8 @@ class AccountDataExplorer extends DevtoolsComponent {
489489
<div className="mx_Dialog_buttons">
490490
<button onClick={this.onBack}>{ _t('Back') }</button>
491491
{ !this.state.message && <div style={{float: "right"}}>
492-
<input id="isRoomAccountData" className="tgl tgl-flip" type="checkbox" onChange={this._onChange} checked={this.state.isRoomAccountData} />
493-
<label className="tgl-btn" data-tg-off="Account Data" data-tg-on="Room Data" htmlFor="isRoomAccountData" />
492+
<input id="isRoomAccountData" className="mx_DevTools_tgl mx_DevTools_tgl-flip" type="checkbox" onChange={this._onChange} checked={this.state.isRoomAccountData} />
493+
<label className="mx_DevTools_tgl-btn" data-tg-off="Account Data" data-tg-on="Room Data" htmlFor="isRoomAccountData" />
494494
</div> }
495495
</div>
496496
</div>;
@@ -557,19 +557,26 @@ export default class DevtoolsDialog extends React.Component {
557557

558558
if (this.state.mode) {
559559
body = <div>
560-
<div style={{float: 'left'}}>{ this.state.mode.getLabel() }</div>
561-
<div style={{float: 'right'}}>Room ID: { this.props.roomId }</div>
562-
<div style={{clear: 'both'}} />
560+
<div className="mx_DevTools_label_left">{ this.state.mode.getLabel() }</div>
561+
<div className="mx_DevTools_label_right">Room ID: { this.props.roomId }</div>
562+
<div className="mx_DevTools_label_bottom" />
563563
<this.state.mode onBack={this.onBack} />
564564
</div>;
565565
} else {
566+
const classes = "mx_DevTools_RoomStateExplorer_button";
566567
body = <div>
567-
<div className="mx_Dialog_content">
568-
<div>Room ID: { this.props.roomId }</div>
569-
{ Entries.map((Entry) => {
570-
const label = Entry.getLabel();
571-
return <button key={label} onClick={this._setMode(Entry)}>{ _t(label) }</button>;
572-
}) }
568+
<div>
569+
<div className="mx_DevTools_label_left">{ _t('Toolbox') }</div>
570+
<div className="mx_DevTools_label_right">Room ID: { this.props.roomId }</div>
571+
<div className="mx_DevTools_label_bottom" />
572+
573+
<div className="mx_Dialog_content">
574+
{ Entries.map((Entry) => {
575+
const label = Entry.getLabel();
576+
const onClick = this._setMode(Entry);
577+
return <button className={classes} key={label} onClick={onClick}>{ label }</button>;
578+
}) }
579+
</div>
573580
</div>
574581
<div className="mx_Dialog_buttons">
575582
<button onClick={this.onCancel}>{ _t('Cancel') }</button>

‎src/i18n/strings/en_EN.json‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"What's new?": "What's new?",
7171
"A new version of Riot is available.": "A new version of Riot is available.",
7272
"To return to your account in future you need to <u>set a password</u>": "To return to your account in future you need to <u>set a password</u>",
73+
"Toolbox": "Toolbox",
7374
"Set Password": "Set Password",
7475
"Error encountered (%(errorDetail)s).": "Error encountered (%(errorDetail)s).",
7576
"Checking for an update...": "Checking for an update...",
@@ -106,12 +107,9 @@
106107
"Edit": "Edit",
107108
"Filter results": "Filter results",
108109
"Send Custom Event": "Send Custom Event",
109-
"Send Custom State Event": "Send Custom State Event",
110110
"Send Account Data": "Send Account Data",
111-
"Send Room Account Data": "Send Room Account Data",
112111
"Explore Account Data": "Explore Account Data",
113112
"Explore Room State": "Explore Room State",
114-
"Explore Room Account Data": "Explore Room Account Data",
115113
"Developer Tools": "Developer Tools",
116114
"You have successfully set a password!": "You have successfully set a password!",
117115
"You have successfully set a password and an email address!": "You have successfully set a password and an email address!",

‎src/skins/vector/css/vector-web/views/dialogs/_DevtoolsDialog.scss‎

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,51 @@ limitations under the License.
1818
margin-bottom: 10px;
1919
}
2020

21-
.tgl {
21+
.mx_DevTools_label_left {
22+
float: left;
23+
}
24+
25+
.mx_DevTools_label_right {
26+
float: right;
27+
}
28+
29+
.mx_DevTools_label_bottom {
30+
clear: both;
31+
border-bottom: 1px solid #e5e5e5;
32+
}
33+
34+
.mx_DevTools_inputRow
35+
{
36+
display: table-row;
37+
}
38+
39+
.mx_DevTools_inputLabelCell
40+
{
41+
padding-bottom: 21px;
42+
display: table-cell;
43+
font-weight: bold;
44+
padding-right: 24px;
45+
}
46+
47+
.mx_DevTools_inputCell {
48+
display: table-cell;
49+
padding-bottom: 21px;
50+
width: 240px;
51+
}
52+
53+
.mx_DevTools_inputCell input
54+
{
55+
display: inline-block;
56+
border: 0;
57+
border-bottom: 1px solid $input-underline-color;
58+
padding: 0;
59+
width: 240px;
60+
color: $input-fg-color;
61+
font-family: 'Open Sans', Helvetica, Arial, Sans-Serif;
62+
font-size: 16px;
63+
}
64+
65+
.mx_DevTools_tgl {
2266
display: none;
2367

2468
// add default box-sizing for this scope
@@ -28,14 +72,14 @@ limitations under the License.
2872
& *,
2973
& *:after,
3074
& *:before,
31-
& + .tgl-btn {
75+
& + .mx_DevTools_tgl-btn {
3276
box-sizing: border-box;
3377
&::selection {
3478
background: none;
3579
}
3680
}
3781

38-
+ .tgl-btn {
82+
+ .mx_DevTools_tgl-btn {
3983
outline: 0;
4084
display: block;
4185
width: 7em;
@@ -61,13 +105,13 @@ limitations under the License.
61105
}
62106
}
63107

64-
&:checked + .tgl-btn:after {
108+
&:checked + .mx_DevTools_tgl-btn:after {
65109
left: 50%;
66110
}
67111
}
68112

69-
.tgl-flip {
70-
+ .tgl-btn {
113+
.mx_DevTools_tgl-flip {
114+
+ .mx_DevTools_tgl-btn {
71115
padding: 2px;
72116
transition: all .2s ease;
73117
font-family: sans-serif;
@@ -104,7 +148,7 @@ limitations under the License.
104148
}
105149
}
106150

107-
&:checked + .tgl-btn {
151+
&:checked + .mx_DevTools_tgl-btn {
108152
&:before {
109153
transform: rotateY(180deg);
110154
}

0 commit comments

Comments
 (0)