Skip to content

Commit

Permalink
Add dpi and optimize ui.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkwpsv committed Jun 17, 2022
1 parent 3c9d734 commit d6186b4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 2 additions & 0 deletions WindowDebugger/ViewModels/WindowItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ public WindowDisplayAffinities WindowDisplayAffinity

public DPI_AWARENESS DpiAwareness => GetWithDefaultValueWhenException(() => _window.DpiAwareness, DPI_AWARENESS_UNAWARE);

public int Dpi => _window.Dpi;

public IntPtr ParentWindowHandle
{
get => _window.ParentWindowHandle;
Expand Down
19 changes: 9 additions & 10 deletions WindowDebugger/Views/Tabs/WindowInfoTab.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,12 @@
<ColumnDefinition Width="2*" MinWidth="200"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="42" />
<RowDefinition Height="42" />
<RowDefinition Height="42" />
<RowDefinition Height="42" />
<RowDefinition Height="42" />
<RowDefinition Height="42" />
</Grid.RowDefinitions>
<FrameworkElement.Resources>
<Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
Expand All @@ -48,7 +45,7 @@
<Setter Property="Background" Value="Transparent" />
</Style>
</FrameworkElement.Resources>
<Border Grid.Row="0" Grid.RowSpan="20" Grid.Column="2" BorderThickness="1" BorderBrush="{DynamicResource ControlElevationBorderBrush}"
<Border Grid.Row="0" Grid.RowSpan="6" Grid.Column="2" BorderThickness="1" BorderBrush="{DynamicResource ControlElevationBorderBrush}"
HorizontalAlignment="Center" VerticalAlignment="Top" Margin="16 4 4 0" MaxHeight="320">
<Image Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="3" Source="{Binding Screenshot}" RenderOptions.BitmapScalingMode="Fant"/>
</Border>
Expand All @@ -67,6 +64,8 @@
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding ClassName, Mode=OneWay}" IsReadOnly="True"/>
<TextBlock Grid.Row="4" Grid.Column="0" Text="DpiAwareness"/>
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding DpiAwareness, Mode=OneWay}" IsReadOnly="True"/>
<TextBlock Grid.Row="5" Grid.Column="0" Text="Dpi"/>
<TextBox Grid.Row="5" Grid.Column="1" Text="{Binding Dpi, Mode=OneWay}" IsReadOnly="True"/>
</Grid>
<Border Height="1" Background="{DynamicResource ControlElevationBorderBrush}" Margin="0 16" />
<Grid>
Expand Down
4 changes: 2 additions & 2 deletions WindowDebugger/WindowDebugger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

<ItemGroup>
<PackageReference Include="Lsj.Util.JSON" Version="6.0.0" />
<PackageReference Include="Lsj.Util.Win32" Version="6.2.1" />
<PackageReference Include="Lsj.Util.Win32" Version="6.2.2-debug2080" />
<PackageReference Include="Lsj.Util.WPF" Version="6.0.0" />
<PackageReference Include="Lsj.Util.Win32.NativeUI" Version="6.0.4" />
<PackageReference Include="Lsj.Util.Win32.NativeUI" Version="6.0.5-debug2080" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="WPF-UI" Version="1.2.6" />
</ItemGroup>
Expand Down

0 comments on commit d6186b4

Please sign in to comment.