-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add radio button group and add theme select for ShortcutGuide
- Loading branch information
Showing
11 changed files
with
135 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
#define IDS_SETTING_DESCRIPTION_PRESS_TIME 101 | ||
#define IDS_SETTING_DESCRIPTION_OVERLAY_OPACITY 102 | ||
#define IDS_SETTING_DESCRIPTION_THEME 103 | ||
#define IDS_SETTING_DESCRIPTION_THEME_LIGHT 104 | ||
#define IDS_SETTING_DESCRIPTION_THEME_DARK 105 | ||
#define IDS_SETTING_DESCRIPTION_THEME_SYSTEM 106 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
40 changes: 40 additions & 0 deletions
40
src/settings-web/src/components/ChoiceGroupSettingsControl.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react'; | ||
import { BaseSettingsControl } from './BaseSettingsControl'; | ||
import { ChoiceGroup } from 'office-ui-fabric-react'; | ||
|
||
export class ChoiceGroupSettingsControl extends BaseSettingsControl { | ||
choiceref:any = null; // Keeps a reference to the corresponding item in the DOM. | ||
|
||
constructor(props:any) { | ||
super(props); | ||
this.choiceref = null; | ||
this.state = { | ||
property_values: props.setting | ||
} | ||
} | ||
|
||
componentWillReceiveProps(props: any) { | ||
// Fully controlled component. | ||
// Reacting to a property change so that the control is redrawn properly. | ||
this.setState({ property_values: props.setting }) | ||
} | ||
|
||
public get_value() : any { | ||
return {'value': this.choiceref.checkedOption.key}; | ||
} | ||
|
||
public render(): JSX.Element { | ||
return ( | ||
<ChoiceGroup | ||
className="defaultChoiceGroup" | ||
defaultSelectedKey={this.state.property_values.value} | ||
options={this.state.property_values.options} | ||
label={this.state.property_values.display_name} | ||
componentRef={(element) => {this.choiceref=element;}} | ||
onChange={()=>{ | ||
this.parent_on_change(); | ||
}} | ||
/> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters