[old settings] deprecate old settings (#10548)

* [old settings] deprecate old settings

* removed old settings from the pipeline signing process
This commit is contained in:
Enrico Giordani 2021-04-05 02:32:48 -07:00 committed by GitHub
parent b0465bb500
commit 927e947385
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 1 additions and 13125 deletions

View file

@ -150,7 +150,6 @@ build:
- 'os-detection.dll'
- 'PowerToys.exe'
- 'PowerToysInterop.dll'
- 'PowerToysSettings.exe'
- 'Settings\Microsoft.PowerToys.Settings.UI.exe'
- 'Settings\Microsoft.PowerToys.Settings.UI.Lib.dll'
- 'Settings\PowerToys.Settings.dll'

View file

@ -293,8 +293,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "utils", "utils", "{B39DC643
src\common\utils\window.h = src\common\utils\window.h
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "old-settings-ui", "src\settings\old-settings-ui.vcxproj", "{07C389E3-6BC8-41CF-923E-307B1265FA2D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Telemetry", "Telemetry", "{8F62026A-294B-41C6-8839-87463613F216}"
ProjectSection(SolutionItems) = preProject
src\common\Telemetry\ProjectTelemetry.h = src\common\Telemetry\ProjectTelemetry.h
@ -616,10 +614,6 @@ Global
{98537082-0FDB-40DE-ABD8-0DC5A4269BAB}.Debug|x64.Build.0 = Debug|x64
{98537082-0FDB-40DE-ABD8-0DC5A4269BAB}.Release|x64.ActiveCfg = Release|x64
{98537082-0FDB-40DE-ABD8-0DC5A4269BAB}.Release|x64.Build.0 = Release|x64
{07C389E3-6BC8-41CF-923E-307B1265FA2D}.Debug|x64.ActiveCfg = Debug|x64
{07C389E3-6BC8-41CF-923E-307B1265FA2D}.Debug|x64.Build.0 = Debug|x64
{07C389E3-6BC8-41CF-923E-307B1265FA2D}.Release|x64.ActiveCfg = Release|x64
{07C389E3-6BC8-41CF-923E-307B1265FA2D}.Release|x64.Build.0 = Release|x64
{C3A17DCA-217B-462C-BB0C-BE086AF80081}.Debug|x64.ActiveCfg = Debug|x64
{C3A17DCA-217B-462C-BB0C-BE086AF80081}.Debug|x64.Build.0 = Debug|x64
{C3A17DCA-217B-462C-BB0C-BE086AF80081}.Release|x64.ActiveCfg = Release|x64

View file

@ -294,14 +294,7 @@ void run_settings_window(bool showOobeWindow)
// Arg 1: executable path.
std::wstring executable_path = get_module_folderpath();
if (UseNewSettings())
{
executable_path.append(L"\\Settings\\PowerToys.Settings.exe");
}
else
{
executable_path.append(L"\\PowerToysSettings.exe");
}
executable_path.append(L"\\Settings\\PowerToys.Settings.exe");
// Args 2,3: pipe server. Generate unique names for the pipes, if getting a UUID is possible.
std::wstring powertoys_pipe_name(L"\\\\.\\pipe\\powertoys_runner_");

View file

@ -1,31 +0,0 @@
# Logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.DS_Store
node_modules
lib
lib-commonjs
lib-esm
lib-es2015
build
coverage
dist
temp
*.scss.ts
documentation/lib/core/metadata.js
documentation/lib/core/MetadataBlog.js
documentation/website/translated_docs
documentation/website/build/
documentation/website/yarn.lock
documentation/website/i18n/*
# Rush files
common/temp/**
package-deps.json

View file

@ -1,27 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="dist/layout.css" />
<script>
window.output_from_webview = function(arg) {
if (typeof (window.external) !== 'undefined' && ('notify' in window.external)) {
window.external.notify(arg);
}
}
function receive_from_settings_app(arg) {
window.react_app_component.receive_config_msg(JSON.parse(arg));
return '';
}
function exit_settings_app() {
window.react_app_component.receive_exit_request();
return '';
}
window.start_with_dark_theme = true;
</script>
<title>PowerToys Settings</title>
</head>
<body>
<div id="app"></div>
<script src="dist/bundle.js" charset="UTF-8"></script>
</body>
</html>

View file

@ -1,26 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="dist/layout.css" />
<script>
window.output_from_webview = function(arg) {
if (typeof (window.external) !== 'undefined' && ('notify' in window.external)) {
window.external.notify(arg);
}
}
function receive_from_settings_app(arg) {
window.react_app_component.receive_config_msg(JSON.parse(arg));
return '';
}
function exit_settings_app() {
window.react_app_component.receive_exit_request();
return '';
}
</script>
<title>PowerToys Settings</title>
</head>
<body>
<div id="app"></div>
<script src="dist/bundle.js" charset="UTF-8"></script>
</body>
</html>

View file

@ -1,3 +0,0 @@
// @ts-check
const { taskPresets } = require('just-scripts');
taskPresets.webapp();

File diff suppressed because it is too large Load diff

View file

@ -1,57 +0,0 @@
{
"name": "fabricui",
"version": "0.0.1",
"description": "fabricui Package",
"repository": {
"type": "git",
"url": ""
},
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
"sideEffects": false,
"typings": "lib/index.d.ts",
"license": "MIT",
"scripts": {
"preinstall": "npx npm-force-resolutions",
"just": "just-scripts",
"clean": "rimraf build lib lib-commonjs && just-scripts clean",
"build": "rimraf build && just-scripts build --min --production && copy *.html build && copy src\\css\\layout.css build\\dist && react-snap && xcopy build\\* ..\\settings\\settings-html /sy",
"test": "just-scripts test",
"test:update": "just-scripts jest -u",
"test:start": "just-scripts start-test",
"start": "just-scripts start",
"stack:upgrade": "just-scripts upgrade-stack"
},
"reactSnap": {
"include": [
"/index.html",
"/index-dark.html"
]
},
"dependencies": {
"@svgr/webpack": "^4.3.3",
"@uifabric/azure-themes": "^7.5.39",
"@uifabric/styling": "^7.16.17",
"office-ui-fabric-react": "^7.149.4",
"react": "~16.8.0",
"react-dom": "~16.8.0"
},
"devDependencies": {
"@types/jest": "^24.9.1",
"@types/react": "^16.8.25",
"@types/react-dom": "^16.8.5",
"just-scripts": "^0.18.0",
"just-stack-uifabric": "^1.0.2",
"react-snap": "^1.23.0",
"rimraf": "^3.0.2",
"ts-loader": "^8.0.18",
"typescript": "^4.2.3",
"webpack": "^5.26.3"
},
"just": {
"stack": "just-stack-uifabric"
},
"resolutions": {
"mkdirp": "0.5.5"
}
}

View file

@ -1,286 +0,0 @@
import React from 'react';
import {Stack, Text, Nav, DefaultButton, PrimaryButton, ScrollablePane, INavLink, Spinner, SpinnerSize, Dialog, DialogType, DialogFooter, getTheme} from 'office-ui-fabric-react';
import {GeneralSettings} from './GeneralSettings';
import {ModuleSettings} from './ModuleSettings';
import {setup_powertoys_icons} from '../setup_icons';
// Register fabric UI icons and powertoys logos as icons.
setup_powertoys_icons();
export class App extends React.Component <any, any> {
settings_screen_ref:any;
constructor(props: any) {
super(props);
this.settings_screen_ref = null;
this.state = {
data_changed : false,
saving : false,
selected_menu : 'general',
target_selected_menu : '',
show_save_discard_dialog: false,
user_trying_to_exit: false,
settings: {}
}
}
public componentDidMount() {
this.send_message_to_application(JSON.stringify({'refresh':true}));
}
public send_message_to_application(msg: string) {
(window as any).output_from_webview(msg);
}
public receive_config_msg(config: any):void {
let current_selected_menu = this.state.selected_menu;
if(!config.hasOwnProperty('powertoys') || !config.powertoys.hasOwnProperty(current_selected_menu)) {
current_selected_menu='general';
}
this.setState({
settings: config,
selected_menu: current_selected_menu,
data_changed: false,
saving: false,
show_save_discard_dialog: false
});
if(this.settings_screen_ref) {
this.settings_screen_ref.forceUpdate();
}
}
public receive_exit_request(): void {
// Settings application wants to close.
// Prompt the user if there are possible unsaved changes.
if(this.state.data_changed) {
this.show_save_exit_dialog();
} else {
// Application can exit.
this.send_message_to_application('exit');
}
}
private show_save_exit_dialog = () : void => {
this.setState({
show_save_discard_dialog: true,
user_trying_to_exit: true
});
}
private on_setting_change = (): void => {
this.setState({data_changed: true});
}
private show_save_discard_dialog = (target_selected_menu: string): void => {
this.setState({
target_selected_menu: target_selected_menu,
show_save_discard_dialog: true,
user_trying_to_exit: false
});
}
private save_clicked = (): void => {
// output_from_webview should be declared in index.html
this.setState({saving : true});
(window as any).output_from_webview(JSON.stringify(this.settings_screen_ref.get_data()));
};
private close_save_discard_dialog = (): void => {
if (this.state.user_trying_to_exit) {
this.send_message_to_application('cancel-exit');
}
this.setState({ show_save_discard_dialog: false });
};
private save_save_discard_dialog = (): void => {
if (this.state.user_trying_to_exit) {
this.send_message_to_application('cancel-exit');
}
this.setState({ show_save_discard_dialog: false });
this.save_clicked();
};
private discard_save_discard_dialog = (): void => {
if (this.state.user_trying_to_exit) {
this.send_message_to_application('exit');
}
this.setState({
show_save_discard_dialog: false,
selected_menu: this.state.target_selected_menu,
data_changed: false,
saving: false
});
};
public render(): JSX.Element {
const powertoys_dict = this.state.settings.powertoys;
let powertoys_links = [];
for(let powertoy_key in powertoys_dict) {
if(powertoys_dict.hasOwnProperty(powertoy_key)) {
powertoys_links.push({
name: powertoys_dict[powertoy_key].name,
key: powertoy_key,
url:'',
icon: powertoys_dict[powertoy_key].icon_key || 'CircleRing'
});
}
}
const theme = getTheme()
return (
<div className='body' style={{stroke: theme.palette.black}}>
<div className='sidebar' style={{backgroundColor: theme.palette.neutralLighter, color: theme.palette.black}}>
<Nav
selectedKey= {this.state.selected_menu}
onLinkClick = {
(ev?: React.MouseEvent<HTMLElement,MouseEvent>, item?: INavLink) => {
let item_menu_key: string|null = ((item && item.key)||null);
if(item_menu_key && item_menu_key!=this.state.selected_menu) {
if(this.state.data_changed) {
// There are data changes. Don't change screen until the user confirms.
ev&&ev.preventDefault();
this.show_save_discard_dialog(item_menu_key);
} else {
this.setState({selected_menu : item_menu_key});
}
}
}
}
styles = {{
navItems: { margin : '0'},
compositeLink: {
backgroundColor : theme.palette.neutralLighter,
color: theme.palette.neutralPrimary,
selectors: {
'&.is-selected button' : {
backgroundColor: theme.palette.neutralLight,
color: theme.palette.neutralPrimaryAlt,
fontWeight: 'bold'
},
'&:hover button.ms-Nav-link' : {
backgroundColor: theme.palette.neutralLight,
color: theme.palette.neutralPrimary
},
'i.ms-Button-icon' : {
color: theme.palette.neutralPrimary,
fontWeight: 'normal',
paddingLeft: '5px',
paddingRight: '5px'
},
'.ms-Button-icon > svg' : {
paddingTop: '2px'
},
'&:hover i.ms-Button-icon' : {
color: theme.palette.neutralPrimary,
},
'&:active i.ms-Button-icon' : {
color: theme.palette.neutralPrimary,
},
},
},
}}
groups = {[
{
links: [
{ name: 'General Settings', key:'general', url:'', icon: 'Settings' }
].
concat(powertoys_links)
}
]}
/>
</div>
<div className='editorzone' style={{backgroundColor: theme.palette.white, color: theme.palette.black}}>
<div className='editorhead'>
<div className='editortitle'>
<Text
variant='xxLarge'
styles= {{ root: { display:'block', whiteSpace:'no-wrap', overflow:'hidden', textOverflow:'ellipsis' }}}
>
{ this.state.selected_menu!='general' ?
powertoys_dict[this.state.selected_menu].name + " Settings" :
"PowerToys General Settings"
}
</Text>
</div>
<div className='editorheadbuttons'>
<Stack horizontal={true} tokens={{childrenGap:16}}>
<PrimaryButton
styles={{
root: {
minWidth: '100px'
}
}}
disabled = { (!this.state.data_changed) || this.state.saving}
text= {this.state.saving?'Saving':'Save'}
onClick={this.save_clicked}
>
{this.state.saving ? <Spinner size={SpinnerSize.small}/> : <span/>}
</PrimaryButton>
</Stack>
</div>
</div>
<div className='editorbody'>
<ScrollablePane
styles= {{
contentContainer: {
paddingTop: '16px',
paddingLeft: '16px',
paddingRight: '16px'
// padding bottom will be applied by an empty span in the contents, for edge compatibility.
}
}}
>
{
(() => {
if(this.state.selected_menu === 'general' && this.state.settings.hasOwnProperty('general')) {
return <GeneralSettings
key="general"
settings_key="general"
settings={this.state.settings}
on_change={this.on_setting_change}
ref={(input:any) => {this.settings_screen_ref = input;}}
/>
} else if( this.state.settings.hasOwnProperty('powertoys') && this.state.selected_menu in this.state.settings.powertoys) {
return <ModuleSettings
key={this.state.selected_menu}
settings_key={this.state.selected_menu}
powertoy={this.state.settings.powertoys[this.state.selected_menu]}
on_change={this.on_setting_change}
ref={(input:any) => {this.settings_screen_ref = input;}}
/>
}
})()
}
</ScrollablePane>
</div>
</div>
<Dialog
hidden={!this.state.show_save_discard_dialog}
onDismiss={this.close_save_discard_dialog}
dialogContentProps={{
type: DialogType.normal,
title: 'Changes not saved',
subText: this.state.user_trying_to_exit ?
'Would you like to save your changes or exit the settings?' :
'Would you like to save or discard your changes?'
}}
modalProps={{
isBlocking: true,
styles: { main: { maxWidth: 450 } }
}}
>
<DialogFooter
styles={{
actionsRight: {
textAlign:'center'
}
}}
>
<PrimaryButton onClick={this.save_save_discard_dialog} text="Save" />
<PrimaryButton
onClick={this.discard_save_discard_dialog}
text={this.state.user_trying_to_exit ? "Exit" : "Discard"}
/>
<DefaultButton onClick={this.close_save_discard_dialog} text="Cancel" />
</DialogFooter>
</Dialog>
</div>
);
}
};

View file

@ -1,12 +0,0 @@
import React from 'react';
export class BaseSettingsControl extends React.Component <any, any> {
parent_on_change: Function;
constructor(props:any) {
super(props);
this.parent_on_change=props.on_change;
}
public get_value():any {
return null;
}
}

View file

@ -1,48 +0,0 @@
import React from 'react';
import {BaseSettingsControl} from './BaseSettingsControl';
import { Toggle } from 'office-ui-fabric-react';
export class BoolToggleSettingsControl extends BaseSettingsControl {
toggleref:any = null;
constructor(props:any) {
super(props);
this.toggleref = null;
this.state={
property_values: props.setting
}
}
componentWillReceiveProps(props: any) {
this.setState({ property_values: props.setting })
}
public get_value() : any {
return {value: this.toggleref.checked};
}
public render(): JSX.Element {
return (
<Toggle
disabled={this.props.disabled}
onChange={
(_event,_check) => {
this.setState( (prev_state:any) => ({
property_values: {
...(prev_state.property_values),
value: _check
}
})
);
this.parent_on_change();
}
}
checked={this.state.property_values.value}
label={this.state.property_values.display_name}
onText="On"
offText="Off"
componentRef= {(input) => {this.toggleref=input;}}
/>
);
}
}

View file

@ -1,43 +0,0 @@
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.
selected:any;
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 })
this.selected = props.setting.value;
}
public get_value() : any {
return {'value': this.selected};
}
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={(ev:any, option:any)=>{
this.selected = option.key;
this.parent_on_change();
}}
/>
);
}
}

View file

@ -1,44 +0,0 @@
import React from 'react';
import {BaseSettingsControl} from './BaseSettingsControl';
import { ColorPicker, Stack, Label, getColorFromString, IColor } from 'office-ui-fabric-react';
export class ColorPickerSettingsControl extends BaseSettingsControl {
colorpickerref:any = null;
constructor(props:any) {
super(props);
this.colorpickerref = null;
this.state={
property_values: props.setting
}
}
componentWillReceiveProps(props: any) {
this.setState({ property_values: props.setting })
}
public get_value() : any {
return {value: this.colorpickerref.color.str};
}
public render(): JSX.Element {
let current_color : IColor | undefined = getColorFromString(this.state.property_values.value);
return (
<Stack>
<Label>{this.state.property_values.display_name}</Label>
<ColorPicker
styles= {{
panel: {padding:0}
}}
color={current_color===undefined?"#000000":current_color}
componentRef= {(input) => {this.colorpickerref=input;}}
alphaSliderHidden = {true}
onChange = { () => {
this.parent_on_change();
}
}
/>
</Stack>
);
}
}

View file

@ -1,73 +0,0 @@
import React from 'react';
import {BaseSettingsControl} from './BaseSettingsControl';
import {Label, Link, Stack, PrimaryButton, Text } from 'office-ui-fabric-react';
export class CustomActionSettingsControl extends BaseSettingsControl {
colorpickerref:any = null;
constructor(props:any) {
super(props);
this.colorpickerref = null;
this.state={
property_values: props.setting,
name: props.action_name
}
}
componentWillReceiveProps(props: any) {
this.setState({
property_values: props.setting,
name:props.action_name
});
}
public get_value() : any {
return {value: this.state.property_values.value};
}
public render(): JSX.Element {
return (
<Stack>
{
this.state.property_values.display_name ?
<Label>{this.state.property_values.display_name}</Label>
: null
}
<Stack horizontal tokens={{childrenGap:5}}>
{
this.state.property_values.value ?
<Text styles ={{
root: {
paddingBottom: '0.5em'
}
}}>{this.state.property_values.value}</Text>
: <span/>
}
{
this.state.property_values.help_link_url && this.state.property_values.help_link_text ?
<Link
styles = {{
root: {
alignSelf:'center',
paddingBottom: '0.5em'
}
}}
href={ this.state.property_values.help_link_url }
target='_blank'
>{ this.state.property_values.help_link_text }</Link>
: <span/>
}
</Stack>
<PrimaryButton
styles={{
root: {
alignSelf: 'start'
}
}}
text={this.state.property_values.button_text}
onClick={()=>this.props.action_callback(this.state.name, this.state.property_values)}
/>
</Stack>
);
}
}

View file

@ -1,47 +0,0 @@
import React from 'react';
import { BaseSettingsControl } from './BaseSettingsControl';
import { Dropdown } from 'office-ui-fabric-react';
export class DropdownSettingsControl extends BaseSettingsControl {
dropref:any = null; // Keeps a reference to the corresponding item in the DOM.
constructor(props:any) {
super(props);
this.dropref = 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 {
if (this.dropref.selectedOptions.length === 0) {
return null;
} else {
return {'value': this.dropref.selectedOptions[0].key};
}
}
public render(): JSX.Element {
return (
<Dropdown
styles={{ dropdown: {
width: '350px',
alignSelf: 'start'
} }}
defaultSelectedKey={this.state.property_values.value}
options={this.state.property_values.options}
label={this.state.property_values.display_name}
componentRef={(element) => {this.dropref=element;}}
onChange={()=>{
this.parent_on_change();
}}
/>
);
}
}

View file

@ -1,300 +0,0 @@
import React from 'react';
import { Stack, Text, PrimaryButton, Label, Link, loadTheme } from 'office-ui-fabric-react';
import { BoolToggleSettingsControl } from './BoolToggleSettingsControl'
import { ChoiceGroupSettingsControl } from './ChoiceGroupSettingsControl'
import { Separator } from 'office-ui-fabric-react/lib/Separator';
import { CustomActionSettingsControl } from './CustomActionSettingsControl';
export class GeneralSettings extends React.Component <any, any> {
references: any = {};
download_updates_automatically_reference: any;
startup_reference: any;
elevated_reference: any;
restart_reference: any;
theme_reference: any;
parent_on_change: Function;
constructor(props: any) {
super(props);
this.references = {};
this.download_updates_automatically_reference = null;
this.startup_reference = null;
this.elevated_reference = null;
this.restart_reference = null;
this.parent_on_change = props.on_change;
this.state = {
settings_key: props.settings_key,
settings: props.settings,
}
}
shouldComponentUpdate(nextProps:any, nextState:any) {
// This component and its children manage their state.
// React only to state changes when forceUpdate is called by the App component.
return false;
}
componentWillReceiveProps(props: any) {
this.setState({ settings: props.settings })
}
public get_data(): any {
let enabled : any = {};
Object.keys(this.references).forEach(key => {
enabled[key]=this.references[key].get_value().value;
});
let result : any = {};
result[this.state.settings_key]= {
download_updates_automatically: this.download_updates_automatically_reference != null && this.download_updates_automatically_reference.get_value().value,
startup: this.startup_reference.get_value().value,
run_elevated: this.elevated_reference != null && this.elevated_reference.get_value().value,
theme: this.theme_reference.get_value().value,
enabled: enabled
};
return result;
}
public render(): JSX.Element {
let power_toys_enabled = this.state.settings.general.enabled;
return (
<Stack tokens={{childrenGap:20}}>
<Text variant='xLarge'>Available PowerToys</Text>
{
<span style={{color:"#c50500", fontWeight: "bold", fontSize: "17px" }} dangerouslySetInnerHTML={{__html: "Next release of PowerToys will require Windows 10 version 1903 (May 2019 Update) or newer to run." }} />
}
{ 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>
{(
this.state.settings.powertoys &&
this.state.settings.powertoys.hasOwnProperty(key) &&
this.state.settings.powertoys[key].hasOwnProperty('overview_link'))
?
<Link
styles = {{
root: {
alignSelf:'center'
}
}}
href={this.state.settings.powertoys[key].overview_link}
target='_blank'
>(Overview)</Link>
:
null
}
{(
this.state.settings.powertoys &&
this.state.settings.powertoys.hasOwnProperty(key) &&
this.state.settings.powertoys[key].hasOwnProperty('video_link'))
?
<Link
styles = {{
root: {
alignSelf:'center'
}
}}
href={this.state.settings.powertoys[key].video_link}
target='_blank'
>(Video)</Link>
:
null
}
</Stack>
{(
this.state.settings.powertoys &&
this.state.settings.powertoys.hasOwnProperty(key) &&
this.state.settings.powertoys[key].hasOwnProperty('description'))
?
<Text
styles = {{
root: {
paddingBottom: '5px'
}
}}
>{this.state.settings.powertoys[key].description}</Text>
:
null
}
<BoolToggleSettingsControl
setting={{value: enabled_value && is_active}}
disabled={!is_active}
on_change={this.parent_on_change}
ref={(input) => {this.references[key]=input;}}
/>
</Stack>;
})
}
<Separator />
<Text variant='xLarge'>General</Text>
{this.state.settings.general.is_admin &&
(<Stack>
<Label>Download updates automatically (Except on metered connections)</Label>
<BoolToggleSettingsControl
setting={{value: this.state.settings.general.download_updates_automatically}}
disabled={!this.state.settings.general.is_admin}
on_change={this.parent_on_change}
ref={(input) => {this.download_updates_automatically_reference=input;}}
/>
</Stack>)}
<Stack>
{this.state.settings.general.startup_disabled_reason != null &&
<span style={{color:"#c50500"}} dangerouslySetInnerHTML={{__html: this.state.settings.general.startup_disabled_reason }} />
}
<Label>Run at Startup</Label>
<BoolToggleSettingsControl
disabled={this.state.settings.general.startup_disabled_reason}
setting={{value: this.state.settings.general.startup}}
on_change={this.parent_on_change}
ref={(input) => {this.startup_reference=input;}}
/>
</Stack>
{this.state.settings.general.is_elevated && (<Label>Currently running as administrator</Label>)}
{this.state.settings.general.is_admin &&
(<BoolToggleSettingsControl
setting={{display_name: this.state.settings.general.is_elevated ? 'Always run as administrator' : 'Always run as administrator (Restart as administrator to change this)', value: this.state.settings.general.run_elevated}}
disabled={!this.state.settings.general.is_elevated}
on_change={this.parent_on_change}
ref={(input) => {this.elevated_reference=input;}}
/>)
}
{this.state.settings.general.is_admin && !this.state.settings.general.is_elevated &&
(<CustomActionSettingsControl
setting={{
display_name: '',
value: 'Running as user. Do you wish to run as administrator instead?',
button_text: 'Restart as administrator',
help_link_url: "https://aka.ms/powertoysDetectedElevatedHelp",
help_link_text: "(Learn more about Admin mode)"
}}
action_name={'restart_elevation'}
action_callback={(action_name: any, value:any) => {
(window as any).output_from_webview(JSON.stringify({
action: {
general: {
action_name,
value
}
}
}));
}}
ref={(input) => {this.restart_reference=input;}}
/>)
}
<ChoiceGroupSettingsControl
setting={{display_name: 'Choose Settings color',
value: this.state.settings.general.theme,
options: [
{ key: 'system', text: 'System default app mode'},
{ key: 'light', text: 'Light' },
{ key: 'dark', text: 'Dark' }
]}}
on_change={() => {
const dark_mode = this.theme_reference.get_value().value === 'dark' ||
(this.theme_reference.get_value().value === 'system' && this.state.settings.general.system_theme === 'dark');
if (dark_mode) {
loadTheme({
palette: {
themePrimary: '#0088e4',
themeLighterAlt: '#000509',
themeLighter: '#001624',
themeLight: '#002944',
themeTertiary: '#005288',
themeSecondary: '#0078c8',
themeDarkAlt: '#1793e6',
themeDark: '#38a3ea',
themeDarker: '#69baef',
neutralLighterAlt: '#0b0b0b',
neutralLighter: '#151515',
neutralLight: '#252525',
neutralQuaternaryAlt: '#2f2f2f',
neutralQuaternary: '#373737',
neutralTertiaryAlt: '#595959',
neutralTertiary: '#eaeaea',
neutralSecondary: '#eeeeee',
neutralPrimaryAlt: '#f1f1f1',
neutralPrimary: '#e0e0e0',
neutralDark: '#f8f8f8',
black: '#fbfbfb',
white: '#000000',
}
});
} else {
loadTheme({
palette: {
themePrimary: '#0078d4',
themeLighterAlt: '#f3f9fd',
themeLighter: '#d0e7f8',
themeLight: '#a9d3f2',
themeTertiary: '#5ca9e5',
themeSecondary: '#1a86d9',
themeDarkAlt: '#006cbe',
themeDark: '#005ba1',
themeDarker: '#004377',
neutralLighterAlt: '#f8f8f8',
neutralLighter: '#f4f4f4',
neutralLight: '#eaeaea',
neutralQuaternaryAlt: '#dadada',
neutralQuaternary: '#d0d0d0',
neutralTertiaryAlt: '#c8c8c8',
neutralTertiary: '#bab8b7',
neutralSecondary: '#a3a2a0',
neutralPrimaryAlt: '#8d8b8a',
neutralPrimary: '#323130',
neutralDark: '#605e5d',
black: '#494847',
white: '#ffffff',
}
});
}
this.parent_on_change();
}}
ref={(input) => {this.theme_reference=input;}}
/>
<Stack>
<Text variant='xLarge'>About PowerToys (Preview)</Text>
<Label>Version {this.state.settings.general.powertoys_version}</Label>
{
<span style={{color:"#c50500", fontWeight: "bold", fontSize: "17px" }} dangerouslySetInnerHTML={{__html: "Next release of PowerToys will require Windows 10 version 1903 (May 2019 Update) or newer to run." }} />
}
<PrimaryButton
styles={{
root: {
alignSelf: "start"
}
}}
href='https://github.com/microsoft/PowerToys/releases'
target='_blank'
>Check for updates</PrimaryButton>
<Link
href="https://github.com/microsoft/PowerToys/issues/new?assignees=&labels=&template=bug_report.md&title="
target='_blank'
styles = {{
root: {
paddingTop: '10px'
}
}}
>Report a bug</Link>
<Link
href="https://github.com/microsoft/PowerToys/issues/new?assignees=&labels=&template=feature_request.md&title="
target='_blank'
>Request a feature</Link>
<Link
href="https://github.com/microsoft/PowerToys#privacy-statement"
target='_blank'
>Privacy statement</Link>
</Stack>
{/* An empty span to always give 30px padding in Edge. */}
<span />
</Stack>
)
}
}

View file

@ -1,105 +0,0 @@
import React from 'react';
import {BaseSettingsControl} from './BaseSettingsControl';
import { TextField } from 'office-ui-fabric-react';
function makeDisplayValue(value : any) : string {
if (!value) {
return '(none)';
}
let keyparts = [];
if (value.win) {
keyparts.push('Win');
}
if (value.ctrl) {
keyparts.push('Ctrl');
}
if (value.alt) {
keyparts.push('Alt');
}
if (value.shift) {
keyparts.push('Shift');
}
keyparts.push(value.key);
return keyparts.join(' + ');
}
export class HotkeySettingsControl extends BaseSettingsControl {
textref:any = null; // Keeps a reference to the corresponding TextField in the DOM.
constructor(props:any) {
super(props);
this.textref = null;
this.state = {
property_values: props.setting,
display_value : makeDisplayValue(props.setting.value)
}
}
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 {
// Returns the TextField value.
return {value: this.state.property_values.value};
}
public render(): JSX.Element {
// Renders a UI Fabric TextField.
return (
<TextField
styles={{ fieldGroup: {
width: '350px',
alignSelf: 'start'
}}}
onKeyDown = {
(_event) => {
_event.preventDefault();
if (_event.key === 'Meta' ||
_event.key === 'Control' ||
_event.key === 'Shift' ||
_event.key === 'Alt') {
return;
}
let new_value = {
win : _event.metaKey,
ctrl : _event.ctrlKey,
alt : _event.altKey,
shift : _event.shiftKey,
key : _event.key,
code : _event.keyCode,
};
if (new_value.key === ' ') {
new_value.key = 'Space';
}
if (new_value.key === '~~') {
new_value.key = '~';
}
if (!new_value.key || new_value.key === 'Unidentified') {
new_value.key = `(Key ${new_value.code})`;
}
if (new_value.key.length === 1) {
new_value.key = new_value.key.toLocaleUpperCase();
}
this.setState( (prev_state:any) => ({
property_values: {
...(prev_state.property_values),
value: new_value
},
display_value: makeDisplayValue(new_value)
})
);
this.parent_on_change();
}
}
onKeyUp = {() => {}}
value={this.state.display_value}
label={this.state.property_values.display_name}
componentRef= {(input) => {this.textref=input;}}
/>
);
}
}

View file

@ -1,98 +0,0 @@
import React from 'react';
import {BaseSettingsControl} from './BaseSettingsControl';
import { SpinButton } from 'office-ui-fabric-react';
import { Position } from 'office-ui-fabric-react/lib/utilities/positioning';
export class IntSpinnerSettingsControl extends BaseSettingsControl {
spinbuttonref:any = null;
constructor(props:any) {
super(props);
this.spinbuttonref = null;
this.state={
property_values: props.setting
}
}
componentWillReceiveProps(props: any) {
this.setState({ property_values: props.setting });
}
public get_value() : any {
return {value: parseInt(this.spinbuttonref.value)};
}
public render(): JSX.Element {
return (
<SpinButton
styles= {{
spinButtonWrapperTopBottom: {
maxWidth:'250px',
alignSelf: 'start'
},
input: {
// The input area of the SpinButton overlaps the border, causing
// graphical issues depending on the Display scaling settings.
// Removing background color fixes the graphical issues.
backgroundColor: 'transparent',
},
}}
value={this.state.property_values.value}
onValidate={(value: string) => {
if(value.trim().length === 0 || isNaN(+value)) {
value=String(this.state.property_values.value);
} else if (Number(value)<this.spinbuttonref.props.min) {
value=String(this.spinbuttonref.props.min);
} else if (Number(value)>this.spinbuttonref.props.max) {
value=String(this.spinbuttonref.props.max);
}
this.setState( (prev_state:any) => ({
property_values: {
...(prev_state.property_values),
value: parseInt(value)
}
}));
this.parent_on_change();
return value;
}}
onIncrement={(value: string) => {
if (Number(value) + this.spinbuttonref.props.step > this.spinbuttonref.props.max) {
value = String(this.spinbuttonref.props.max);
} else {
value = String(+value + this.spinbuttonref.props.step) ;
}
this.setState( (prev_state:any) => ({
property_values: {
...(prev_state.property_values),
value: parseInt(value)
}
}));
this.parent_on_change();
return value;
}}
onDecrement={(value: string) => {
if (Number(value) - this.spinbuttonref.props.step < this.spinbuttonref.props.min) {
value = String(this.spinbuttonref.props.min);
} else {
value = String(+value - this.spinbuttonref.props.step) ;
}
this.setState( (prev_state:any) => ({
property_values: {
...(prev_state.property_values),
value: parseInt(value)
}
}));
this.parent_on_change();
return value;
}}
precision={0}
step={this.state.property_values.step || 1}
min={this.state.property_values.min || 0}
max={this.state.property_values.max || 999999999}
label={this.state.property_values.display_name}
labelPosition={Position.top}
componentRef= {(input) => {this.spinbuttonref=input;}}
/>
);
}
}

View file

@ -1,180 +0,0 @@
import React from 'react';
import {Stack, Text, Link} from 'office-ui-fabric-react';
import {BoolToggleSettingsControl} from './BoolToggleSettingsControl';
import {StringTextSettingsControl} from './StringTextSettingsControl';
import {IntSpinnerSettingsControl} from './IntSpinnerSettingsControl';
import {ColorPickerSettingsControl} from './ColorPickerSettingsControl';
import {CustomActionSettingsControl} from './CustomActionSettingsControl';
import {HotkeySettingsControl} from './HotkeySettingsControl';
import {ChoiceGroupSettingsControl} from './ChoiceGroupSettingsControl';
import {DropdownSettingsControl} from './DropdownSettingsControl';
export class ModuleSettings extends React.Component <any, any> {
references: any;
parent_on_change: Function;
constructor(props: any) {
super(props);
this.references={};
this.parent_on_change = props.on_change;
this.state = {
settings_key: props.settings_key,
powertoy: props.powertoy,
}
}
shouldComponentUpdate(nextProps:any, nextState:any) {
// This component and its children manage their state.
// React only to state changes when forceUpdate is called by the App component.
return false;
}
componentWillReceiveProps(props: any) {
this.setState({ powertoy: props.powertoy })
}
public get_data(): any {
let properties : any = {};
Object.keys(this.references).forEach(key => {
properties[key]= this.references[key].get_value();
});
let result : any = {};
result[this.state.settings_key] = {
name: this.state.powertoy.name,
properties:properties
};
return {powertoys: result};
}
private call_custom_action(action_name: any, action_values: any) {
let result = {action: {
[this.state.settings_key]: {
action_name: action_name,
value: action_values.value
}
}};
(window as any).output_from_webview(JSON.stringify(result));
}
public render(): JSX.Element {
let power_toys_properties = this.state.powertoy.properties;
return (
<Stack tokens={{childrenGap:20}}>
<Stack>
<Text variant='large'>{this.state.powertoy.description}</Text>
{ this.state.powertoy.hasOwnProperty('overview_link') || this.state.powertoy.hasOwnProperty('video_link') ? <br/> : null }
{
this.state.powertoy.hasOwnProperty('overview_link')
?
<Stack horizontal tokens={{childrenGap:5}}>
<Link
styles = {{
root: {
alignSelf:'center'
}
}}
href={this.state.powertoy.overview_link}
target='_blank'
>Module overview</Link>
</Stack>
:
null
}
{
this.state.powertoy.hasOwnProperty('video_link')
?
<Stack horizontal tokens={{childrenGap:5}}>
<Link
styles = {{
root: {
alignSelf:'center'
}
}}
href={this.state.powertoy.video_link} target='_blank'>Video demo</Link>
</Stack>
:
null
}
</Stack>
{
Object.keys(power_toys_properties).
sort(function(a, b) {
return ( // Order powertoys settings
(power_toys_properties[a].order || 0) -
(power_toys_properties[b].order || 0)
)
}).
map((key) => {
switch(power_toys_properties[key].editor_type) {
case 'bool_toggle':
return <BoolToggleSettingsControl
setting={power_toys_properties[key]}
key={key}
on_change={this.parent_on_change}
ref={(input) => {this.references[key]=input;}}
/>;
case 'string_text':
return <StringTextSettingsControl
setting = {power_toys_properties[key]}
key={key}
on_change={this.parent_on_change}
ref={(input) => {this.references[key]=input;}}
/>;
case 'int_spinner':
return <IntSpinnerSettingsControl
setting = {power_toys_properties[key]}
key={key}
on_change={this.parent_on_change}
ref={(input) => {this.references[key]=input;}}
/>;
case 'color_picker':
return <ColorPickerSettingsControl
setting = {power_toys_properties[key]}
key={key}
on_change={this.parent_on_change}
ref={(input) => {this.references[key]=input;}}
/>;
case 'custom_action':
return <CustomActionSettingsControl
setting={power_toys_properties[key]}
action_name={key}
action_callback={(action_name: any, action_values:any) => {this.call_custom_action(action_name, action_values);} }
key={key}
ref={(input) => {this.references[key]=input;}}
/>;
case 'hotkey':
return <HotkeySettingsControl
setting = {power_toys_properties[key]}
key={key}
on_change={this.parent_on_change}
ref={(input) => {this.references[key]=input;}}
/>;
case 'choice_group':
return <ChoiceGroupSettingsControl
setting = {power_toys_properties[key]}
key={key}
on_change={this.parent_on_change}
ref={(input) => {this.references[key]=input;}}
/>;
case 'dropdown':
return <DropdownSettingsControl
setting = {power_toys_properties[key]}
key={key}
on_change={this.parent_on_change}
ref={(input) => {this.references[key]=input;}}
/>;
case 'header_large':
return <Text
variant='large'
className="SubHeader">{power_toys_properties[key].value}</Text>;
default:
return null;
}
})
}
{/* An empty span to always give 30px padding in Edge. */}
<span/>
</Stack>
)
}
}

View file

@ -1,57 +0,0 @@
import React from 'react';
import {BaseSettingsControl} from './BaseSettingsControl';
import { TextField } from 'office-ui-fabric-react';
export class StringTextSettingsControl extends BaseSettingsControl {
textref:any = null; // Keeps a reference to the corresponding TextField in the DOM.
constructor(props:any) {
super(props);
this.textref = null;
this.state={
property_values: props.setting,
multiline: !!props.setting.multiline
}
}
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 {
// Returns the TextField value.
return {value: this.textref.value};
}
public render(): JSX.Element {
// Renders a UI Fabric TextField.
return (
<TextField
styles={{ fieldGroup: {
width: '350px',
alignSelf: 'start'
}}}
onChange = {
(_event,_new_value) => {
// Updates the state with the new value introduced in the TextField.
this.setState( (prev_state:any) => ({
property_values: {
...(prev_state.property_values),
value: _new_value
}
})
);
// Signal the parent that the user changed a value.
this.parent_on_change();
}
}
multiline={this.state.multiline}
value={this.state.property_values.value}
label={this.state.property_values.display_name}
componentRef= {(input) => {this.textref=input;}}
/>
);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

View file

@ -1,63 +0,0 @@
.body {
display: flex;
flex-direction: row;
height: 100%;
}
.body .sidebar {
order: -1;
max-width: 228px;
min-width: 228px;
flex-basis: 228px;
display: flex;
flex-direction: column;
}
.body .sidebar.collapsed {
max-width: 48px;
min-width: 48px;
flex-basis: 48px;
}
.body .editorzone {
display: flex;
flex-direction: column;
flex-grow: 1;
}
.body .editorzone .editorhead {
display: flex;
flex-direction: row;
flex-grow: 1;
min-height: 50px;
max-height: 50px;
border-bottom: 1px solid #f3f2f1;
padding-left: 16px;
padding-right: 16px;
}
.body .editorzone .editorhead .editortitle {
align-self: center;
flex-basis: 0;
flex-grow: 1;
flex-shrink: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.body .editorzone .editorhead .editorheadbuttons {
justify-self: right;
justify-content: right;
align-self: center;
}
.body .editorzone .editorbody {
display: flex;
position: relative;
flex-direction: column;
flex-grow: 1;
}
.SubHeader{
font-weight: bold;
}

View file

@ -1,136 +0,0 @@
# What is a font subset and why should I use one?
As the name implies, a font subset contains a portion of the complete set of characters included in a font. This is useful for fonts like [Office UI Fabric's icon font](https://developer.microsoft.com/en-us/fabric#/styles/icons), which includes far more characters than what any single application will need or should serve at once (>1000 characters, which is ~150KB for the .woff). Using a subset ensures that an application is only using the glyphs it needs at any given time, and saves significant bytes over the wire.
If you're reading this, you've probably already generated a subset of Fabric's icon font. Follow the instructions below to understand its contents and learn how to integrate it into your project.
## Contents
1. [Get started](#get-started)
- [Folder structure](#folder-structure)
2. [How to use icon subsets](#how-to-use-icon-subsets)
- [Which subset should I use?](#which-subset-should-i-use)
- [CSS and SCSS subsets](#css-and-scss-subsets)
- [TypeScript subsets](#typescript-subsets)
3. [Maintaining a subset](#maintaining-a-subset)
- [Font config options](#font-config-options)
- [Subset chunk settings](#subset-chunk-settings)
# Get started
## Folder structure
Each subset package will include some variation the following files, assuming a font name of `fabric-icons` (which can be configured in the tool—see Font config options below). Note that if "Create subset chunks" was selected when generating a subset, there will be an additional HTML, JSON, CSS, SCSS, and TS file for each generated "chunked" subset.
```
fabric-icons
│ README.md: The docs you're reading now.
│ microsoft-ui-fabric-assets-license: License and usage terms for the fonts.
│ fabric-icons.html - Demo HTML for a given subset.
└─── config
│ │ fabric-icons.json - Configuration file for the subset package.
| > Contains the list of icon names to be included as well as options for
| > the subset itself. See the section below on "maintaining a subset"
| > for more details.
└─── css
| │ fabric-icons.css - @font-face definition and icon classes for the subset. Links to the subsetted font file.
| │ fabric-icons-inline.css - Same as standard CSS, but includes the base64-encoded WOFF font file inline.
└─── scss
| │ fabric-icons.scss - Same as standard CSS and adds a mixin for each icon.
| │ fabric-icons-inline.scss - Same as standard SCSS, but includes the base64-encoded WOFF font file inline.
└─── fonts
| │ fabric-icons.woff - The subsetted icon font.
└─── src
| │ index.ts - Contains top-level exports for all subset initialization code.
| │ fabric-icons.ts - TypeScript subset options and initialization code.
| │ IconNames.ts - Contains const enum of all available icon names for Intellisense.
```
# How to use icon subsets
The icon subsets included here are based on the CSS and SCSS approaches of [office-ui-fabric-core](https://github.com/OfficeDev/office-ui-fabric-core/) (see the [icons page on the Fabric website](https://developer.microsoft.com/en-us/fabric#/styles/icons)), and TypeScript-based approach of [`@uifabric/icons`](https://www.npmjs.com/package/@uifabric/icons), which is what's used in [office-ui-fabric-react](https://github.com/OfficeDev/office-ui-fabric-react/). Each subset can be used independently of either of those projects, meaning your app doesn't need to have them installed in order to use the icon subsets in this package. The instructions here will help you get started quickly using each subset method, but you should refer to the full documentation for each for more detail.
## Which subset should I use?
### CSS and SCSS subsets
The CSS and SCSS methods are similar to what's used in [office-ui-fabric-core](https://github.com/OfficeDev/office-ui-fabric-core/), which is useful for quickly applying Microsoft's design language to an HTML and CSS-based web app. Both include class names you can use in plain HTML, and differ only in that the SCSS files require a SASS preprocessor to use its icon mixins and build its output into plain CSS.
**Use the CSS subset** if your app is relatively simple (e.g. no build process) or you aren't already using SCSS. Simply add a link to one of the icons CSS files to your page, or `@import` it into another CSS file, and add the icon classes to HTML elements like so:
```css
<i class="ms-Icon ms-Icon--Edit"></i>
```
**Use the SCSS subset** if your app already uses [SCSS](http://sass-lang.com/) in a build pipeline, or you wish to use the icon mixins to inject the icon code into your own class names.
For example, if you wish to use the same Edit icon as before but without using the standard `.ms-Icon--Edit` class, you can use the mixins to inject the icon code into a custom class like so:
```scss
.myClassName:before { @include ms-Icon--Edit }
```
This would result in the following code being generated:
```scss
.myClassName:before { content: "\E70F"; }
```
You may wish to use this approach if there may be multiple versions of Fabric on the page and you want to ensure there won't be any rendering conflicts. However, be sure to either add the `.ms-Icon` class to those elements *or* `@include ms-Icon` in your custom class name as this sets the `@font-family` to the font in your subset.
### TypeScript subsets
The TypeScript subset method included under `src` is similar to what's used in [`@uifabric/icons`](https://www.npmjs.com/package/@uifabric/icons) and will make the most sense in applications that use [office-ui-fabric-react](https://github.com/OfficeDev/office-ui-fabric-react/) controls.
As a prerequisite to using these subsets, ensure that your project is configured to build TypeScript. You may wish to use a tool like [create-react-app-typescript](https://github.com/wmonk/create-react-app-typescript) or Microsoft's own [TypeScript-React-Starter](https://github.com/Microsoft/TypeScript-React-Starter). This is a temporary limitation—future updates to the subsetter tool will include pre-compiled subsets that you'll be able to use with simpler configurations.
Once your project is configured, in your source code, import the `initializeIcons` function and call it on the page(s) you wish to use the icons:
```tsx
import { initializeIcons } from 'path-to-subset/src';
initializeIcons();
```
This defines an `@font-face` rule and registers a map of icon names for the subset. Once initialized, icons can be used through the `getIcon` API in `office-ui-fabric-react`, like below:
```tsx
import { Icon } from 'office-ui-fabric-react/lib/Icon';
<Icon iconName='Snow' />
```
CSS classnames can also be used directly on elements using the `getIconClassNames` API from `@uifabric/styling`:
```tsx
import { getIconClassName } from '@uifabric/styling';
return `<i class="${getIconClassName('Snow')}" />`;
```
More details on JavaScript-based icon usage can be found on [Office UI Fabric React's wiki](https://github.com/OfficeDev/office-ui-fabric-react/wiki/Using-icons), [`@uifabric/icons`](https://www.npmjs.com/package/@uifabric/icons), and [`@uifabric/styling`](https://www.npmjs.com/package/@uifabric/styling#using-fabric-core-classes).
# Maintaining a subset
Each subset package has a configuration JSON file that describes which icons are included in that subset and which options were selected for the subset, such as `chunkSubsets` or `excludeGlyphs`. This file is used to maintain and update the subset over time--it can be dragged and dropped on to the Fabric Icons tool to pre-populate icon selection and whichever options were chosen in the tool.
It is recommended to check this file in to a project's source control and update it each time you make changes to a subset.
Most options map to a text field or checkbox in the "Subset options" section of the details pane of Fabric Icons tool. This is represented by the "Tool label" column below.
## Font config options
| Option | Default value | Tool label | Description |
|:------------- |:--------------|:--- |:-----------------|
| `fontName` | `'fabric-icons'` | Font file name | The name given to each of the subset's HTML, CSS, SCSS, TS, and JSON files. |
| `fontFamilyName` | `'FabricMDL2Icons'` | Font-family name | The name of the font-family given in the @font-face definition for the subset. It is recommended to change this only if the icon subset will be used in conjunction with multiple, different versions of Fabric or other icon subsets on the same page. |
| `excludeGlyphs` | `false` | Exclude selection from subset | Produces a subset that excludes the selected glyphs from the full Fabric icon set. This is useful if you wish to create a subset that includes all of the Fabric icons EXCEPT for the selected icons.|
| `chunkSubsets` | `false` | Create subset chunks | Controls whether to produce additional subsets that can be loaded on-demand.|
| `hashFontFileName` | `false` | Hash font file name | Controls whether to add a unique hash to the .woff font file based on glyph selection and subset options. This is useful for [CDN cache busting](http://www.adopsinsider.com/ad-ops-basics/what-is-a-cache-buster-and-how-does-it-work//) if you plan on hosting font files on a CDN, which may serve old cached versions of a font without a busting mechanism. |
| `subsetChunkSettings` | { } | N/A | Additional configuration options for subset chunks. Options here only apply if `chunkSubsets` is `true`. See "Subset chunk settings" below for more details. |
| `glyphs` | [{ }] | N/A | The list of icons included in a subset, populated from selecting icons in the Fabric Icons tool. Each glyph is an object with a `name` and `unicode` property. |
### Subset chunk settings
Each option here is a property of `subsetChunkSettings`, and only apply if `chunkSubsets` is `true`.
| Option | Default value | Tool label | Description |
|:------------- |:--------------|:--- |:-----------------|
| `maxSubsetSize` | `100` | Max subset chunk size | The maximum number of icons to be included in a generated subset chunk. Larger chunks take longer to load as they will have more characters and larger fonts, but smaller chunks may incur more HTTP requests. |

View file

@ -1,81 +0,0 @@
{
"fontName": "fabric-icons",
"fontFamilyName": "FabricMDL2Icons",
"excludeGlyphs": false,
"excludeThirdPartyIcons": false,
"chunkSubsets": false,
"hashFontFileName": false,
"subsetChunkSettings": {
"maxSubsetSize": 100
},
"glyphs": [
{
"name": "GlobalNavButton",
"unicode": "E700"
},
{
"name": "ChevronDown",
"unicode": "E70D"
},
{
"name": "ChevronUp",
"unicode": "E70E"
},
{
"name": "Cancel",
"unicode": "E711"
},
{
"name": "Settings",
"unicode": "E713"
},
{
"name": "ChevronLeft",
"unicode": "E76B"
},
{
"name": "ChevronRight",
"unicode": "E76C"
},
{
"name": "ChevronUpSmall",
"unicode": "E96D"
},
{
"name": "ChevronDownSmall",
"unicode": "E96E"
},
{
"name": "ChevronLeftSmall",
"unicode": "E96F"
},
{
"name": "ChevronRightSmall",
"unicode": "E970"
},
{
"name": "ChevronUpMed",
"unicode": "E971"
},
{
"name": "ChevronDownMed",
"unicode": "E972"
},
{
"name": "ChevronLeftMed",
"unicode": "E973"
},
{
"name": "ChevronRightMed",
"unicode": "E974"
},
{
"name": "CircleRing",
"unicode": "EA3A"
},
{
"name": "FabricReportLibrary",
"unicode": "F0A1"
}
]
}

View file

@ -1,35 +0,0 @@
/*
Your use of the content in the files referenced here is subject to the terms of the license at https://aka.ms/fabric-assets-license
*/
@font-face {
font-family: 'FabricMDL2Icons';
src: url('data:application/octet-stream;base64,d09GRgABAAAAAAyEAA4AAAAAFqAAA6PXAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABRAAAAEgAAABgMUZ3smNtYXAAAAGMAAAAXwAAAYKgC5GJY3Z0IAAAAewAAAAgAAAAKgnZCa9mcGdtAAACDAAAAPAAAAFZ/J7mjmdhc3AAAAL8AAAADAAAAAwACAAbZ2x5ZgAAAwgAAAQnAAAGgN064VtoZWFkAAAHMAAAADIAAAA2AVv+72ho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DjxAdAIacnBgwON/AQFljxE5vPO0SpRoRA1keHIMNT4CTlFWQoVnnncK3wq13+BaoOYztJvjnnxTjCf4ZTlie8+aZEdWJbToT6LmZSwuo3PGefiUs8AvXQb34d4F28HyvN0LzsbgKlCHqpL4D8xAgdIlZ/kaZcQSnVSsu42/kvctMjho5/he4l5iTprZyv4F88RzQOlDmOHT8ZOhv4/tsxRnhrhnLyX7seihR+mCvVG1s63RPedssSOa+yhWFtT7V1yTYCZ6fLfMXWQiMjZok8xw1Q41qA4FU9wXrGe54z1LiA+KY7kz0TZPXlTaS/Ztua9Uc+AzsppzHkMnaq6IrIa8ooXnLrgNyWJVw/RSXbW8L9Amx/2U+YozH+NOV3E+rkDzJHbMU47rds66VClp51hNy3NXbOWebGpGB6h/C980ofPEyzbvMYf/yu3ae8GeSpQ5nuOQ7tQwq9sqGKJv5vXo3AxQJbGWwPGGW0D+Y60FSjqu3PCt/NTsyQtTpbgvJq2xqohbvlktW1K2QzcHP6RZ803+5xmNX8YmdWbtfbghOrFM80P5zpnp2Nv/4W7/DV7sOJR4nGNgZgCD/34M5QyYQAgAKTwB2nic28CgzbCJkZNJm3ETF4jcztWaG2qrysChvZ07NdhBTwbE4onwsNCQBLF4nc215YVBLD4dFRkRHhCLX05CmI8DxBLg4+FkZwGxBMEAxBLaMKEgwADIYtjOCDeaCW40M9xoFrjRrHCj2eQkoUazw43mgBvNCTd6kzAju/YGBgXX2kwJFwDEASgaAAAA') format('truetype');
}
.ms-Icon {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
display: inline-block;
font-family: 'FabricMDL2Icons';
font-style: normal;
font-weight: normal;
speak: none;
}
.ms-Icon--GlobalNavButton:before { content: "\E700"; }
.ms-Icon--ChevronDown:before { content: "\E70D"; }
.ms-Icon--ChevronUp:before { content: "\E70E"; }
.ms-Icon--Cancel:before { content: "\E711"; }
.ms-Icon--Settings:before { content: "\E713"; }
.ms-Icon--ChevronLeft:before { content: "\E76B"; }
.ms-Icon--ChevronRight:before { content: "\E76C"; }
.ms-Icon--ChevronUpSmall:before { content: "\E96D"; }
.ms-Icon--ChevronDownSmall:before { content: "\E96E"; }
.ms-Icon--ChevronLeftSmall:before { content: "\E96F"; }
.ms-Icon--ChevronRightSmall:before { content: "\E970"; }
.ms-Icon--ChevronUpMed:before { content: "\E971"; }
.ms-Icon--ChevronDownMed:before { content: "\E972"; }
.ms-Icon--ChevronLeftMed:before { content: "\E973"; }
.ms-Icon--ChevronRightMed:before { content: "\E974"; }
.ms-Icon--CircleRing:before { content: "\EA3A"; }
.ms-Icon--FabricReportLibrary:before { content: "\F0A1"; }

View file

@ -1,35 +0,0 @@
/*
Your use of the content in the files referenced here is subject to the terms of the license at https://aka.ms/fabric-assets-license
*/
@font-face {
font-family: 'FabricMDL2Icons';
src: url('../fonts/fabric-icons.woff') format('woff');
}
.ms-Icon {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
display: inline-block;
font-family: 'FabricMDL2Icons';
font-style: normal;
font-weight: normal;
speak: none;
}
.ms-Icon--GlobalNavButton:before { content: "\E700"; }
.ms-Icon--ChevronDown:before { content: "\E70D"; }
.ms-Icon--ChevronUp:before { content: "\E70E"; }
.ms-Icon--Cancel:before { content: "\E711"; }
.ms-Icon--Settings:before { content: "\E713"; }
.ms-Icon--ChevronLeft:before { content: "\E76B"; }
.ms-Icon--ChevronRight:before { content: "\E76C"; }
.ms-Icon--ChevronUpSmall:before { content: "\E96D"; }
.ms-Icon--ChevronDownSmall:before { content: "\E96E"; }
.ms-Icon--ChevronLeftSmall:before { content: "\E96F"; }
.ms-Icon--ChevronRightSmall:before { content: "\E970"; }
.ms-Icon--ChevronUpMed:before { content: "\E971"; }
.ms-Icon--ChevronDownMed:before { content: "\E972"; }
.ms-Icon--ChevronLeftMed:before { content: "\E973"; }
.ms-Icon--ChevronRightMed:before { content: "\E974"; }
.ms-Icon--CircleRing:before { content: "\EA3A"; }
.ms-Icon--FabricReportLibrary:before { content: "\F0A1"; }

View file

@ -1,289 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>fabric-icons demo</title>
<link rel="stylesheet" href="css/fabric-icons.css">
<style>
* {
box-sizing: border-box;
}
html,
body {
padding: 0;
margin: 0;
color: #333333;
font-family: "Segoe UI Regular WestEuropean", "Segoe UI", Tahoma, Arial, sans-serif;
font-size: 14px;
font-weight: normal;
}
body {
padding: 0 20px;
}
.IconContainer {
font-size: 14px;
float: left;
margin: 0 5px 5px 0;
width: 50px;
height: 50px;
line-height: 51px;
}
.IconContainer-icon {
text-align: center;
}
.IconContainer-name,
.IconContainer-unicode {
display: none;
}
</style>
</head>
<body>
<h1 class="ms-font-su">fabric-icons</h1>
<div class="Icons">
<div class="IconContainer" title="GlobalNavButton - E700">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--GlobalNavButton"></i>
</div>
<div class="IconContainer-name ms-font-l">
GlobalNavButton
</div>
<div class="IconContainer-unicode ms-font-s">
E700
</div>
</div>
<div class="IconContainer" title="ChevronDown - E70D">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--ChevronDown"></i>
</div>
<div class="IconContainer-name ms-font-l">
ChevronDown
</div>
<div class="IconContainer-unicode ms-font-s">
E70D
</div>
</div>
<div class="IconContainer" title="ChevronUp - E70E">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--ChevronUp"></i>
</div>
<div class="IconContainer-name ms-font-l">
ChevronUp
</div>
<div class="IconContainer-unicode ms-font-s">
E70E
</div>
</div>
<div class="IconContainer" title="Cancel - E711">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--Cancel"></i>
</div>
<div class="IconContainer-name ms-font-l">
Cancel
</div>
<div class="IconContainer-unicode ms-font-s">
E711
</div>
</div>
<div class="IconContainer" title="Settings - E713">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--Settings"></i>
</div>
<div class="IconContainer-name ms-font-l">
Settings
</div>
<div class="IconContainer-unicode ms-font-s">
E713
</div>
</div>
<div class="IconContainer" title="ChevronLeft - E76B">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--ChevronLeft"></i>
</div>
<div class="IconContainer-name ms-font-l">
ChevronLeft
</div>
<div class="IconContainer-unicode ms-font-s">
E76B
</div>
</div>
<div class="IconContainer" title="ChevronRight - E76C">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--ChevronRight"></i>
</div>
<div class="IconContainer-name ms-font-l">
ChevronRight
</div>
<div class="IconContainer-unicode ms-font-s">
E76C
</div>
</div>
<div class="IconContainer" title="ChevronUpSmall - E96D">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--ChevronUpSmall"></i>
</div>
<div class="IconContainer-name ms-font-l">
ChevronUpSmall
</div>
<div class="IconContainer-unicode ms-font-s">
E96D
</div>
</div>
<div class="IconContainer" title="ChevronDownSmall - E96E">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--ChevronDownSmall"></i>
</div>
<div class="IconContainer-name ms-font-l">
ChevronDownSmall
</div>
<div class="IconContainer-unicode ms-font-s">
E96E
</div>
</div>
<div class="IconContainer" title="ChevronLeftSmall - E96F">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--ChevronLeftSmall"></i>
</div>
<div class="IconContainer-name ms-font-l">
ChevronLeftSmall
</div>
<div class="IconContainer-unicode ms-font-s">
E96F
</div>
</div>
<div class="IconContainer" title="ChevronRightSmall - E970">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--ChevronRightSmall"></i>
</div>
<div class="IconContainer-name ms-font-l">
ChevronRightSmall
</div>
<div class="IconContainer-unicode ms-font-s">
E970
</div>
</div>
<div class="IconContainer" title="ChevronUpMed - E971">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--ChevronUpMed"></i>
</div>
<div class="IconContainer-name ms-font-l">
ChevronUpMed
</div>
<div class="IconContainer-unicode ms-font-s">
E971
</div>
</div>
<div class="IconContainer" title="ChevronDownMed - E972">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--ChevronDownMed"></i>
</div>
<div class="IconContainer-name ms-font-l">
ChevronDownMed
</div>
<div class="IconContainer-unicode ms-font-s">
E972
</div>
</div>
<div class="IconContainer" title="ChevronLeftMed - E973">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--ChevronLeftMed"></i>
</div>
<div class="IconContainer-name ms-font-l">
ChevronLeftMed
</div>
<div class="IconContainer-unicode ms-font-s">
E973
</div>
</div>
<div class="IconContainer" title="ChevronRightMed - E974">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--ChevronRightMed"></i>
</div>
<div class="IconContainer-name ms-font-l">
ChevronRightMed
</div>
<div class="IconContainer-unicode ms-font-s">
E974
</div>
</div>
<div class="IconContainer" title="CircleRing - EA3A">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--CircleRing"></i>
</div>
<div class="IconContainer-name ms-font-l">
CircleRing
</div>
<div class="IconContainer-unicode ms-font-s">
EA3A
</div>
</div>
<div class="IconContainer" title="FabricReportLibrary - F0A1">
<div class="IconContainer-icon">
<i class="ms-Icon ms-Icon--FabricReportLibrary"></i>
</div>
<div class="IconContainer-name ms-font-l">
FabricReportLibrary
</div>
<div class="IconContainer-unicode ms-font-s">
F0A1
</div>
</div>
</div>
</body>
</html>

View file

@ -1,57 +0,0 @@
/*
Your use of the content in the files referenced here is subject to the terms of the license at https://aka.ms/fabric-assets-license
*/
@font-face {
font-family: 'FabricMDL2Icons';
src: url('data:application/octet-stream;base64,d09GRgABAAAAAAyEAA4AAAAAFqAAA6PXAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABRAAAAEgAAABgMUZ3smNtYXAAAAGMAAAAXwAAAYKgC5GJY3Z0IAAAAewAAAAgAAAAKgnZCa9mcGdtAAACDAAAAPAAAAFZ/J7mjmdhc3AAAAL8AAAADAAAAAwACAAbZ2x5ZgAAAwgAAAQnAAAGgN064VtoZWFkAAAHMAAAADIAAAA2AVv+72hoZWEAAAdkAAAAFQAAACQQ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E5vPO0SpRoRA1keHIMNT4CTlFWQoVnnncK3wq13+BaoOYztJvjnnxTjCf4ZTlie8+aZEdWJbToT6LmZSwuo3PGefiUs8AvXQb34d4F28HyvN0LzsbgKlCHqpL4D8xAgdIlZ/kaZcQSnVSsu42/kvctMjho5/he4l5iTprZyv4F88RzQOlDmOHT8ZOhv4/tsxRnhrhnLyX7seihR+mCvVG1s63RPedssSOa+yhWFtT7V1yTYCZ6fLfMXWQiMjZok8xw1Q41qA4FU9wXrGe54z1LiA+KY7kz0TZPXlTaS/Ztua9Uc+AzsppzHkMnaq6IrIa8ooXnLrgNyWJVw/RSXbW8L9Amx/2U+YozH+NOV3E+rkDzJHbMU47rds66VClp51hNy3NXbOWebGpGB6h/C980ofPEyzbvMYf/yu3ae8GeSpQ5nuOQ7tQwq9sqGKJv5vXo3AxQJbGWwPGGW0D+Y60FSjqu3PCt/NTsyQtTpbgvJq2xqohbvlktW1K2QzcHP6RZ803+5xmNX8YmdWbtfbghOrFM80P5zpnp2Nv/4W7/DV7sOJR4nGNgZgCD/34M5QyYQAgAKTwB2nic28CgzbCJkZNJm3ETF4jcztWaG2qrysChvZ07NdhBTwbE4onwsNCQBLF4nc215YVBLD4dFRkRHhCLX05CmI8DxBLg4+FkZwGxBMEAxBLaMKEgwADIYtjOCDeaCW40M9xoFrjRrHCj2eQkoUazw43mgBvNCTd6kzAju/YGBgXX2kwJFwDEASgaAAAA') format('truetype');
}
.ms-Icon {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
display: inline-block;
font-family: 'FabricMDL2Icons';
font-style: normal;
font-weight: normal;
speak: none;
}
// Mixins
@mixin ms-Icon--GlobalNavButton { content: "\E700"; }
@mixin ms-Icon--ChevronDown { content: "\E70D"; }
@mixin ms-Icon--ChevronUp { content: "\E70E"; }
@mixin ms-Icon--Cancel { content: "\E711"; }
@mixin ms-Icon--Settings { content: "\E713"; }
@mixin ms-Icon--ChevronLeft { content: "\E76B"; }
@mixin ms-Icon--ChevronRight { content: "\E76C"; }
@mixin ms-Icon--ChevronUpSmall { content: "\E96D"; }
@mixin ms-Icon--ChevronDownSmall { content: "\E96E"; }
@mixin ms-Icon--ChevronLeftSmall { content: "\E96F"; }
@mixin ms-Icon--ChevronRightSmall { content: "\E970"; }
@mixin ms-Icon--ChevronUpMed { content: "\E971"; }
@mixin ms-Icon--ChevronDownMed { content: "\E972"; }
@mixin ms-Icon--ChevronLeftMed { content: "\E973"; }
@mixin ms-Icon--ChevronRightMed { content: "\E974"; }
@mixin ms-Icon--CircleRing { content: "\EA3A"; }
@mixin ms-Icon--FabricReportLibrary { content: "\F0A1"; }
// Classes
.ms-Icon--GlobalNavButton:before { @include ms-Icon--GlobalNavButton }
.ms-Icon--ChevronDown:before { @include ms-Icon--ChevronDown }
.ms-Icon--ChevronUp:before { @include ms-Icon--ChevronUp }
.ms-Icon--Cancel:before { @include ms-Icon--Cancel }
.ms-Icon--Settings:before { @include ms-Icon--Settings }
.ms-Icon--ChevronLeft:before { @include ms-Icon--ChevronLeft }
.ms-Icon--ChevronRight:before { @include ms-Icon--ChevronRight }
.ms-Icon--ChevronUpSmall:before { @include ms-Icon--ChevronUpSmall }
.ms-Icon--ChevronDownSmall:before { @include ms-Icon--ChevronDownSmall }
.ms-Icon--ChevronLeftSmall:before { @include ms-Icon--ChevronLeftSmall }
.ms-Icon--ChevronRightSmall:before { @include ms-Icon--ChevronRightSmall }
.ms-Icon--ChevronUpMed:before { @include ms-Icon--ChevronUpMed }
.ms-Icon--ChevronDownMed:before { @include ms-Icon--ChevronDownMed }
.ms-Icon--ChevronLeftMed:before { @include ms-Icon--ChevronLeftMed }
.ms-Icon--ChevronRightMed:before { @include ms-Icon--ChevronRightMed }
.ms-Icon--CircleRing:before { @include ms-Icon--CircleRing }
.ms-Icon--FabricReportLibrary:before { @include ms-Icon--FabricReportLibrary }

View file

@ -1,57 +0,0 @@
/*
Your use of the content in the files referenced here is subject to the terms of the license at https://aka.ms/fabric-assets-license
*/
@font-face {
font-family: 'FabricMDL2Icons';
src: url('../fonts/fabric-icons.woff') format('woff');
}
.ms-Icon {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
display: inline-block;
font-family: 'FabricMDL2Icons';
font-style: normal;
font-weight: normal;
speak: none;
}
// Mixins
@mixin ms-Icon--GlobalNavButton { content: "\E700"; }
@mixin ms-Icon--ChevronDown { content: "\E70D"; }
@mixin ms-Icon--ChevronUp { content: "\E70E"; }
@mixin ms-Icon--Cancel { content: "\E711"; }
@mixin ms-Icon--Settings { content: "\E713"; }
@mixin ms-Icon--ChevronLeft { content: "\E76B"; }
@mixin ms-Icon--ChevronRight { content: "\E76C"; }
@mixin ms-Icon--ChevronUpSmall { content: "\E96D"; }
@mixin ms-Icon--ChevronDownSmall { content: "\E96E"; }
@mixin ms-Icon--ChevronLeftSmall { content: "\E96F"; }
@mixin ms-Icon--ChevronRightSmall { content: "\E970"; }
@mixin ms-Icon--ChevronUpMed { content: "\E971"; }
@mixin ms-Icon--ChevronDownMed { content: "\E972"; }
@mixin ms-Icon--ChevronLeftMed { content: "\E973"; }
@mixin ms-Icon--ChevronRightMed { content: "\E974"; }
@mixin ms-Icon--CircleRing { content: "\EA3A"; }
@mixin ms-Icon--FabricReportLibrary { content: "\F0A1"; }
// Classes
.ms-Icon--GlobalNavButton:before { @include ms-Icon--GlobalNavButton }
.ms-Icon--ChevronDown:before { @include ms-Icon--ChevronDown }
.ms-Icon--ChevronUp:before { @include ms-Icon--ChevronUp }
.ms-Icon--Cancel:before { @include ms-Icon--Cancel }
.ms-Icon--Settings:before { @include ms-Icon--Settings }
.ms-Icon--ChevronLeft:before { @include ms-Icon--ChevronLeft }
.ms-Icon--ChevronRight:before { @include ms-Icon--ChevronRight }
.ms-Icon--ChevronUpSmall:before { @include ms-Icon--ChevronUpSmall }
.ms-Icon--ChevronDownSmall:before { @include ms-Icon--ChevronDownSmall }
.ms-Icon--ChevronLeftSmall:before { @include ms-Icon--ChevronLeftSmall }
.ms-Icon--ChevronRightSmall:before { @include ms-Icon--ChevronRightSmall }
.ms-Icon--ChevronUpMed:before { @include ms-Icon--ChevronUpMed }
.ms-Icon--ChevronDownMed:before { @include ms-Icon--ChevronDownMed }
.ms-Icon--ChevronLeftMed:before { @include ms-Icon--ChevronLeftMed }
.ms-Icon--ChevronRightMed:before { @include ms-Icon--ChevronRightMed }
.ms-Icon--CircleRing:before { @include ms-Icon--CircleRing }
.ms-Icon--FabricReportLibrary:before { @include ms-Icon--FabricReportLibrary }

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,51 +0,0 @@
// Your use of the content in the files referenced here is subject to the terms of the license at https://aka.ms/fabric-assets-license
// tslint:disable:max-line-length
import {
IIconOptions,
IIconSubset,
registerIcons
} from '@uifabric/styling';
export function initializeIcons(
baseUrl: string = '',
options?: IIconOptions
): void {
const subset: IIconSubset = {
style: {
MozOsxFontSmoothing: 'grayscale',
WebkitFontSmoothing: 'antialiased',
fontStyle: 'normal',
fontWeight: 'normal',
speak: 'none'
},
fontFace: {
fontFamily: `"FabricMDL2Icons"`,
// Inline Data, taken from ../css/fabric-icons-inline.css
src: `url('data:application/octet-stream;base64,d09GRgABAAAAAAyEAA4AAAAAFqAAA6PXAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABRAAAAEgAAABgMUZ3smNtYXAAAAGMAAAAXwAAAYKgC5GJY3Z0IAAAAewAAAAgAAAAKgnZCa9mcGdtAAACDAAAAPAAAAFZ/J7mjmdhc3AAAAL8AAAADAAAAAwACAAbZ2x5ZgAAAwgAAAQnAAAGgN064VtoZWFkAAAHMAAAADIAAAA2AVv+72hoZWEAAAdkAAAAFQAAACQQAQgDaG10eAAAB3wAAAAoAAAAKBJIBzVsb2NhAAAHpAAAACYAAAAmD8YOZG1heHAAAAfMAAAAHQAAACAAMAH2bmFtZQAAB+wAAAP4AAAJ+pKT8VRwb3N0AAAL5AAAABQAAAAg/1EAiXByZXAAAAv4AAAAiQAAANN4vfI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F88RzQOlDmOHT8ZOhv4/tsxRnhrhnLyX7seihR+mCvVG1s63RPedssSOa+yhWFtT7V1yTYCZ6fLfMXWQiMjZok8xw1Q41qA4FU9wXrGe54z1LiA+KY7kz0TZPXlTaS/Ztua9Uc+AzsppzHkMnaq6IrIa8ooXnLrgNyWJVw/RSXbW8L9Amx/2U+YozH+NOV3E+rkDzJHbMU47rds66VClp51hNy3NXbOWebGpGB6h/C980ofPEyzbvMYf/yu3ae8GeSpQ5nuOQ7tQwq9sqGKJv5vXo3AxQJbGWwPGGW0D+Y60FSjqu3PCt/NTsyQtTpbgvJq2xqohbvlktW1K2QzcHP6RZ803+5xmNX8YmdWbtfbghOrFM80P5zpnp2Nv/4W7/DV7sOJR4nGNgZgCD/34M5QyYQAgAKTwB2nic28CgzbCJkZNJm3ETF4jcztWaG2qrysChvZ07NdhBTwbE4onwsNCQBLF4nc215YVBLD4dFRkRHhCLX05CmI8DxBLg4+FkZwGxBMEAxBLaMKEgwADIYtjOCDeaCW40M9xoFrjRrHCj2eQkoUazw43mgBvNCTd6kzAju/YGBgXX2kwJFwDEASgaAAAA') format('truetype');`
},
icons: {
'GlobalNavButton': '\uE700',
'ChevronDown': '\uE70D',
'ChevronUp': '\uE70E',
'Cancel': '\uE711',
'Settings': '\uE713',
'ChevronLeft': '\uE76B',
'ChevronRight': '\uE76C',
'ChevronUpSmall': '\uE96D',
'ChevronDownSmall': '\uE96E',
'ChevronLeftSmall': '\uE96F',
'ChevronRightSmall': '\uE970',
'ChevronUpMed': '\uE971',
'ChevronDownMed': '\uE972',
'ChevronLeftMed': '\uE973',
'ChevronRightMed': '\uE974',
'CircleRing': '\uEA3A',
'FabricReportLibrary': '\uF0A1',
}
};
registerIcons(subset, options);
}

View file

@ -1,17 +0,0 @@
import { registerIconAlias } from '@uifabric/styling';
export const registerIconAliases = () => {
registerIconAlias('trash', 'delete');
registerIconAlias('onedrive', 'onedrivelogo');
registerIconAlias('alertsolid12', 'eventdatemissed12');
registerIconAlias('sixpointstar', '6pointstar');
registerIconAlias('twelvepointstar', '12pointstar');
registerIconAlias('toggleon', 'toggleleft');
registerIconAlias('toggleoff', 'toggleright');
registerIconAlias('edgelogo', 'edgeoldlogo');
registerIconAlias('powerappscds', 'commondataservicecds');
registerIconAlias('d365talenthrcore', 'd365corehr');
registerIconAlias('crmcustomerinsightsapp', 'insights');
}
export default registerIconAliases;

View file

@ -1,18 +0,0 @@
import { initializeIcons as i } from './fabric-icons';
import { IIconOptions } from '@uifabric/styling';
import { registerIconAliases } from './iconAliases';
const DEFAULT_BASE_URL = 'https://spoprod-a.akamaihd.net/files/fabric/assets/icons/';
export function initializeIcons(
baseUrl: string = DEFAULT_BASE_URL,
options?: IIconOptions
): void {
[i].forEach(
(initialize: (url: string, options?: IIconOptions) => void) => initialize(baseUrl, options)
);
registerIconAliases();
}
export { IconNames } from './IconNames';

View file

@ -1,56 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { App } from './components/App';
import { loadTheme, mergeStyles } from 'office-ui-fabric-react';
if ((window as any).start_with_dark_theme) {
loadTheme({
palette: {
themePrimary: '#0088e4',
themeLighterAlt: '#000509',
themeLighter: '#001624',
themeLight: '#002944',
themeTertiary: '#005288',
themeSecondary: '#0078c8',
themeDarkAlt: '#1793e6',
themeDark: '#38a3ea',
themeDarker: '#69baef',
neutralLighterAlt: '#0b0b0b',
neutralLighter: '#151515',
neutralLight: '#252525',
neutralQuaternaryAlt: '#2f2f2f',
neutralQuaternary: '#373737',
neutralTertiaryAlt: '#595959',
neutralTertiary: '#eaeaea',
neutralSecondary: '#eeeeee',
neutralPrimaryAlt: '#f1f1f1',
neutralPrimary: '#e0e0e0',
neutralDark: '#f8f8f8',
black: '#fbfbfb',
white: '#000000',
}
});
}
// Inject some global styles
mergeStyles({
selectors: {
':global(body), :global(html), :global(#app)': {
margin: 0,
padding: 0,
height: '100vh'
}
}
});
const root = document.getElementById('app');
if (root && root.hasChildNodes()) {
ReactDOM.hydrate(<App
ref={(app_component) => {(window as any).react_app_component=app_component;}} // in order to call the app from outside react.
/>,
root);
} else {
ReactDOM.render(<App
ref={(app_component) => {(window as any).react_app_component=app_component;}} // in order to call the app from outside react.
/>,
root);
}

View file

@ -1,26 +0,0 @@
import React from 'react';
import {registerIcons} from 'office-ui-fabric-react';
import {initializeIcons} from './icons/src';
// Import SVG files for the icons here.
import FancyZonesSVG from './svg/fancy_zones.svg';
import PowerRenameSVG from './svg/power_rename.svg';
import ShortcutGuideSVG from './svg/shortcut_guide.svg';
import ImageResizerSVG from './svg/image_resizer.svg';
import PowerPreviewSVG from './svg/power_preview.svg';
import WindowWalkerSVG from './svg/window_walker.svg';
export function setup_powertoys_icons(): void {
initializeIcons('icons/fonts/');
registerIcons({
icons: {
'pt-fancy-zones': ( <FancyZonesSVG /> ),
'pt-power-rename': ( <PowerRenameSVG /> ),
'pt-shortcut-guide': ( <ShortcutGuideSVG /> ),
'pt-power-preview': (<PowerPreviewSVG /> ),
'pt-image-resizer': ( <ImageResizerSVG /> ),
'pt-window-walker': ( <WindowWalkerSVG /> )
}
});
}

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="15px" height="15px" viewBox="0 0 15 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 54.1 (76490) - https://sketchapp.com -->
<title>Fancy zones</title>
<desc>Created with Sketch.</desc>
<g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="X-Large-Copy-5" transform="translate(-17.000000, -128.000000)">
<g id="Group-4">
<g id="Navigation-/-Left-Nav-/-Default-/-Level-2-w-Icon-/-Rest-Copy-2" transform="translate(0.000000, 116.000000)">
<g id="Fancy-zones" transform="translate(17.000000, 12.000000)">
<rect id="Rectangle" x="0.5" y="0.5" width="14" height="14"></rect>
<rect id="Rectangle" x="2.5" y="2.5" width="4" height="4"></rect>
<rect id="Rectangle" x="2.5" y="8.5" width="4" height="4"></rect>
<rect id="Rectangle" x="8.5" y="2.5" width="4" height="10"></rect>
</g>
</g>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -1,3 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" width="15" height="15">
<path fill="currentColor" d="M0 768h1408v1152H0V768zm128 1024h870l-582-581-288 288v293zm1152 0v-102l-224-223-101 101 223 224h102zM128 896v421l288-287 448 447 192-191 224 224V896H128zm832 256q-26 0-45-19t-19-45q0-26 19-45t45-19q26 0 45 19t19 45q0 26-19 45t-45 19zm960-512V347l-339 338-90-90 338-339h-293V128h512v512h-128zm-768-512h256v128h-256V128zm-128 128H768V128h256v128zm-384 0H384V128h256v128zm-384 0H0V128h256v128zM128 640H0V384h128v256zm1920 128v256h-128V768h128zm-128 384h128v256h-128v-256zm0 384h128v256h-128v-256zm-384 256h256v128h-256v-128z" />
</svg>

Before

Width:  |  Height:  |  Size: 653 B

View file

@ -1,3 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" width="15" height="15">
<path fill="currentColor" d="M2048 512v256h-128V512h-704q-56 0-90 9t-58 24-41 31-37 31-50 23-76 10H128v896h128v128H128q-27 0-50-10t-40-27-28-41-10-50V256q0-27 10-50t27-40 41-28 50-10h736q37 0 69 13t58 36 49 51 39 59q13 23 25 41t28 30 35 19 49 7h704q27 0 50 10t40 27 28 41 10 50zm-1184 0q27 0 45-9t35-22 34-28 39-28q-15-17-31-45t-36-56-40-48-46-20H128v256h736zM384 896h1664v1152H384V896zm1536 1024v-896H512v896h1408zm-128-768v128h-384v-128h384zm-128 256v128h-256v-128h256zm0 256v128h-256v-128h256zm-384-512v640H640v-640h640zm-128 512v-384H768v384h384z" />
</svg>

Before

Width:  |  Height:  |  Size: 653 B

View file

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="15px" height="15px" viewBox="0 0 15 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 54.1 (76490) - https://sketchapp.com -->
<title>Group 6</title>
<desc>Created with Sketch.</desc>
<g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Iconset---PowerRename" transform="translate(-108.000000, -349.000000)">
<g id="X-Large-Copy-5" transform="translate(91.000000, 76.000000)">
<g id="Group-4">
<g id="Navigation-/-Left-Nav-/-Default-/-Level-2-w-Icon-/-Rest-Copy-5" transform="translate(0.000000, 224.000000)">
<g id="Group-6" transform="translate(17.000000, 49.000000)">
<rect id="Rectangle" x="0.5" y="0.5" width="14" height="14"></rect>
<path d="M5,11.5 L7,11.5" id="Line-2"></path>
<path d="M5,3.5 L7,3.5" id="Line-2-Copy-3"></path>
<path d="M4.0010376,7.50445557 L11.0010376,7.50445557" id="Line-2-Copy" transform="translate(7.501038, 7.504456) rotate(-270.000000) translate(-7.501038, -7.504456) "></path>
<path d="M8,11.5 L10,11.5" id="Line-2-Copy-2"></path>
<path d="M8,3.5 L10,3.5" id="Line-2-Copy-4"></path>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="15px" height="15px" viewBox="0 0 15 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 54.1 (76490) - https://sketchapp.com -->
<title>Shortcut guide</title>
<desc>Created with Sketch.</desc>
<g id="Icons" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="X-Large-Copy-5" transform="translate(-17.000000, -92.000000)">
<g id="Group-4">
<g id="Navigation-/-Left-Nav-/-Default-/-Level-2-w-Icon-/-Rest-Copy" transform="translate(0.000000, 80.000000)">
<g id="Shortcut-guide" transform="translate(17.000000, 12.000000)">
<rect id="Rectangle" x="0.5" y="0.5" width="14" height="14"></rect>
<rect id="Rectangle" x="2.5" y="2.5" width="6" height="6"></rect>
<rect id="Rectangle" x="2.5" y="10.5" width="2" height="2"></rect>
<rect id="Rectangle" x="6.5" y="10.5" width="2" height="2"></rect>
<rect id="Rectangle" x="10.5" y="2.5" width="2" height="2"></rect>
<rect id="Rectangle" x="10.5" y="6.5" width="2" height="2"></rect>
<rect id="Rectangle" x="10.5" y="10.5" width="2" height="2"></rect>
</g>
</g>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -1,3 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" width="15" height="15">
<path fill="currentColor" d="M2048 384v1280H640v-384h128v256h1152V768H768v128H640V384h1408zM247 1152l210 211-90 90L1 1088l366-365 90 90-210 211h1033v128H247zm1673-512V512H768v128h1152z" />
</svg>

Before

Width:  |  Height:  |  Size: 285 B

View file

@ -1,20 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"module": "es2015",
"outDir": "./lib",
"importHelpers": true,
"downlevelIteration": true,
"strict": true,
"noImplicitAny": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"forceConsistentCasingInFileNames": true,
"pretty": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "react"
},
"include": ["src/index.tsx", "typings/**/*.d.ts"]
}

View file

@ -1,49 +0,0 @@
/// <reference types="node" />
/// <reference types="react" />
/// <reference types="react-dom" />
declare namespace NodeJS {
interface ProcessEnv {
readonly NODE_ENV: 'development' | 'production' | 'test';
readonly PUBLIC_URL: string;
}
}
declare module '*.bmp' {
const src: string;
export default src;
}
declare module '*.gif' {
const src: string;
export default src;
}
declare module '*.jpg' {
const src: string;
export default src;
}
declare module '*.jpeg' {
const src: string;
export default src;
}
declare module '*.png' {
const src: string;
export default src;
}
declare module '*.webp' {
const src: string;
export default src;
}
declare module '*.svg' {
import * as React from 'react';
export const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
const src: string;
export default src;
}

View file

@ -1,23 +0,0 @@
const path = require('path')
const { webpackMerge, basicWebpackConfig, tsOverlay } = require('just-scripts');
// Overrides the Just file overlay so that SVGs can be used as a React Component.
powertoys_fileOverlay = {
output: {
path: path.resolve(__dirname, 'build', 'dist')
},
module: {
rules: [
{
test: /\.(png|jpg|gif)$/,
use: ['file-loader']
},
{
test: /\.svg$/,
use: ['@svgr/webpack']
}
]
}
};
module.exports = webpackMerge(basicWebpackConfig, tsOverlay, powertoys_fileOverlay);

View file

@ -1,19 +0,0 @@
const { webpackMerge, htmlOverlay, basicWebpackServeConfig, stylesOverlay, tsOverlay } = require('just-scripts');
// Overrides the Just file overlay so that SVGs can be used as a React Component.
powertoys_fileOverlay = {
module: {
rules: [
{
test: /\.(png|jpg|gif)$/,
use: ['file-loader']
},
{
test: /\.svg$/,
use: ['@svgr/webpack']
}
]
}
};
module.exports = webpackMerge(basicWebpackServeConfig, htmlOverlay, stylesOverlay, tsOverlay, powertoys_fileOverlay);

View file

@ -1,26 +0,0 @@
#include "pch.h"
#include "StreamUriResolverFromFile.h"
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Streams::IInputStream> StreamUriResolverFromFile::UriToStreamAsync(const winrt::Windows::Foundation::Uri& uri) const
{
winrt::Windows::Storage::StorageFolder folder = winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(winrt::param::hstring(base_path)).get();
std::wstring myuri = uri.Path().c_str();
myuri.erase(0, 1); // Removes the first slash from the URI
std::replace(myuri.begin(), myuri.end(), '/', '\\');
winrt::Windows::Storage::StorageFile file = nullptr;
try
{
file = folder.GetFileAsync(winrt::param::hstring(myuri)).get();
}
catch (winrt::hresult_error const& e)
{
WCHAR message[1024] = L"";
StringCchPrintf(message, ARRAYSIZE(message), L"failed: %ls", e.message().c_str());
MessageBox(NULL, message, L"Error", MB_OK);
}
return file.OpenSequentialReadAsync();
}

View file

@ -1,9 +0,0 @@
#pragma once
#include "pch.h"
struct StreamUriResolverFromFile : winrt::implements<StreamUriResolverFromFile, winrt::Windows::Web::IUriToStreamResolver>
{
WCHAR base_path[MAX_PATH] = L"";
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Streams::IInputStream> UriToStreamAsync(const winrt::Windows::Foundation::Uri& uri) const;
};

View file

@ -1,540 +0,0 @@
#include "pch.h"
#include <Commdlg.h>
#include "StreamUriResolverFromFile.h"
#include <Shellapi.h>
#include <common/interop/two_way_pipe_message_ipc.h>
#include <ShellScalingApi.h>
#include "resource.h"
#include <common/display/dpi_aware.h>
#include <common/comUtils/comUtils.h>
#include "trace.h"
#include <common/utils/elevation.h>
#ifdef _DEBUG
#define _DEBUG_WITH_LOCALHOST 0
// Define as 1 For debug purposes, to access localhost servers.
// webview_process_options.PrivateNetworkClientServerCapability(winrt::Windows::Web::UI::Interop::WebViewControlProcessCapabilityState::Enabled);
// To access localhost:8080 for development, you'll also need to disable loopback restrictions for the webview:
// > checknetisolation LoopbackExempt -a -n=Microsoft.Win32WebViewHost_cw5n1h2txyewy
// To remove the exception after development:
// > checknetisolation LoopbackExempt -d -n=Microsoft.Win32WebViewHost_cw5n1h2txyewy
// Source: https://github.com/windows-toolkit/WindowsCommunityToolkit/issues/2226#issuecomment-396360314
#endif
using namespace winrt;
using namespace winrt::Windows::Foundation;
using namespace winrt::Windows::Storage::Streams;
using namespace winrt::Windows::Web::Http;
using namespace winrt::Windows::Web::Http::Headers;
using namespace winrt::Windows::Web::UI;
using namespace winrt::Windows::Web::UI::Interop;
using namespace winrt::Windows::System;
HINSTANCE g_hinst = nullptr;
HWND g_main_wnd = nullptr;
WebViewControl g_webview = nullptr;
WebViewControlProcess g_webview_process = nullptr;
// Windows message for receiving copied data to send to the webview.
UINT wm_data_for_webview = 0;
// Windows message to destroy the window. Used if:
// - Parent process has terminated.
// - WebView confirms that the Window can close.
UINT wm_destroy_window = 0;
// Message pipe to send/receive messages to/from the Powertoys runner.
TwoWayPipeMessageIPC* g_message_pipe = nullptr;
// Set to true if waiting for webview confirmation before closing the Window.
bool g_waiting_for_close_confirmation = false;
// Is the setting window to be started in dark mode
bool g_start_in_dark_mode = false;
#ifdef _DEBUG
void NavigateToLocalhostReactServer()
{
// Useful for connecting to instance running in react development server.
g_webview.Navigate(Uri(hstring(L"http://localhost:8080")));
}
#endif
#define URI_CONTENT_ID L"\\settings-html"
void NavigateToUri(_In_ LPCWSTR uri_as_string)
{
auto uri_resolver = winrt::make_self<StreamUriResolverFromFile>();
// initialize the base_path for the html content relative to the executable.
WINRT_VERIFY(GetModuleFileName(nullptr, uri_resolver->base_path, MAX_PATH));
WINRT_VERIFY(PathRemoveFileSpec(uri_resolver->base_path));
wcscat_s(uri_resolver->base_path, URI_CONTENT_ID);
Uri url = g_webview.BuildLocalStreamUri(hstring(URI_CONTENT_ID), hstring(uri_as_string));
g_webview.NavigateToLocalStreamUri(url, *uri_resolver);
}
Rect client_rect_to_bounds_rect(_In_ HWND hwnd)
{
RECT client_rect = { 0 };
WINRT_VERIFY(GetClientRect(hwnd, &client_rect));
Rect bounds = {
0,
0,
static_cast<float>(client_rect.right - client_rect.left),
static_cast<float>(client_rect.bottom - client_rect.top)
};
return bounds;
}
void resize_web_view()
{
Rect bounds = client_rect_to_bounds_rect(g_main_wnd);
IWebViewControlSite webViewControlSite = (IWebViewControlSite)g_webview;
webViewControlSite.Bounds(bounds);
}
#define SEND_TO_WEBVIEW_MSG 1
void send_message_to_webview(const std::wstring& msg)
{
if (g_main_wnd != nullptr && wm_data_for_webview != 0)
{
// Allocate the COPYDATASTRUCT and message to pass to the Webview.
// This is needed in order to use PostMessage, since COM calls to
// g_webview.InvokeScriptAsync can't be made from other threads.
PCOPYDATASTRUCT message = new COPYDATASTRUCT();
DWORD buff_size = (DWORD)(msg.length() + 1);
// 'wnd_static_proc()' will free the buffer allocated here.
wchar_t* buffer = new wchar_t[buff_size];
wcscpy_s(buffer, buff_size, msg.c_str());
message->dwData = SEND_TO_WEBVIEW_MSG;
message->cbData = buff_size * sizeof(wchar_t);
message->lpData = (PVOID)buffer;
WINRT_VERIFY(PostMessage(g_main_wnd, wm_data_for_webview, (WPARAM)g_main_wnd, (LPARAM)message));
}
}
void send_message_to_powertoys_runner(const std::wstring& msg)
{
if (g_message_pipe != nullptr)
{
g_message_pipe->send(msg);
}
else
{
// For Debug purposes, in case the webview is being run alone.
#ifdef _DEBUG
MessageBox(g_main_wnd, msg.c_str(), L"From Webview", MB_OK);
//throw in some sample data
std::wstring debug_settings_info(LR"json({
"general": {
"startup": true,
"enabled": {
"Shortcut Guide":false,
"Example PowerToy":true
}
},
"powertoys": {
"Shortcut Guide": {
"version": "1.0",
"name": "Shortcut Guide",
"description": "Shows a help overlay with Windows shortcuts when the Windows key is pressed.",
"icon_key": "pt-shortcut-guide",
"properties": {
"press time" : {
"display_name": "How long to press the Windows key before showing the Shortcut Guide (ms)",
"editor_type": "int_spinner",
"value": 300
}
}
},
"Example PowerToy": {
"version": "1.0",
"name": "Example PowerToy",
"description": "Shows the different controls for the settings.",
"overview_link": "https://github.com/microsoft/PowerToys",
"video_link": "https://www.youtube.com/watch?v=d3LHo2yXKoY&t=21462",
"properties": {
"test bool_toggle": {
"display_name": "This is what a bool_toggle looks like",
"editor_type": "bool_toggle",
"value": false
},
"test int_spinner": {
"display_name": "This is what a int_spinner looks like",
"editor_type": "int_spinner",
"value": 10
},
"test string_text": {
"display_name": "This is what a string_text looks like",
"editor_type": "string_text",
"value": "A sample string value"
},
"test color_picker": {
"display_name": "This is what a color_picker looks like",
"editor_type": "color_picker",
"value": "#0450fd"
},
"test custom_action": {
"display_name": "This is what a custom_action looks like",
"editor_type": "custom_action",
"value": "This is to be custom data. It\ncan\nhave\nmany\nlines\nthat\nshould\nmake\nthe\nfield\nbigger.",
"button_text": "Call a Custom Action!"
}
}
}
}
})json");
send_message_to_webview(debug_settings_info);
#endif
}
}
void receive_message_from_webview(const std::wstring& msg)
{
if (msg[0] == '{')
{
// It's a JSON string, send the message to the PowerToys runner.
std::thread(send_message_to_powertoys_runner, msg).detach();
}
else
{
// It's not a JSON string, check for expected control messages.
if (msg == L"exit")
{
// WebView confirms the settings application can exit.
WINRT_VERIFY(PostMessage(g_main_wnd, wm_destroy_window, 0, 0));
}
else if (msg == L"cancel-exit")
{
// WebView canceled the exit request.
g_waiting_for_close_confirmation = false;
}
}
}
void initialize_webview(int nShowCmd)
{
try
{
g_webview_process = WebViewControlProcess();
auto asyncwebview = g_webview_process.CreateWebViewControlAsync((int64_t)g_main_wnd, client_rect_to_bounds_rect(g_main_wnd));
asyncwebview.Completed([=](IAsyncOperation<WebViewControl> const& sender, AsyncStatus status) {
if (status == AsyncStatus::Completed)
{
WINRT_VERIFY(sender != nullptr);
g_webview = sender.GetResults();
WINRT_VERIFY(g_webview != nullptr);
// In order to receive window.external.notify() calls in ScriptNotify
g_webview.Settings().IsScriptNotifyAllowed(true);
g_webview.Settings().IsJavaScriptEnabled(true);
g_webview.NewWindowRequested([=](IWebViewControl sender_requester, WebViewControlNewWindowRequestedEventArgs args) {
// Open the requested link in the default browser registered in the Shell
using winrt::Windows::Foundation::Uri;
Uri uri = args.Uri();
// WebView doesn't let us to open ms-settings:protocol links directly, so we translate it
// from a https placeholder
if (uri.AbsoluteUri() == L"https://ms_settings_startupapps/")
uri = Uri{ L"ms-settings:startupapps" };
winrt::Windows::System::Launcher::LaunchUriAsync(uri);
});
g_webview.ContentLoading([=](IWebViewControl sender, WebViewControlContentLoadingEventArgs const& args) {
ShowWindow(g_main_wnd, nShowCmd);
});
g_webview.ScriptNotify([=](IWebViewControl sender_script_notify, WebViewControlScriptNotifyEventArgs const& args_script_notify) {
// content called window.external.notify()
std::wstring message_sent = args_script_notify.Value().c_str();
receive_message_from_webview(message_sent);
});
g_webview.AcceleratorKeyPressed([&](IWebViewControl sender, WebViewControlAcceleratorKeyPressedEventArgs const& args) {
if (args.VirtualKey() == winrt::Windows::System::VirtualKey::F4)
{
// WebView swallows key-events. Detect Alt-F4 one and close the window manually.
const auto _ = g_webview.InvokeScriptAsync(hstring(L"exit_settings_app"), {});
}
});
resize_web_view();
#if defined(_DEBUG) && _DEBUG_WITH_LOCALHOST
// Navigates to localhost:8080
NavigateToLocalhostReactServer();
#else
// Navigates to settings-html/index.html or index-dark.html
NavigateToUri(g_start_in_dark_mode ? L"index-dark.html" : L"index.html");
#endif
}
else if (status == AsyncStatus::Error)
{
MessageBox(NULL, L"Failed to create the WebView control.\nPlease report the bug to https://aka.ms/powerToysReportBug", L"PowerToys Settings Error", MB_OK);
Trace::SettingsInitError(Trace::SettingsInitErrorCause::WebViewInitAsyncError);
exit(1);
}
else if (status == AsyncStatus::Started)
{
// Ignore.
}
else if (status == AsyncStatus::Canceled)
{
// Ignore.
}
});
}
catch (hresult_error const& e)
{
Trace::SettingsInitError(Trace::SettingsInitErrorCause::WebViewInitWinRTException);
WCHAR message[1024] = L"";
StringCchPrintf(message, ARRAYSIZE(message), L"failed: %ls", e.message().c_str());
MessageBox(g_main_wnd, message, L"Error", MB_OK);
}
}
LRESULT CALLBACK wnd_proc_static(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_CLOSE:
if (g_waiting_for_close_confirmation)
{
// If another WM_CLOSE is received while waiting for webview confirmation,
// allow DefWindowProc to be called and destroy the window.
break;
}
else
{
// Allow user to confirm exit in the WebView in case there's possible data loss.
g_waiting_for_close_confirmation = true;
if (g_webview != nullptr)
{
const auto _ = g_webview.InvokeScriptAsync(hstring(L"exit_settings_app"), {});
}
else
{
break;
}
return 0;
}
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_SIZE:
if (g_webview != nullptr)
{
resize_web_view();
}
break;
case WM_CREATE:
wm_data_for_webview = RegisterWindowMessageW(L"PTSettingsCopyDataWebView");
wm_destroy_window = RegisterWindowMessageW(L"PTSettingsParentTerminated");
break;
case WM_DPICHANGED:
{
// Resize the window using the suggested rect
RECT* const prcNewWindow = (RECT*)lParam;
SetWindowPos(hWnd,
nullptr,
prcNewWindow->left,
prcNewWindow->top,
prcNewWindow->right - prcNewWindow->left,
prcNewWindow->bottom - prcNewWindow->top,
SWP_NOZORDER | SWP_NOACTIVATE);
}
break;
case WM_NCCREATE:
{
// Enable auto-resizing the title bar
EnableNonClientDpiScaling(hWnd);
}
break;
default:
if (message == wm_data_for_webview)
{
PCOPYDATASTRUCT msg = (PCOPYDATASTRUCT)lParam;
if (msg->dwData == SEND_TO_WEBVIEW_MSG)
{
wchar_t* json_message = (wchar_t*)(msg->lpData);
if (g_webview != nullptr)
{
const auto _ = g_webview.InvokeScriptAsync(hstring(L"receive_from_settings_app"), { hstring(json_message) });
}
delete[] json_message;
}
// wnd_proc_static is responsible for freeing memory.
delete msg;
}
else
{
if (message == wm_destroy_window)
{
DestroyWindow(hWnd);
}
}
break;
}
return DefWindowProc(hWnd, message, wParam, lParam);
;
}
void register_classes(HINSTANCE hInstance)
{
WNDCLASSEXW wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = 0;
wcex.lpfnWndProc = wnd_proc_static;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(APPICON));
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
wcex.hbrBackground = g_start_in_dark_mode ? CreateSolidBrush(0) : (HBRUSH)(COLOR_WINDOW + 1);
wcex.lpszMenuName = nullptr;
wcex.lpszClassName = L"PTSettingsClass";
wcex.hIconSm = nullptr;
WINRT_VERIFY(RegisterClassExW(&wcex));
}
HWND create_main_window(HINSTANCE hInstance)
{
RECT desktopRect;
const HWND hDesktop = GetDesktopWindow();
WINRT_VERIFY(hDesktop != nullptr);
WINRT_VERIFY(GetWindowRect(hDesktop, &desktopRect));
int wind_width = 1024;
int wind_height = 700;
DPIAware::Convert(nullptr, wind_width, wind_height);
return CreateWindowW(
L"PTSettingsClass",
L"PowerToys Settings",
WS_OVERLAPPEDWINDOW,
(desktopRect.right - wind_width) / 2,
(desktopRect.bottom - wind_height) / 2,
wind_width,
wind_height,
nullptr,
nullptr,
hInstance,
nullptr);
}
void wait_on_parent_process_thread(DWORD pid)
{
HANDLE process = OpenProcess(SYNCHRONIZE, FALSE, pid);
if (process != nullptr)
{
if (WaitForSingleObject(process, INFINITE) == WAIT_OBJECT_0)
{
// If it's possible to detect when the PowerToys process terminates, message the main window.
CloseHandle(process);
if (g_main_wnd)
{
WINRT_VERIFY(PostMessage(g_main_wnd, wm_destroy_window, 0, 0));
}
}
else
{
CloseHandle(process);
}
}
}
void quit_when_parent_terminates(std::wstring parent_pid)
{
DWORD pid = std::stol(parent_pid);
std::thread(wait_on_parent_process_thread, pid).detach();
}
// Parse arguments: initialize two-way IPC message pipe and if settings window is to be started
// in dark mode.
void parse_args()
{
// Expected calling arguments:
// [0] - This executable's path.
// [1] - PowerToys pipe server.
// [2] - Settings pipe server.
// [3] - PowerToys process pid.
// [4] - optional "dark" parameter if the settings window is to be started in dark mode
LPWSTR* argument_list;
int n_args;
argument_list = CommandLineToArgvW(GetCommandLineW(), &n_args);
if (n_args > 3)
{
g_message_pipe = new TwoWayPipeMessageIPC(std::wstring(argument_list[2]), std::wstring(argument_list[1]), send_message_to_webview);
g_message_pipe->start(nullptr);
quit_when_parent_terminates(std::wstring(argument_list[3]));
}
else
{
#ifndef _DEBUG
MessageBox(nullptr, L"This executable isn't supposed to be called as a stand-alone process", L"Error running settings", MB_OK);
exit(1);
#endif
}
if (n_args > 4)
{
g_start_in_dark_mode = wcscmp(argument_list[4], L"dark") == 0;
}
LocalFree(argument_list);
}
int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nShowCmd)
{
Trace::RegisterProvider();
CoInitialize(nullptr);
const wchar_t* security_descriptor =
L"O:BA" // Owner: Builtin (local) administrator
L"G:BA" // Group: Builtin (local) administrator
L"D:"
L"(A;;0x7;;;PS)" // Access allowed on COM_RIGHTS_EXECUTE, _LOCAL, & _REMOTE for Personal self
L"(A;;0x3;;;SY)" // Access allowed on COM_RIGHTS_EXECUTE, & _LOCAL for Local system
L"(A;;0x7;;;BA)" // Access allowed on COM_RIGHTS_EXECUTE, _LOCAL, & _REMOTE for Builtin (local) administrator
L"(A;;0x3;;;S-1-15-3-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646)" // Access allowed on COM_RIGHTS_EXECUTE, & _LOCAL for Win32WebViewHost package capability
L"S:"
L"(ML;;NX;;;LW)"; // Integrity label on No execute up for Low mandatory level
const bool should_try_drop_privileges = !initializeCOMSecurity(security_descriptor) && is_process_elevated(false);
if (should_try_drop_privileges)
{
if (!drop_elevated_privileges())
{
MessageBox(NULL, L"Failed to drop admin privileges.\nPlease report the bug to https://aka.ms/powerToysReportBug", L"PowerToys Settings Error", MB_OK);
Trace::SettingsInitError(Trace::SettingsInitErrorCause::FailedToDropPrivileges);
exit(1);
}
}
g_hinst = hInstance;
parse_args();
register_classes(hInstance);
g_main_wnd = create_main_window(hInstance);
if (g_main_wnd == nullptr)
{
MessageBox(NULL, L"Failed to create main window.\nPlease report the bug to https://aka.ms/powerToysReportBug", L"PowerToys Settings Error", MB_OK);
exit(1);
}
initialize_webview(nShowCmd);
// Main message loop.
MSG msg;
while (GetMessage(&msg, nullptr, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
Trace::UnregisterProvider();
return (int)msg.wParam;
}

View file

@ -1,89 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{07C389E3-6BC8-41CF-923E-307B1265FA2D}</ProjectGuid>
<RootNamespace>PowerToysSettingsEditor</RootNamespace>
<ProjectName>old-settings-ui</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<TargetName>PowerToysSettings</TargetName>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..;..\common\Telemetry;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>Shlwapi.lib;Shcore.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>XCOPY "$(ProjectDir)settings-html" "$(TargetDir)\settings-html\" /S /I /Y</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>Copying web assets</Message>
</PostBuildEvent>
<Manifest>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="StreamUriResolverFromFile.h" />
<ClInclude Include="trace.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\common\interop\two_way_pipe_message_ipc.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="StreamURIResolverFromFile.cpp" />
<ClCompile Include="trace.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="settings.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="..\runner\svgs\icon.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\common\COMUtils\COMUtils.vcxproj">
<Project>{7319089e-46d6-4400-bc65-e39bdf1416ee}</Project>
</ProjectReference>
<ProjectReference Include="..\common\Display\Display.vcxproj">
<Project>{caba8dfb-823b-4bf2-93ac-3f31984150d9}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
</Project>

View file

@ -1,61 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="StreamUriResolverFromFile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="trace.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="StreamURIResolverFromFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="trace.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\common\interop\two_way_pipe_message_ipc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="settings.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="..\runner\svgs\icon.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.200729.8" targetFramework="native" />
</packages>

View file

@ -1 +0,0 @@
#include "pch.h"

View file

@ -1,23 +0,0 @@
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#pragma push_macro("GetCurrentTime")
#undef GetCurrentTime
// include winrt headers with fix for "warning C4002: Too many arguments for function-like macro invocation GetCurrentTime"
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Web.h>
#include <winrt/Windows.System.h>
#include <winrt/Windows.Web.UI.h>
#include <winrt/Windows.Web.UI.Interop.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Web.Http.h>
#include <winrt/Windows.Web.Http.Headers.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Storage.Streams.h>
#pragma pop_macro("GetCurrentTime")
#include <strsafe.h>
#include <Shlwapi.h>
#include <ProjectTelemetry.h>
#include <thread>

View file

@ -1,15 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by settings.rc
//////////////////////////////
// Non-localizable
#define FILE_DESCRIPTION "PowerToys Settings"
#define INTERNAL_NAME "PowerToysSettings"
#define ORIGINAL_FILENAME "PowerToysSettings.exe"
// Non-localizable
//////////////////////////////
#define APPICON 101

File diff suppressed because one or more lines are too long

View file

@ -1,32 +0,0 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/** @license React v0.13.6
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.8.6
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.8.6
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

View file

@ -1,63 +0,0 @@
.body {
display: flex;
flex-direction: row;
height: 100%;
}
.body .sidebar {
order: -1;
max-width: 228px;
min-width: 228px;
flex-basis: 228px;
display: flex;
flex-direction: column;
}
.body .sidebar.collapsed {
max-width: 48px;
min-width: 48px;
flex-basis: 48px;
}
.body .editorzone {
display: flex;
flex-direction: column;
flex-grow: 1;
}
.body .editorzone .editorhead {
display: flex;
flex-direction: row;
flex-grow: 1;
min-height: 50px;
max-height: 50px;
border-bottom: 1px solid #f3f2f1;
padding-left: 16px;
padding-right: 16px;
}
.body .editorzone .editorhead .editortitle {
align-self: center;
flex-basis: 0;
flex-grow: 1;
flex-shrink: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.body .editorzone .editorhead .editorheadbuttons {
justify-self: right;
justify-content: right;
align-self: center;
}
.body .editorzone .editorbody {
display: flex;
position: relative;
flex-direction: column;
flex-grow: 1;
}
.SubHeader{
font-weight: bold;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,39 +0,0 @@
#include <windows.h>
⌀椀渀挀氀甀搀攀 ∀爀攀猀漀甀爀挀攀⸀栀∀ഀ<EFBFBD>
⌀椀渀挀氀甀搀攀 ∀⸀⸀⼀挀漀洀洀漀渀⼀瘀攀爀猀椀漀渀⼀瘀攀爀猀椀漀渀⸀栀∀ഀ<EFBFBD>
<EFBFBD>
䄀倀倀䤀䌀伀一 䤀䌀伀一 ∀⸀⸀尀尀爀甀渀渀攀爀尀尀猀瘀最猀尀尀椀挀漀渀⸀椀挀漀∀ഀ<EFBFBD>
<EFBFBD>
 嘀䔀刀匀䤀伀一䤀一䘀伀ഀ<EFBFBD>
䘀䤀䰀䔀嘀䔀刀匀䤀伀一 䘀䤀䰀䔀开嘀䔀刀匀䤀伀一ഀ<EFBFBD>
倀刀伀䐀唀䌀吀嘀䔀刀匀䤀伀一 倀刀伀䐀唀䌀吀开嘀䔀刀匀䤀伀一ഀ<EFBFBD>
䘀䤀䰀䔀䘀䰀䄀䜀匀䴀䄀匀䬀 嘀匀开䘀䘀䤀开䘀䤀䰀䔀䘀䰀䄀䜀匀䴀䄀匀䬀ഀ<EFBFBD>
⌀椀昀搀攀昀 开䐀䔀䈀唀䜀ഀ<EFBFBD>
䘀䤀䰀䔀䘀䰀䄀䜀匀 嘀匀开䘀䘀开䐀䔀䈀唀䜀ഀ<EFBFBD>
⌀攀氀猀攀ഀ<EFBFBD>
䘀䤀䰀䔀䘀䰀䄀䜀匀   䰀ഀ<EFBFBD>
⌀攀渀搀椀昀ഀ<EFBFBD>
䘀䤀䰀䔀伀匀 嘀伀匀开一吀开圀䤀一䐀伀圀匀㌀㈀ഀ<EFBFBD>
䘀䤀䰀䔀吀夀倀䔀 嘀䘀吀开䐀䰀䰀ഀ<EFBFBD>
䘀䤀䰀䔀匀唀䈀吀夀倀䔀 嘀䘀吀㈀开唀一䬀一伀圀一 <EFBFBD>
䈀䔀䜀䤀一ഀ<EFBFBD>
    䈀䰀伀䌀䬀 ∀匀琀爀椀渀最䘀椀氀攀䤀渀昀漀∀ഀ<EFBFBD>
    䈀䔀䜀䤀一ഀ<EFBFBD>
        䈀䰀伀䌀䬀    㐀戀  ⼀⼀ 唀匀 䔀渀最氀椀猀栀    㤀⤀Ⰰ 唀渀椀挀漀搀攀   㐀䈀  挀栀愀爀猀攀琀ഀ<EFBFBD>
        䈀䔀䜀䤀一ഀ<EFBFBD>
            嘀䄀䰀唀䔀 ∀䌀漀洀瀀愀渀礀一愀洀攀∀Ⰰ 䌀伀䴀倀䄀一夀开一䄀䴀䔀ഀ<EFBFBD>
            嘀䄀䰀唀䔀 ∀䘀椀氀攀䐀攀猀挀爀椀瀀琀椀漀渀∀Ⰰ 䘀䤀䰀䔀开䐀䔀匀䌀刀䤀倀吀䤀伀一ഀ<EFBFBD>
            嘀䄀䰀唀䔀 ∀䘀椀氀攀嘀攀爀猀椀漀渀∀Ⰰ 䘀䤀䰀䔀开嘀䔀刀匀䤀伀一开匀吀刀䤀一䜀ഀ<EFBFBD>
            嘀䄀䰀唀䔀 ∀䤀渀琀攀爀渀愀氀一愀洀攀∀Ⰰ 䤀一吀䔀刀一䄀䰀开一䄀䴀䔀ഀ<EFBFBD>
            嘀䄀䰀唀䔀 ∀䰀攀最愀氀䌀漀瀀礀爀椀最栀琀∀Ⰰ 䌀伀倀夀刀䤀䜀䠀吀开一伀吀䔀ഀ<EFBFBD>
            嘀䄀䰀唀䔀 ∀伀爀椀最椀渀愀氀䘀椀氀攀渀愀洀攀∀Ⰰ 伀刀䤀䜀䤀一䄀䰀开䘀䤀䰀䔀一䄀䴀䔀ഀ<EFBFBD>
            嘀䄀䰀唀䔀 ∀倀爀漀搀甀挀琀一愀洀攀∀Ⰰ 倀刀伀䐀唀䌀吀开一䄀䴀䔀ഀ<EFBFBD>
            嘀䄀䰀唀䔀 ∀倀爀漀搀甀挀琀嘀攀爀猀椀漀渀∀Ⰰ 倀刀伀䐀唀䌀吀开嘀䔀刀匀䤀伀一开匀吀刀䤀一䜀ഀ<EFBFBD>
        䔀一䐀ഀ<EFBFBD>
    䔀一䐀ഀ<EFBFBD>
    䈀䰀伀䌀䬀 ∀嘀愀爀䘀椀氀攀䤀渀昀漀∀ഀ<EFBFBD>
    䈀䔀䜀䤀一ഀ<EFBFBD>
        嘀䄀䰀唀䔀 ∀吀爀愀渀猀氀愀琀椀漀渀∀Ⰰ  砀㐀 㤀Ⰰ ㄀㈀   ⼀⼀ 唀匀 䔀渀最氀椀猀栀    㤀⤀Ⰰ 唀渀椀挀漀搀攀 ㄀㈀   挀栀愀爀猀攀琀ഀ<EFBFBD>
    䔀一䐀ഀ<EFBFBD>
䔀一䐀ഀ<EFBFBD>
<EFBFBD>

View file

@ -1,45 +0,0 @@
#include "pch.h"
#include "trace.h"
TRACELOGGING_DEFINE_PROVIDER(
g_hProvider,
"Microsoft.PowerToys",
// {38e8889b-9731-53f5-e901-e8a7c1753074}
(0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74),
TraceLoggingOptionProjectTelemetry());
const char* settingsInitErrorCauseAsString(Trace::SettingsInitErrorCause error_case)
{
switch (error_case)
{
case Trace::SettingsInitErrorCause::WebViewInitAsyncError:
return "WebViewInitAsyncError";
case Trace::SettingsInitErrorCause::WebViewInitWinRTException:
return "WebViewInitWinRTException";
case Trace::SettingsInitErrorCause::FailedToDropPrivileges:
return "FailedToDropPrivileges";
default:
return "UnknownError";
};
}
void Trace::SettingsInitError(const Trace::SettingsInitErrorCause error_cause)
{
TraceLoggingWrite(
g_hProvider,
"PowerToysSettings_SettingsInitError",
TraceLoggingString(settingsInitErrorCauseAsString(error_cause), "Cause"),
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"),
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
}
void Trace::RegisterProvider() noexcept
{
TraceLoggingRegister(g_hProvider);
}
void Trace::UnregisterProvider() noexcept
{
TraceLoggingUnregister(g_hProvider);
}

View file

@ -1,17 +0,0 @@
#pragma once
class Trace
{
public:
enum class SettingsInitErrorCause : int32_t
{
WebViewInitAsyncError,
WebViewInitWinRTException,
FailedToDropPrivileges,
};
static void SettingsInitError(const SettingsInitErrorCause error_cause);
static void RegisterProvider() noexcept;
static void UnregisterProvider() noexcept;
};