Skip to content

Commit

Permalink
[FZ editor] UX update for edit dialog (#9709)
Browse files Browse the repository at this point in the history
* Layout title label fix

* Updated formatting for resolution textlabel

* Updated UX

* Added tooltip to layout title textblock

* Updated icon button styles

* Moved buttons around

* Updated margin

* Updated strings

* Revert "Updated strings"

This reverts commit cc4e176.

* [spell checker] add terms

Co-authored-by: Niels Laute <niels9001@hotmail.com>
Co-authored-by: Enrico Giordani <enrico.giordani@gmail.com>
  • Loading branch information
3 people committed Feb 19, 2021
1 parent 5dae51e commit a29b3aa
Show file tree
Hide file tree
Showing 8 changed files with 221 additions and 222 deletions.
20 changes: 12 additions & 8 deletions src/modules/fancyzones/editor/FancyZonesEditor/CanvasZone.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,18 @@
FontWeight="SemiBold"
FontSize="64"
Foreground="{DynamicResource PrimaryForegroundBrush}" />
<Label
Name="LabelSize"
DockPanel.Dock="Bottom"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
FontWeight="Thin"
FontSize="32"
Foreground="{DynamicResource PrimaryForegroundBrush}" />
<TextBlock FontSize="16"
Foreground="{DynamicResource SecondaryForegroundBrush}"
DockPanel.Dock="Bottom"
FontWeight="SemiBold"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Run x:Name="WidthLabel" />
<Run Text="&#xE106;"
FontSize="10"
FontFamily="Segoe MDL2 Assets" />
<Run x:Name="HeightLabel" />
</TextBlock>
</DockPanel>

<Thumb x:Name="Caption" Cursor="SizeAll" Background="Transparent" BorderThickness="3" Padding="4" Grid.Column="0" Grid.ColumnSpan="5" Grid.Row="0" Grid.RowSpan="5" DragDelta="UniversalDragDelta" DragStarted="Caption_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public CanvasZone()

private void CanvasZone_SizeChanged(object sender, SizeChangedEventArgs e)
{
LabelSize.Content = "(" + Width.ToString() + "x" + Height.ToString() + ")";
WidthLabel.Text = Width.ToString();
HeightLabel.Text = Height.ToString();
}

private CanvasLayoutModel model;
Expand Down
20 changes: 12 additions & 8 deletions src/modules/fancyzones/editor/FancyZonesEditor/GridZone.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@
FontWeight="SemiBold"
FontSize="64"
Foreground="{DynamicResource PrimaryForegroundBrush}" />
<Label
Name="LabelSize"
DockPanel.Dock="Bottom"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
FontWeight="Thin"
FontSize="32"
Foreground="{DynamicResource PrimaryForegroundBrush}" />
<TextBlock FontSize="16"
Foreground="{DynamicResource SecondaryForegroundBrush}"
DockPanel.Dock="Bottom"
FontWeight="SemiBold"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Run x:Name="WidthLabel" />
<Run Text="&#xE106;"
FontSize="10"
FontFamily="Segoe MDL2 Assets" />
<Run x:Name="HeightLabel" />
</TextBlock>

</DockPanel>
<!--<TextBlock Margin="2" Text="Shift Key switches direction&#13;Ctrl Key repeats"/>-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public GridZone(int spacing)

private void GridZone_SizeChanged(object sender, SizeChangedEventArgs e)
{
LabelSize.Content = "(" + Math.Round(ActualWidth).ToString() + "x" + Math.Round(ActualHeight).ToString() + ")";
WidthLabel.Text = Math.Round(ActualWidth).ToString();
HeightLabel.Text = Math.Round(ActualHeight).ToString();
}

private void ZoneSettings_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
Expand Down
320 changes: 122 additions & 198 deletions src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml

Large diffs are not rendered by default.

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
Expand Up @@ -176,10 +176,10 @@ To merge zones, select the zones and click "merge".</value>
<value>Templates</value>
</data>
<data name="Zone_Count_Decrement" xml:space="preserve">
<value>Decrement number of zones in template layout</value>
<value>Decrement number of zones</value>
</data>
<data name="Zone_Count_Increment" xml:space="preserve">
<value>Increment number of zones in template layout</value>
<value>Increment number of zones</value>
</data>
<data name="Error_Invalid_Arguments" xml:space="preserve">
<value>FancyZones Editor arguments are invalid.</value>
Expand Down Expand Up @@ -298,7 +298,7 @@ To merge zones, select the zones and click "merge".</value>
<value>Are you sure you want to delete this layout?</value>
</data>
<data name="Edit_zones" xml:space="preserve">
<value>Edit zones</value>
<value>Edit zone layout</value>
</data>
<data name="No_Custom_Layouts_Message" xml:space="preserve">
<value>Create or duplicate a layout to get started</value>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:primitives="clr-namespace:ModernWpf.Controls.Primitives"
xmlns:local="clr-namespace:FancyZonesEditor.Styles">

<Style x:Key="LayoutTypeRadioButtonStyle" TargetType="RadioButton">
Expand Down Expand Up @@ -90,4 +91,68 @@
</Setter.Value>
</Setter>
</Style>

<Style x:Key="IconOnlyButtonStyle"
BasedOn="{StaticResource DefaultButtonStyle}"
TargetType="Button">
<Setter Property="Background"
Value="Transparent" />
<Setter Property="Foreground"
Value="{DynamicResource ButtonForeground}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Background"
Background="Transparent"
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
SnapsToDevicePixels="True">
<Border x:Name="Border"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}">
<ContentPresenter x:Name="ContentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter TargetName="Background"
Property="Background"
Value="{DynamicResource ButtonBackgroundPointerOver}" />
<Setter TargetName="Border"
Property="BorderBrush"
Value="{DynamicResource ButtonBorderBrushPointerOver}" />
</Trigger>
<Trigger Property="IsPressed"
Value="True">
<Setter TargetName="Background"
Property="Background"
Value="{DynamicResource ButtonBackgroundPressed}" />
<Setter TargetName="Border"
Property="BorderBrush"
Value="{DynamicResource ButtonBorderBrushPressed}" />
</Trigger>
<Trigger Property="IsEnabled"
Value="False">
<Setter TargetName="Background"
Property="Background"
Value="{DynamicResource ButtonBackgroundDisabled}" />
<Setter TargetName="Border"
Property="BorderBrush"
Value="{DynamicResource ButtonBorderBrushDisabled}" />
<Setter TargetName="ContentPresenter"
Property="TextElement.Foreground"
Value="{DynamicResource ButtonForegroundDisabled}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

0 comments on commit a29b3aa

Please sign in to comment.