Skip to content

Commit

Permalink
[FZ Editor] Layout hotkeys for quick swap UI (microsoft#10200)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeraphimaZykova authored and ivan100sic committed Mar 18, 2021
1 parent 4c184d4 commit 99e900f
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 38 deletions.
18 changes: 9 additions & 9 deletions src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<Converters:LayoutTypeTemplateToVisibilityConverter x:Key="LayoutTypeTemplateToVisibilityConverter" />
<Converters:LayoutModelTypeBlankToVisibilityConverter x:Key="LayoutModelTypeBlankToVisibilityConverter" />
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />

<DropShadowEffect x:Key="CardShadow" BlurRadius="6"
Opacity="0.24"
ShadowDepth="1" />
Expand Down Expand Up @@ -186,7 +186,7 @@
<Setter TargetName="LayoutItem"
Property="BorderBrush"
Value="{DynamicResource LayoutItemBorderPointerOverBrush}" />

<Setter TargetName="EditLayoutButton"
Property="Foreground"
Value="{DynamicResource SystemControlBackgroundAccentBrush}" />
Expand Down Expand Up @@ -241,7 +241,7 @@
Margin="0,16,0,0"
FontSize="24" />


<StackPanel Height="240"
Grid.Row="4"
Orientation="Vertical"
Expand Down Expand Up @@ -281,10 +281,10 @@
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>

</Grid>
</ScrollViewer>

<Button x:Name="NewLayoutButton"
Click="NewLayoutButton_Click"
HorizontalAlignment="Right"
Expand Down Expand Up @@ -465,7 +465,7 @@
Margin="0,16,0,0"
Visibility="{Binding IsCustom, Converter={StaticResource BooleanToVisibilityConverter}}"
HorizontalAlignment="Stretch" />

<CheckBox x:Name="spaceAroundSetting"
Content="{x:Static props:Resources.Show_Space_Zones}"
IsChecked="{Binding ShowSpacing}"
Expand Down Expand Up @@ -502,7 +502,7 @@
Margin="0,16,0,0"
Foreground="{DynamicResource PrimaryForegroundBrush}"
Visibility="{Binding Path=Type, Converter={StaticResource LayoutTypeCustomToVisibilityConverter}}"/>
<ComboBox x:Name="quickKeySelectionComboBox"
<ComboBox x:Name="quickKeySelectionComboBox"
Margin="0,6,0,0"
ItemsSource="{Binding QuickKeysAvailable}"
SelectedItem="{Binding QuickKey}"
Expand All @@ -511,7 +511,7 @@
</StackPanel>
</Grid>
</ui:ContentDialog>

<ui:ContentDialog x:Name="NewLayoutDialog"
Background="{DynamicResource PrimaryBackgroundBrush}"
PrimaryButtonStyle="{StaticResource AccentButtonStyle}"
Expand Down Expand Up @@ -600,4 +600,4 @@
</StackPanel>
</ui:ContentDialog>
</Grid>
</Window>
</Window>
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected LayoutModel(string name)
protected LayoutModel(string uuid, string name, LayoutType type)
: this()
{
_guid = Guid.Parse(uuid);
Uuid = uuid;
Name = name;
Type = type;
}
Expand Down Expand Up @@ -94,6 +94,17 @@ public string Uuid
{
return "{" + Guid.ToString().ToUpperInvariant() + "}";
}

set
{
try
{
_guid = Guid.Parse(value);
}
catch (Exception)
{
}
}
}

public bool IsCustom
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
Expand All @@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
Expand Down Expand Up @@ -352,4 +352,4 @@
<data name="Quick_Key_None" xml:space="preserve">
<value>None</value>
</data>
</root>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ private struct CustomLayoutWrapper
// zones-settings: templates
private struct TemplateLayoutWrapper
{
public string Uuid { get; set; }

public string Type { get; set; }

public bool ShowSpacing { get; set; }
Expand Down Expand Up @@ -690,6 +692,7 @@ public void SerializeZoneSettings()
{
TemplateLayoutWrapper wrapper = new TemplateLayoutWrapper
{
Uuid = layout.Uuid,
Type = LayoutTypeToJsonTag(layout.Type),
SensitivityRadius = layout.SensitivityRadius,
ZoneCount = layout.TemplateZoneCount,
Expand Down

0 comments on commit 99e900f

Please sign in to comment.