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"
|
||||
mc:Ignorable="d"
|
||||
Title=""
|
||||
Height="196"
|
||||
MinWidth="360"
|
||||
BorderThickness="0"
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||
@ -17,8 +18,9 @@
|
||||
Background="{DynamicResource PrimaryBackgroundBrush}"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
ContentRendered="EditorWindow_ContentRendered"
|
||||
Closed="OnClosed">
|
||||
<Grid>
|
||||
<Grid Height="160">
|
||||
<Grid Height="36"
|
||||
Background="{DynamicResource SecondaryBackgroundBrush}"
|
||||
Margin="0,-36,0,0"
|
||||
@ -31,7 +33,7 @@
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,4,0,0" />
|
||||
</Grid>
|
||||
<StackPanel Margin="16"
|
||||
<StackPanel Margin="16" VerticalAlignment="Bottom"
|
||||
FocusManager.FocusedElement="{Binding ElementName=newZoneButton}">
|
||||
|
||||
<local:ClickAutomationEventButton x:Name="newZoneButton"
|
||||
@ -51,7 +53,7 @@
|
||||
Click="OnAddZone"
|
||||
OnClickAutomationValue="{x:Static props:Resources.New_zone_added}" />
|
||||
|
||||
<Grid Margin="0,24,0,0">
|
||||
<Grid Margin="0,24,0,-4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="8" />
|
||||
|
@ -59,5 +59,11 @@ namespace FancyZonesEditor
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
Title=""
|
||||
Height="176"
|
||||
MinWidth="360"
|
||||
BorderThickness="0"
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||
@ -17,8 +18,9 @@
|
||||
Background="{DynamicResource PrimaryBackgroundBrush}"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
ContentRendered="EditorWindow_ContentRendered"
|
||||
Closed="OnClosed">
|
||||
<Grid>
|
||||
<Grid Height="140">
|
||||
<Grid
|
||||
Height="36"
|
||||
Background="{DynamicResource SecondaryBackgroundBrush}"
|
||||
@ -52,7 +54,7 @@
|
||||
<Run Text="{x:Static props:Resources.MergeDescription}" />
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<Grid Margin="0,24,0,0">
|
||||
<Grid Margin="0,24,0,-4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="8"/>
|
||||
|
@ -38,5 +38,11 @@ namespace FancyZonesEditor
|
||||
}
|
||||
|
||||
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