fix<Launcher>: fix highdpi screen display issue when launcher is maximized

This commit is contained in:
leo 2020-12-31 23:11:41 +08:00
parent e0f9b70c8a
commit 22d3146866
2 changed files with 3 additions and 1 deletions

View file

@ -27,7 +27,7 @@
<Style TargetType="{x:Type Border}"> <Style TargetType="{x:Type Border}">
<Style.Triggers> <Style.Triggers>
<DataTrigger Binding="{Binding WindowState, ElementName=me}" Value="Maximized"> <DataTrigger Binding="{Binding WindowState, ElementName=me}" Value="Maximized">
<Setter Property="Margin" Value="6"/> <Setter Property="Margin" Value="{x:Static local:Launcher.MAXIMIZE_MARGIN}"/>
</DataTrigger> </DataTrigger>
<DataTrigger Binding="{Binding WindowState, ElementName=me}" Value="Normal"> <DataTrigger Binding="{Binding WindowState, ElementName=me}" Value="Normal">
<Setter Property="Margin" Value="0"/> <Setter Property="Margin" Value="0"/>

View file

@ -16,6 +16,8 @@ namespace SourceGit.UI {
/// Main window for this app. /// Main window for this app.
/// </summary> /// </summary>
public partial class Launcher : Window { public partial class Launcher : Window {
public static readonly Thickness MAXIMIZE_MARGIN = new Thickness(
(SystemParameters.MaximizedPrimaryScreenWidth - SystemParameters.WorkArea.Width) / 2);
/// <summary> /// <summary>
/// Tab data. /// Tab data.