Disabling toggles for Powertoys Run and Keyboard Manager (#2983)

* Disabling toggles for Powertoys Run and Keyboard Manager
This commit is contained in:
Yevhenii Holovachov 2020-05-14 15:09:49 +03:00 committed by GitHub
parent a13c8cb71e
commit e80fac4900
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -61,6 +61,7 @@ export class GeneralSettings extends React.Component <any, any> {
{ Object.keys(power_toys_enabled).map(
(key) => {
let enabled_value=power_toys_enabled[key];
let is_active=this.state.settings.powertoys[key].description.substr(0, 21) !== 'This feature requires';
return <Stack key={key}>
<Stack horizontal tokens={{childrenGap:5}}>
<Label>{key}</Label>
@ -115,7 +116,9 @@ export class GeneralSettings extends React.Component <any, any> {
null
}
<BoolToggleSettingsControl
setting={{value: enabled_value}}
setting={{value: enabled_value && is_active}}
disabled={!is_active}
on_change={this.parent_on_change}
ref={(input) => {this.references[key]=input;}}
/>

File diff suppressed because one or more lines are too long