Skip to content

Commit

Permalink
[Settings] New UX (#12470)
Browse files Browse the repository at this point in the history
* Removed hardcoded background

* Background

* Updated pages

* Added OOBE to shellpage

* Margin fixes

* Fix

* Resource update

* Resource string update

* Removed reference from installer file

* Updated UI fixes and remove conflicts

* Adding new settings control

* PowerRename

* Sidepanel updates

* Shortcut Guide

* Updates screeens

* General page updates

* Awake UX update

* Changed order for power preview note

* Fixes

* UI fixes

* KBM

* IsEnabled state support

* Added new controls

* Update

* Updated nugest packages

* Replaced itemscontrol

* Introducing setting button style

* FancyZones page

* Plugin page

* Switch case

* Fixed typo

* Plugin manager update

* Introducing SettingExpander

* Setting automation properties

* Accesibility improvements

* VCM and cleanup

* Refactoring OOBE pages part 1

* OOBE XAML refactoring

* Added MinWidth to actioncontent controls

* Updates to various settings

* Spell update

* Update to author label

* Clean up

* Removing redunant files

* Move file

* Updated files

* Revert "Updated files"

This reverts commit 1a5c887.

* Revert "Move file"

This reverts commit 2b06c75.

* Revert "Removing redunant files"

This reverts commit fe79ec1.

* Revert "Clean up"

This reverts commit 028e15f.

* Removed redundant styles

* Revert "Removed redundant styles"

This reverts commit dfdfd65.

* Files cleanup

* Removing converter, updating background and paddings

* Styling updates

* Unit test updates

* Fixes

* Installer fixes

* Update Resources.resw

* Shell page updates

* Updated pagelinks

* Styles re-ordering

* Updated converter

* Updated ToggleSwitch style

* Bugfixes

* Typo fix

* [Settings] New UX - installer dll fixes (#12818)

* [Settings] New UX - Fix some failing tests (#12822)

* Bugfixes

* Typo fix

* Hiding VCM

* Bugfixes

* Download button fix

* Remove Newtonsoft.Json from installer file

* Updated visuals

* Bugfixes

* Syntax fix

* Updated installer file

* Bugfixes

* New label

* Theming support for OOBE

* Put back in Documentation hyperlink

* Right uid

Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
  • Loading branch information
3 people committed Aug 23, 2021
1 parent c125cc2 commit eb2ef70
Show file tree
Hide file tree
Showing 68 changed files with 3,707 additions and 3,417 deletions.
2 changes: 2 additions & 0 deletions .github/actions/spell-check/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ accessibilityinsights
Acl
aclapi
AColumn
Accessible
acos
acrt
Actioncenter
Expand Down Expand Up @@ -270,6 +271,7 @@ codereview
Codespaces
COINIT
colorconv
colorformat
colorhistory
colorhistorylimit
COLORKEY
Expand Down
6 changes: 3 additions & 3 deletions installer/PowerToysSetup/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@
<File Source="$(var.BinX64Dir)Settings\PowerToys.Settings.exe"/>
<File Source="$(var.BinX64Dir)Settings\Microsoft.PowerToys.Settings.UI.exe"/>
<!-- dll -->
<?foreach File in concrt140_app.dll;Microsoft.Bcl.AsyncInterfaces.dll;System.IO.Abstractions.dll;Microsoft.PowerToys.Settings.UI.Lib.dll;PowerToys.Settings.dll;Microsoft.Toolkit.dll;Microsoft.Toolkit.Uwp.dll;Microsoft.Toolkit.Uwp.UI.dll;Microsoft.Toolkit.Win32.UI.XamlHost.dll;Microsoft.Toolkit.Win32.UI.XamlHost.Managed.dll;Microsoft.Toolkit.Wpf.UI.Controls.dll;Microsoft.Toolkit.Wpf.UI.XamlHost.dll;Microsoft.UI.Xaml.dll;Microsoft.Xaml.Interactions.dll;Microsoft.Xaml.Interactivity.dll;msvcp140_1_app.dll;msvcp140_2_app.dll;msvcp140_app.dll;Newtonsoft.Json.dll;PowerToysInterop.dll;System.Runtime.CompilerServices.Unsafe.dll;System.Text.Encodings.Web.dll;System.Text.Json.dll;vcamp140_app.dll;vccorlib140_app.dll;vcomp140_app.dll;vcruntime140_1_app.dll;vcruntime140_app.dll;ManagedTelemetry.dll;ManagedCommon.dll;ColorCode.Core.dll;ColorCode.UWP.dll;Microsoft.Graphics.Canvas.winmd;Microsoft.Toolkit.Parsers.dll;Microsoft.Toolkit.Uwp.UI.Animations.dll;Microsoft.Toolkit.Uwp.UI.Controls.dll?>
<?foreach File in concrt140_app.dll;Microsoft.Bcl.AsyncInterfaces.dll;System.IO.Abstractions.dll;Microsoft.PowerToys.Settings.UI.Lib.dll;PowerToys.Settings.dll;Microsoft.Toolkit.dll;Microsoft.Toolkit.Uwp.dll;Microsoft.Toolkit.Uwp.UI.dll;Microsoft.Toolkit.Win32.UI.XamlHost.dll;Microsoft.Toolkit.Win32.UI.XamlHost.Managed.dll;Microsoft.Toolkit.Wpf.UI.Controls.dll;Microsoft.Toolkit.Wpf.UI.XamlHost.dll;Microsoft.UI.Xaml.dll;Microsoft.Xaml.Interactions.dll;Microsoft.Xaml.Interactivity.dll;msvcp140_1_app.dll;msvcp140_2_app.dll;msvcp140_app.dll;PowerToysInterop.dll;System.Runtime.CompilerServices.Unsafe.dll;System.Text.Encodings.Web.dll;System.Text.Json.dll;vcamp140_app.dll;vccorlib140_app.dll;vcomp140_app.dll;vcruntime140_1_app.dll;vcruntime140_app.dll;ManagedTelemetry.dll;ManagedCommon.dll;ColorCode.Core.dll;ColorCode.UWP.dll;Microsoft.Graphics.Canvas.winmd;Microsoft.Toolkit.Uwp.UI.Controls.Core.dll;Microsoft.Toolkit.Uwp.UI.Controls.DataGrid.dll;Microsoft.Toolkit.Uwp.UI.Controls.Input.dll;Microsoft.Toolkit.Uwp.UI.Controls.Layout.dll;Microsoft.Toolkit.Uwp.UI.Controls.Markdown.dll;Microsoft.Toolkit.Uwp.UI.Controls.Media.dll;Microsoft.Toolkit.Uwp.UI.Controls.Primitives.dll?>
<File Id="SettingsV2_$(var.File)" Source="$(var.BinX64Dir)Settings\$(var.File)" />
<?endforeach?>
<!-- json -->
Expand Down Expand Up @@ -848,7 +848,7 @@
</DirectoryRef>
<DirectoryRef Id="SettingsV2OOBEAssetsFluentIconsInstallFolder" FileSource="$(var.BinX64Dir)Settings\Assets\FluentIcons">
<Component Id="SettingsV2OOBEAssetsFluentIcons" Guid="6A380D5A-DA63-45B5-B68F-06D57CDD1B9C" Win64="yes">
<?foreach File in ColorPicker.png;FancyZones.png;Awake.png;FileExplorerPreview.png;ImageResizer.png;KeyboardManager.png;PowerRename.png;PowerToys.png;PowerToysRun.png;ShortcutGuide.png;VideoConferenceMute.png ?>
<?foreach File in ColorPicker.png;FancyZones.png;Awake.png;FileExplorerPreview.png;ImageResizer.png;KeyboardManager.png;PowerRename.png;PowerToys.png;PowerToysRun.png;Settings.png;ShortcutGuide.png;VideoConferenceMute.png ?>
<File Id="SettingsV2OOBEAssetsFluentIcons_$(var.File)" Source="$(var.BinX64Dir)Settings\Assets\FluentIcons\FluentIcons$(var.File)" />
<?endforeach?>
</Component>
Expand All @@ -869,7 +869,7 @@
</DirectoryRef>
<DirectoryRef Id="SettingsV2StylesInstallFolder" FileSource="$(var.BinX64Dir)Settings\Styles">
<Component Id="SettingsV2Styles" Guid="44B5C0E0-76DA-4604-BB86-FCD27A00EB71" Win64="yes">
<?foreach File in Page.xbf;TextBlock.xbf;_Colors.xbf;_FontSizes.xbf;_Sizes.xbf;_Thickness.xbf;Button.xbf?>
<?foreach File in TextBlock.xbf;Button.xbf?>
<File Id="SettingsV2_Styles_$(var.File)" Source="$(var.BinX64Dir)Settings\Styles\$(var.File)" />
<?endforeach?>
</Component>
Expand Down
4 changes: 2 additions & 2 deletions src/runner/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@
<value>Settings</value>
</data>
<data name="DOCUMENTATION_MENU_TEXT" xml:space="preserve">
<value>Open documentation</value>
<value>Documentation</value>
</data>
<data name="EXIT_MENU_TEXT" xml:space="preserve">
<value>Exit</value>
<comment>Exit as a verb, as in Exit the application</comment>
</data>
<data name="SUBMIT_BUG_TEXT" xml:space="preserve">
<value>Report Bug</value>
<value>Report bug</value>
</data>
<data name="BUGREPORT_SUCCESS" xml:space="preserve">
<value>Bug report .zip file has been created on your Desktop.</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ public GeneralViewModel(ISettingsRepository<GeneralSettings> settingsRepository,
// normalization for switch statements
switch (GeneralSettingsConfig.Theme.ToUpperInvariant())
{
case "LIGHT":
_isLightThemeRadioButtonChecked = true;
break;
case "DARK":
_isDarkThemeRadioButtonChecked = true;
_themeIndex = 0;
break;
case "LIGHT":
_themeIndex = 1;
break;
case "SYSTEM":
_isSystemThemeRadioButtonChecked = true;
_themeIndex = 2;
break;
}

Expand Down Expand Up @@ -116,9 +116,8 @@ public GeneralViewModel(ISettingsRepository<GeneralSettings> settingsRepository,
private bool _isElevated;
private bool _runElevated;
private bool _isAdmin;
private bool _isDarkThemeRadioButtonChecked;
private bool _isLightThemeRadioButtonChecked;
private bool _isSystemThemeRadioButtonChecked;
private int _themeIndex;

private bool _autoDownloadUpdates;

private UpdatingSettings.UpdatingState _updatingState = UpdatingSettings.UpdatingState.UpToDate;
Expand Down Expand Up @@ -255,81 +254,33 @@ public static bool AutoUpdatesEnabled
}
}

[SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "This may throw if the XAML page is not initialized in tests (https://github.com/microsoft/PowerToys/pull/2676)")]
public bool IsDarkThemeRadioButtonChecked
public int ThemeIndex
{
get
{
return _isDarkThemeRadioButtonChecked;
return _themeIndex;
}

set
{
if (value == true)
if (_themeIndex != value)
{
GeneralSettingsConfig.Theme = "dark";
_isDarkThemeRadioButtonChecked = value;
try
switch (value)
{
UpdateUIThemeCallBack(GeneralSettingsConfig.Theme);
}
catch (Exception e)
{
Logger.LogError("Exception encountered when changing Settings theme", e);
case 0: GeneralSettingsConfig.Theme = "dark"; break;
case 1: GeneralSettingsConfig.Theme = "light"; break;
case 2: GeneralSettingsConfig.Theme = "system"; break;
}

NotifyPropertyChanged();
}
}
}
_themeIndex = value;

[SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "This may throw if the XAML page is not initialized in tests (https://github.com/microsoft/PowerToys/pull/2676)")]
public bool IsLightThemeRadioButtonChecked
{
get
{
return _isLightThemeRadioButtonChecked;
}

set
{
if (value == true)
{
GeneralSettingsConfig.Theme = "light";
_isLightThemeRadioButtonChecked = value;
try
{
UpdateUIThemeCallBack(GeneralSettingsConfig.Theme);
}
catch (Exception e)
{
Logger.LogError("Exception encountered when changing Settings theme", e);
}

NotifyPropertyChanged();
}
}
}

[SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "This may throw if the XAML page is not initialized in tests (https://github.com/microsoft/PowerToys/pull/2676)")]
public bool IsSystemThemeRadioButtonChecked
{
get
{
return _isSystemThemeRadioButtonChecked;
}

set
{
if (value == true)
{
GeneralSettingsConfig.Theme = "system";
_isSystemThemeRadioButtonChecked = value;
try
{
UpdateUIThemeCallBack(GeneralSettingsConfig.Theme);
}
#pragma warning disable CA1031 // Do not catch general exception types
catch (Exception e)
#pragma warning restore CA1031 // Do not catch general exception types
{
Logger.LogError("Exception encountered when changing Settings theme", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,6 @@ public string IconPath
}
}

private bool _showAdditionalInfoPanel;

public bool ShowAdditionalInfoPanel
{
get => _showAdditionalInfoPanel;
set
{
if (value != _showAdditionalInfoPanel)
{
_showAdditionalInfoPanel = value;
NotifyPropertyChanged();
}
}
}

public event PropertyChangedEventHandler PropertyChanged;

private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
{
public class PowerLauncherViewModel : Observable
{
private bool _isDarkThemeRadioButtonChecked;
private bool _isLightThemeRadioButtonChecked;
private bool _isSystemThemeRadioButtonChecked;

private bool _isCursorPositionRadioButtonChecked;
private bool _isPrimaryMonitorPositionRadioButtonChecked;
private bool _isFocusPositionRadioButtonChecked;
private int _themeIndex;
private int _monitorPositionIndex;

private string _searchText;

Expand Down Expand Up @@ -75,27 +70,27 @@ public PowerLauncherViewModel(PowerLauncherSettings settings, ISettingsRepositor

switch (settings.Properties.Theme)
{
case Theme.Light:
_isLightThemeRadioButtonChecked = true;
break;
case Theme.Dark:
_isDarkThemeRadioButtonChecked = true;
_themeIndex = 0;
break;
case Theme.Light:
_themeIndex = 1;
break;
case Theme.System:
_isSystemThemeRadioButtonChecked = true;
_themeIndex = 2;
break;
}

switch (settings.Properties.Position)
{
case StartupPosition.Cursor:
_isCursorPositionRadioButtonChecked = true;
_monitorPositionIndex = 0;
break;
case StartupPosition.PrimaryMonitor:
_isPrimaryMonitorPositionRadioButtonChecked = true;
_monitorPositionIndex = 1;
break;
case StartupPosition.Focus:
_isFocusPositionRadioButtonChecked = true;
_monitorPositionIndex = 2;
break;
}

Expand Down Expand Up @@ -199,112 +194,46 @@ public int MaximumNumberOfResults
}
}

public bool IsDarkThemeRadioButtonChecked
{
get
{
return _isDarkThemeRadioButtonChecked;
}

set
{
if (value == true)
{
settings.Properties.Theme = Theme.Dark;
_isDarkThemeRadioButtonChecked = value;

UpdateSettings();
}
}
}

public bool IsLightThemeRadioButtonChecked
{
get
{
return _isLightThemeRadioButtonChecked;
}

set
{
if (value == true)
{
settings.Properties.Theme = Theme.Light;
_isDarkThemeRadioButtonChecked = value;

UpdateSettings();
}
}
}

public bool IsSystemThemeRadioButtonChecked
{
get
{
return _isSystemThemeRadioButtonChecked;
}

set
{
if (value == true)
{
settings.Properties.Theme = Theme.System;
_isDarkThemeRadioButtonChecked = value;

UpdateSettings();
}
}
}

public bool IsCursorPositionRadioButtonChecked
public int ThemeIndex
{
get
{
return _isCursorPositionRadioButtonChecked;
return _themeIndex;
}

set
{
if (value == true)
switch (value)
{
settings.Properties.Position = StartupPosition.Cursor;
_isCursorPositionRadioButtonChecked = value;
UpdateSettings();
case 0: settings.Properties.Theme = Theme.Dark; break;
case 1: settings.Properties.Theme = Theme.Light; break;
case 2: settings.Properties.Theme = Theme.System; break;
}
}
}

public bool IsPrimaryMonitorPositionRadioButtonChecked
{
get
{
return _isPrimaryMonitorPositionRadioButtonChecked;
}

set
{
if (value == true)
{
settings.Properties.Position = StartupPosition.PrimaryMonitor;
_isPrimaryMonitorPositionRadioButtonChecked = value;
UpdateSettings();
}
_themeIndex = value;
UpdateSettings();
}
}

public bool IsFocusPositionRadioButtonChecked
public int MonitorPositionIndex
{
get
{
return _isFocusPositionRadioButtonChecked;
return _monitorPositionIndex;
}

set
{
if (value == true)
if (_monitorPositionIndex != value)
{
settings.Properties.Position = StartupPosition.Focus;
_isFocusPositionRadioButtonChecked = value;
switch (value)
{
case 0: settings.Properties.Position = StartupPosition.Cursor; break;
case 1: settings.Properties.Position = StartupPosition.PrimaryMonitor; break;
case 2: settings.Properties.Position = StartupPosition.Focus; break;
}

_monitorPositionIndex = value;
UpdateSettings();
}
}
Expand Down

0 comments on commit eb2ef70

Please sign in to comment.