mirror of
https://github.com/2dust/v2rayN.git
synced 2025-04-19 13:42:24 +00:00
Optimize desktop DataGrid RowHeight adjusts with font size
This commit is contained in:
parent
0b1b681655
commit
2cacc372ad
4 changed files with 20 additions and 1 deletions
|
@ -20,4 +20,7 @@
|
|||
<Style Selector="Grid.Margin8">
|
||||
<Setter Property="Margin" Value="8" />
|
||||
</Style>
|
||||
<Style Selector="DataGrid">
|
||||
<Setter Property="RowHeight" Value="24" />
|
||||
</Style>
|
||||
</Styles>
|
|
@ -119,6 +119,17 @@ namespace v2rayN.Desktop.ViewModels
|
|||
Value = size,
|
||||
});
|
||||
Application.Current?.Styles.Add(style);
|
||||
|
||||
ModifyFontSizeEx(size);
|
||||
}
|
||||
|
||||
private void ModifyFontSizeEx(double size)
|
||||
{
|
||||
//DataGrid
|
||||
var rowHeight = 20 + (size / 2);
|
||||
var style = new Style(x => x.OfType<DataGrid>());
|
||||
style.Add(new Setter(DataGrid.RowHeightProperty, rowHeight));
|
||||
Application.Current?.Styles.Add(style);
|
||||
}
|
||||
|
||||
private void ModifyFontFamily()
|
||||
|
|
|
@ -787,6 +787,7 @@
|
|||
Classes="Margin8" />
|
||||
|
||||
<TextBlock
|
||||
x:Name="labLinuxSudoPassword"
|
||||
Grid.Row="7"
|
||||
Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
|
@ -800,6 +801,7 @@
|
|||
HorizontalAlignment="Left"
|
||||
Classes="Margin8" />
|
||||
<TextBlock
|
||||
x:Name="labLinuxSudoPasswordTip"
|
||||
Grid.Row="7"
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Center"
|
||||
|
|
|
@ -174,6 +174,9 @@ namespace v2rayN.Desktop.Views
|
|||
if (Utils.IsWindows())
|
||||
{
|
||||
txbSettingsExceptionTip2.IsVisible = false;
|
||||
txtLinuxSudoPassword.IsVisible = false;
|
||||
labLinuxSudoPassword.IsVisible = false;
|
||||
labLinuxSudoPasswordTip.IsVisible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue