Skip to content
Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
788f7ef
Removed MetroWindow, added theming support and modernWPF
Nov 19, 2020
bb37479
Rmoved MahApps refs
Nov 19, 2020
4e2fc5a
Removed MahApps
Nov 20, 2020
990b301
Updated canvas zones
niels9001 Nov 21, 2020
5bab238
Updated GridEditor
niels9001 Nov 21, 2020
14e17e3
Fixes
niels9001 Nov 21, 2020
811d7c2
UI updates
niels9001 Nov 21, 2020
885496f
New layout type selection dialog
niels9001 Nov 21, 2020
d0ff710
New editor UI
niels9001 Nov 22, 2020
2601b08
Updates
niels9001 Nov 24, 2020
4cd8d5c
Fix
niels9001 Nov 24, 2020
375f299
UI enhancements
niels9001 Nov 27, 2020
96c1c79
Updated UI
niels9001 Nov 27, 2020
f77bed5
Added styles to layoutpreview
niels9001 Nov 27, 2020
61632b0
Accesibility improvements
niels9001 Nov 29, 2020
db8a8f9
Accesibility and styling improvements
niels9001 Nov 29, 2020
439afd2
Fix
niels9001 Nov 29, 2020
2adc597
Cleaned up brushes
niels9001 Dec 1, 2020
257e7ec
Updated UX
niels9001 Dec 7, 2020
4a95396
Updated UI
niels9001 Dec 10, 2020
368be8a
Added no layouts description
niels9001 Dec 10, 2020
257e88e
Fix
niels9001 Dec 10, 2020
3289963
UI fixes
niels9001 Dec 13, 2020
0c85eab
[FZ Editor] Serialize/deserialize settings (#8615)
SeraphimaZykova Dec 16, 2020
e0a68d5
conflicts fix
SeraphimaZykova Dec 17, 2020
07c20a1
[FZ Editor] Parse json file instead of command line args (#8649)
SeraphimaZykova Dec 18, 2020
39550a6
[FZ Editor] Serialize/deserialize settings fix (#8707)
SeraphimaZykova Dec 22, 2020
31712d4
[FZ Editor] Hide unsupported settings in custom layouts flyouts (#8716)
SeraphimaZykova Dec 23, 2020
c9df94b
[FZ Editor] Duplicate custom layouts (#8718)
SeraphimaZykova Dec 23, 2020
79961fd
[FZ Editor] Duplicate layout behavior (#8720)
SeraphimaZykova Dec 24, 2020
d60d16a
New UX proposal
niels9001 Jan 2, 2021
8da7e9f
Updated spacing
niels9001 Jan 2, 2021
8db7648
Switching to toggleswitches
niels9001 Jan 4, 2021
3b903e2
Revert toggleswitch
niels9001 Jan 8, 2021
02606f5
Updated colorbrush
niels9001 Jan 8, 2021
5617270
Updated string for saving label
niels9001 Jan 8, 2021
d0b6360
Updated UI
niels9001 Jan 15, 2021
29e78f2
Dark theme color fixes
niels9001 Jan 15, 2021
a2f8e75
Removed space
niels9001 Jan 15, 2021
82176ee
[FZ Editor] Bind dialog properties (#9199)
SeraphimaZykova Jan 21, 2021
c694e6a
Resize editor window to fit the content in single-monitor mode (#9203)
SeraphimaZykova Jan 21, 2021
3dd54d2
Editor opening fix (#9207)
SeraphimaZykova Jan 21, 2021
7eb79ce
Disable "Create" button if the Name textbox is empty (#9212)
SeraphimaZykova Jan 21, 2021
7703cff
[FZ Editor] Changed edit dialog for template layouts. (#9233)
SeraphimaZykova Jan 22, 2021
e1d955e
[FZ Editor] Small fixes and refactoring. (#9236)
SeraphimaZykova Jan 22, 2021
2386538
[FZ Editor] Empty layout template. (#9237)
SeraphimaZykova Jan 22, 2021
b3e09e9
[FZ Editor] Move "Duplicate" and "Delete" buttons to the Edit dialog.…
SeraphimaZykova Jan 25, 2021
9796cbf
[FZ Editor] Preview the applied layout after editing another layout. …
SeraphimaZykova Jan 25, 2021
9d96a24
Fixed "Save and apply" button behavior (#9286)
SeraphimaZykova Jan 26, 2021
1680b00
[FZ Editor] Save template layouts in the settings. (#9283)
SeraphimaZykova Jan 26, 2021
37b6876
Added default custom layout name (#9291)
SeraphimaZykova Jan 26, 2021
c9081a3
close dialog before opening zones editor (#9302)
SeraphimaZykova Jan 27, 2021
645b341
Pressing Esc closes dialogs (#9301)
SeraphimaZykova Jan 27, 2021
6b66ad7
[FZ Editor] Reset applied layout to "No layout" if it was deleted. (#…
SeraphimaZykova Jan 27, 2021
c9f4dcc
[FZ Editor] Dark theme colors (#9317)
SeraphimaZykova Jan 27, 2021
3bebec8
"Number of zones" buttons colors. (#9321)
SeraphimaZykova Jan 27, 2021
8967dbc
rebase fix
SeraphimaZykova Jan 27, 2021
ed9462b
added ModernWpf.dll
SeraphimaZykova Jan 27, 2021
1afce88
address PR comments: updated colors
SeraphimaZykova Jan 27, 2021
b5b038a
added comments, replaced magic numbers
SeraphimaZykova Jan 27, 2021
ea1021e
refactoring
SeraphimaZykova Jan 27, 2021
4e092e9
merge zones crash fix
SeraphimaZykova Jan 27, 2021
1e26b18
removed redundant using directive
SeraphimaZykova Jan 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/spell-check/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2374,6 +2374,7 @@ Whichdoes
whitespaces
WIC
Wifi
wifstream
wih
wiki
wikipedia
Expand Down
3 changes: 2 additions & 1 deletion installer/PowerToysSetup/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,9 @@
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\FancyZonesEditor.runtimeconfig.json" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\FancyZonesEditor.exe" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\ControlzEx.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\MahApps.Metro.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\Microsoft.Xaml.Behaviors.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\ModernWpf.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\ModernWpf.Controls.dll" />
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.Text.Json.dll" />
<File Id="FancyZones_ManagedCommon" Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\ManagedCommon.dll" />
<File Id="FancyZones_Telemetry.dll" Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\ManagedTelemetry.dll" />
Expand Down
25 changes: 17 additions & 8 deletions src/modules/fancyzones/editor/FancyZonesEditor/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,29 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FancyZonesEditor"
xmlns:ui="http://schemas.modernwpf.com/2019"
Startup="OnStartup">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<!-- Accent and AppTheme setting -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" />
<ui:ThemeResources />
<ui:XamlControlsResources />
<ResourceDictionary Source="pack://application:,,,/Styles/ButtonStyles.xaml" />
<ResourceDictionary Source="pack://application:,,,/Styles/LayoutPreviewStyles.xaml" />
</ResourceDictionary.MergedDictionaries>

<SolidColorBrush x:Key="CanvasZoneBackgroundBrush" Color="#BF333333"/>
<SolidColorBrush x:Key="GridZoneBackgroundBrush" Color="#FF1a1a1a"/>

<Style x:Key="UWPFocusVisualStyle">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Border Margin="-2"
CornerRadius="4"
BorderThickness="2"
BorderBrush="{DynamicResource PrimaryForegroundBrush}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>
66 changes: 63 additions & 3 deletions src/modules/fancyzones/editor/FancyZonesEditor/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using FancyZonesEditor.Utils;
using ManagedCommon;
Expand Down Expand Up @@ -41,6 +43,9 @@ public partial class App : Application
private const string CrashReportDynamicAssemblyTag = "dynamic assembly doesn't have location";
private const string CrashReportLocationNullTag = "location is null or empty";

private const string ParsingErrorReportTag = "Settings parsing error";
private const string ParsingErrorDataTag = "Data: ";

public MainWindowSettingsModel MainWindowSettings { get; }

public static FancyZonesEditorIO FancyZonesEditorIO { get; private set; }
Expand All @@ -49,6 +54,8 @@ public partial class App : Application

public static int PowerToysPID { get; set; }

private ThemeManager _themeManager;

public static bool DebugMode
{
get
Expand All @@ -67,7 +74,7 @@ private void DebugModeCheck()

public App()
{
DebugModeCheck();
// DebugModeCheck();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it commented out? Should we remove it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still want to enable debug mode for stand alone debugging, we can revisit this in 0.33 or 0.35.

FancyZonesEditorIO = new FancyZonesEditorIO();
Overlay = new Overlay();
MainWindowSettings = new MainWindowSettingsModel();
Expand All @@ -82,8 +89,61 @@ private void OnStartup(object sender, StartupEventArgs e)
Environment.Exit(0);
});

FancyZonesEditorIO.ParseCommandLineArguments();
FancyZonesEditorIO.ParseDeviceInfoData();
_themeManager = new ThemeManager(this);

if (!FancyZonesEditorIO.ParseParams().Result)
{
FancyZonesEditorIO.ParseCommandLineArguments();
}

var parseResult = FancyZonesEditorIO.ParseZoneSettings();

// 10ms retry loop with 1 second timeout
if (!parseResult.Result)
{
CancellationTokenSource ts = new CancellationTokenSource();
Task t = Task.Run(() =>
{
while (!parseResult.Result && !ts.IsCancellationRequested)
{
Task.Delay(10).Wait();
parseResult = FancyZonesEditorIO.ParseZoneSettings();
}
});

try
{
bool result = t.Wait(1000, ts.Token);
ts.Cancel();
}
catch (OperationCanceledException)
{
ts.Dispose();
}
}

// Error message if parsing failed
if (!parseResult.Result)
{
var sb = new StringBuilder();
sb.AppendLine();
sb.AppendLine("## " + ParsingErrorReportTag);
sb.AppendLine();
sb.AppendLine(parseResult.Message);
sb.AppendLine();
sb.AppendLine(ParsingErrorDataTag);
sb.AppendLine(parseResult.MalformedData);

string message = parseResult.Message + Environment.NewLine + Environment.NewLine + FancyZonesEditor.Properties.Resources.Error_Parsing_Zones_Settings_User_Choice;
if (MessageBox.Show(message, FancyZonesEditor.Properties.Resources.Error_Parsing_Zones_Settings_Title, MessageBoxButton.YesNo) == MessageBoxResult.No)
{
// TODO: log error
ShowExceptionReportMessageBox(sb.ToString());
Environment.Exit(0);
}

ShowExceptionReportMessageBox(sb.ToString());
}

MainWindowSettingsModel settings = ((App)Current).MainWindowSettings;
settings.UpdateSelectedLayoutModel();
Expand Down
Loading