mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-11-28 07:39:49 +08:00
[FZ Editor] Fix SizeToContent (#12888)
* Fix SizeToContent * WPF window bugfix Co-authored-by: Niels Laute <niels9001@hotmail.com>
This commit is contained in:
parent
39d46074d6
commit
7f2c6aa3d3
@ -8,6 +8,7 @@
|
|||||||
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
|
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title=""
|
Title=""
|
||||||
|
Height="196"
|
||||||
MinWidth="360"
|
MinWidth="360"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||||
@ -17,8 +18,9 @@
|
|||||||
Background="{DynamicResource PrimaryBackgroundBrush}"
|
Background="{DynamicResource PrimaryBackgroundBrush}"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
|
ContentRendered="EditorWindow_ContentRendered"
|
||||||
Closed="OnClosed">
|
Closed="OnClosed">
|
||||||
<Grid>
|
<Grid Height="160">
|
||||||
<Grid Height="36"
|
<Grid Height="36"
|
||||||
Background="{DynamicResource SecondaryBackgroundBrush}"
|
Background="{DynamicResource SecondaryBackgroundBrush}"
|
||||||
Margin="0,-36,0,0"
|
Margin="0,-36,0,0"
|
||||||
@ -31,7 +33,7 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Margin="0,4,0,0" />
|
Margin="0,4,0,0" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<StackPanel Margin="16"
|
<StackPanel Margin="16" VerticalAlignment="Bottom"
|
||||||
FocusManager.FocusedElement="{Binding ElementName=newZoneButton}">
|
FocusManager.FocusedElement="{Binding ElementName=newZoneButton}">
|
||||||
|
|
||||||
<local:ClickAutomationEventButton x:Name="newZoneButton"
|
<local:ClickAutomationEventButton x:Name="newZoneButton"
|
||||||
@ -51,7 +53,7 @@
|
|||||||
Click="OnAddZone"
|
Click="OnAddZone"
|
||||||
OnClickAutomationValue="{x:Static props:Resources.New_zone_added}" />
|
OnClickAutomationValue="{x:Static props:Resources.New_zone_added}" />
|
||||||
|
|
||||||
<Grid Margin="0,24,0,0">
|
<Grid Margin="0,24,0,-4">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="8" />
|
<ColumnDefinition Width="8" />
|
||||||
|
@ -59,5 +59,11 @@ namespace FancyZonesEditor
|
|||||||
App.Overlay.FocusEditor();
|
App.Overlay.FocusEditor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is required to fix a WPF rendering bug when using custom chrome
|
||||||
|
private void EditorWindow_ContentRendered(object sender, System.EventArgs e)
|
||||||
|
{
|
||||||
|
InvalidateVisual();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
|
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title=""
|
Title=""
|
||||||
|
Height="176"
|
||||||
MinWidth="360"
|
MinWidth="360"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||||
@ -17,8 +18,9 @@
|
|||||||
Background="{DynamicResource PrimaryBackgroundBrush}"
|
Background="{DynamicResource PrimaryBackgroundBrush}"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
|
ContentRendered="EditorWindow_ContentRendered"
|
||||||
Closed="OnClosed">
|
Closed="OnClosed">
|
||||||
<Grid>
|
<Grid Height="140">
|
||||||
<Grid
|
<Grid
|
||||||
Height="36"
|
Height="36"
|
||||||
Background="{DynamicResource SecondaryBackgroundBrush}"
|
Background="{DynamicResource SecondaryBackgroundBrush}"
|
||||||
@ -52,7 +54,7 @@
|
|||||||
<Run Text="{x:Static props:Resources.MergeDescription}" />
|
<Run Text="{x:Static props:Resources.MergeDescription}" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Grid Margin="0,24,0,0">
|
<Grid Margin="0,24,0,-4">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="8"/>
|
<ColumnDefinition Width="8"/>
|
||||||
|
@ -38,5 +38,11 @@ namespace FancyZonesEditor
|
|||||||
}
|
}
|
||||||
|
|
||||||
private GridLayoutModel _stashedModel;
|
private GridLayoutModel _stashedModel;
|
||||||
|
|
||||||
|
// This is required to fix a WPF rendering bug when using custom chrome
|
||||||
|
private void EditorWindow_ContentRendered(object sender, System.EventArgs e)
|
||||||
|
{
|
||||||
|
InvalidateVisual();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user