mirror of
https://github.com/2dust/v2rayN.git
synced 2025-04-19 21:52:25 +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">
|
<Style Selector="Grid.Margin8">
|
||||||
<Setter Property="Margin" Value="8" />
|
<Setter Property="Margin" Value="8" />
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style Selector="DataGrid">
|
||||||
|
<Setter Property="RowHeight" Value="24" />
|
||||||
|
</Style>
|
||||||
</Styles>
|
</Styles>
|
|
@ -119,6 +119,17 @@ namespace v2rayN.Desktop.ViewModels
|
||||||
Value = size,
|
Value = size,
|
||||||
});
|
});
|
||||||
Application.Current?.Styles.Add(style);
|
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()
|
private void ModifyFontFamily()
|
||||||
|
|
|
@ -787,6 +787,7 @@
|
||||||
Classes="Margin8" />
|
Classes="Margin8" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
|
x:Name="labLinuxSudoPassword"
|
||||||
Grid.Row="7"
|
Grid.Row="7"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
@ -800,6 +801,7 @@
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Classes="Margin8" />
|
Classes="Margin8" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
|
x:Name="labLinuxSudoPasswordTip"
|
||||||
Grid.Row="7"
|
Grid.Row="7"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
|
|
@ -174,6 +174,9 @@ namespace v2rayN.Desktop.Views
|
||||||
if (Utils.IsWindows())
|
if (Utils.IsWindows())
|
||||||
{
|
{
|
||||||
txbSettingsExceptionTip2.IsVisible = false;
|
txbSettingsExceptionTip2.IsVisible = false;
|
||||||
|
txtLinuxSudoPassword.IsVisible = false;
|
||||||
|
labLinuxSudoPassword.IsVisible = false;
|
||||||
|
labLinuxSudoPasswordTip.IsVisible = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue