Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 0104164

Browse files
committed
Approximate the design as proposed
1 parent 2166331 commit 0104164

File tree

4 files changed

+56
-8
lines changed

4 files changed

+56
-8
lines changed

res/css/_common.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ pre, code {
6060
color: $accent-color;
6161
}
6262

63+
.text-muted {
64+
color: $muted-fg-color;
65+
}
66+
6367
b {
6468
// On Firefox, the default weight for `<b>` is `bolder` which results in no bold
6569
// effect since we only have specific weights of our fonts available.
@@ -364,6 +368,11 @@ input[type=text]:focus, input[type=password]:focus, textarea:focus {
364368
.mx_Dialog_buttons {
365369
margin-top: 20px;
366370
text-align: right;
371+
372+
.mx_Dialog_buttons_additive {
373+
// The consumer is responsible for positioning their elements.
374+
float: left;
375+
}
367376
}
368377

369378
/* XXX: Our button style are a mess: buttons that happen to appear in dialogs get special styles applied

res/css/views/dialogs/_WidgetCapabilitiesPromptDialog.scss

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,55 @@ limitations under the License.
1616

1717

1818
.mx_WidgetCapabilitiesPromptDialog {
19+
.text-muted {
20+
font-size: $font-12px;
21+
}
22+
1923
.mx_Dialog_content {
2024
margin-bottom: 16px;
2125
}
2226

2327
.mx_WidgetCapabilitiesPromptDialog_cap {
24-
margin-top: 8px;
28+
margin-top: 20px;
29+
font-size: $font-15px;
30+
line-height: $font-15px;
2531

2632
.mx_WidgetCapabilitiesPromptDialog_byline {
2733
color: $muted-fg-color;
2834
margin-left: 26px;
35+
font-size: $font-12px;
36+
line-height: $font-12px;
2937
}
3038
}
3139

40+
.mx_Dialog_buttons {
41+
margin-top: 40px; // double normal
42+
}
43+
3244
.mx_SettingsFlag {
33-
margin-top: 24px;
45+
line-height: calc($font-14px + 7px + 7px); // 7px top & bottom padding
46+
color: $muted-fg-color;
47+
font-size: $font-12px;
3448

3549
.mx_ToggleSwitch {
3650
display: inline-block;
3751
vertical-align: middle;
3852
margin-right: 8px;
53+
54+
// downsize the switch + ball
55+
width: $font-32px;
56+
height: $font-15px;
57+
58+
59+
&.mx_ToggleSwitch_on > .mx_ToggleSwitch_ball {
60+
left: calc(100% - $font-15px);
61+
}
62+
63+
.mx_ToggleSwitch_ball {
64+
width: $font-15px;
65+
height: $font-15px;
66+
border-radius: $font-15px;
67+
}
3968
}
4069

4170
.mx_SettingsFlag_label {

src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,19 @@ export default class WidgetCapabilitiesPromptDialog extends React.PureComponent<
126126
>
127127
<form onSubmit={this.onSubmit}>
128128
<div className="mx_Dialog_content">
129-
{_t("This widget would like to:")}
129+
<div className="text-muted">{_t("This widget would like to:")}</div>
130130
{checkboxRows}
131-
<LabelledToggleSwitch
132-
value={this.state.rememberSelection}
133-
toggleInFront={true}
134-
onChange={this.onRememberSelectionChange}
135-
label={_t("Remember my selection for this widget")} />
136131
<DialogButtons
137132
primaryButton={_t("Approve")}
138133
cancelButton={_t("Decline All")}
139134
onPrimaryButtonClick={this.onSubmit}
140135
onCancel={this.onReject}
136+
additive={
137+
<LabelledToggleSwitch
138+
value={this.state.rememberSelection}
139+
toggleInFront={true}
140+
onChange={this.onRememberSelectionChange}
141+
label={_t("Remember my selection for this widget")} />}
141142
/>
142143
</div>
143144
</form>

src/components/views/elements/DialogButtons.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ export default class DialogButtons extends React.Component {
5454

5555
// disables only the primary button
5656
primaryDisabled: PropTypes.bool,
57+
58+
// something to stick next to the buttons, optionally
59+
additive: PropTypes.element,
5760
};
5861

5962
static defaultProps = {
@@ -85,8 +88,14 @@ export default class DialogButtons extends React.Component {
8588
</button>;
8689
}
8790

91+
let additive = null;
92+
if (this.props.additive) {
93+
additive = <div className="mx_Dialog_buttons_additive">{this.props.additive}</div>;
94+
}
95+
8896
return (
8997
<div className="mx_Dialog_buttons">
98+
{ additive }
9099
{ cancelButton }
91100
{ this.props.children }
92101
<button type={this.props.primaryIsSubmit ? 'submit' : 'button'}

0 commit comments

Comments
 (0)