mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-07 22:12:07 +03:00
5ea8ae6420
The per-core pre-release switch and its label sit in a horizontal StackPanel inside a fixed-width column of the update dialog. Translations longer than the column do not fit: in Avalonia the label runs over the core name and the update status (Russian, French, Hungarian, Persian), and in WPF it is cut off. Use a DockPanel so that the label wraps inside its column, as the interval label of the subscription window does since #10292. The dialog keeps its width. In Avalonia the panel also had a vertical margin on top of the margin of the switch, so the two rows with the switch were 8 px taller than the other rows. Use a horizontal-only margin, as the WPF view already does.
115 lines
5.1 KiB
XML
115 lines
5.1 KiB
XML
<UserControl
|
|
x:Class="v2rayN.Desktop.Views.CheckUpdateView"
|
|
xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:dd="clr-namespace:v2rayN.Desktop.DesignData"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
|
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
|
d:DesignHeight="600"
|
|
d:DesignWidth="800"
|
|
x:DataType="vms:CheckUpdateViewModel"
|
|
Design.DataContext="{x:Static dd:DesignData.CheckUpdate}"
|
|
mc:Ignorable="d">
|
|
|
|
<DockPanel Margin="{StaticResource Margin8}">
|
|
<Border
|
|
Margin="{StaticResource Margin4}"
|
|
VerticalAlignment="Center"
|
|
DockPanel.Dock="Bottom"
|
|
Theme="{DynamicResource CardBorder}">
|
|
|
|
<StackPanel
|
|
Margin="{StaticResource Margin4}"
|
|
HorizontalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
|
|
<TextBlock
|
|
Margin="{StaticResource Margin4}"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Center"
|
|
Text="{x:Static resx:ResUI.TbSettingsEnableUpdateViaProxy}" />
|
|
<ToggleSwitch
|
|
x:Name="togEnableUpdateViaProxy"
|
|
Margin="{StaticResource Margin4}"
|
|
HorizontalAlignment="Left" />
|
|
|
|
<Button
|
|
x:Name="btnCheckOnly"
|
|
MinWidth="100"
|
|
Margin="{StaticResource Margin4}"
|
|
Content="{x:Static resx:ResUI.menuCheckOnly}" />
|
|
|
|
<Button
|
|
x:Name="btnCheckUpdate"
|
|
MinWidth="100"
|
|
Margin="{StaticResource Margin4}"
|
|
Content="{x:Static resx:ResUI.menuCheckAndUpdate}" />
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<Border
|
|
Margin="{StaticResource Margin4}"
|
|
VerticalAlignment="Center"
|
|
Theme="{DynamicResource CardBorder}">
|
|
|
|
<ListBox
|
|
x:Name="lstCheckUpdates"
|
|
BorderThickness="1"
|
|
ItemsSource="{Binding CheckUpdateModels}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel Orientation="Vertical" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Panel Width="680" VerticalAlignment="Center">
|
|
<Grid ColumnDefinitions="1*,3*,1*,3*" RowDefinitions="Auto">
|
|
<ToggleSwitch
|
|
x:Name="togAutoRefresh"
|
|
Grid.Column="0"
|
|
Margin="{StaticResource Margin4}"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Center"
|
|
IsChecked="{Binding IsSelected}" />
|
|
|
|
<DockPanel
|
|
Grid.Column="1"
|
|
Margin="{StaticResource MarginLr4}"
|
|
IsVisible="{Binding ShowCheckPreRelease}">
|
|
<ToggleSwitch
|
|
Margin="{StaticResource Margin4}"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Center"
|
|
IsChecked="{Binding IsCheckPreRelease}"
|
|
OffContent=""
|
|
OnContent="" />
|
|
<TextBlock
|
|
Margin="{StaticResource Margin4}"
|
|
VerticalAlignment="Center"
|
|
Text="{x:Static resx:ResUI.TbSettingsEnableCheckPreReleaseUpdate}"
|
|
TextWrapping="Wrap" />
|
|
</DockPanel>
|
|
|
|
<TextBlock
|
|
Grid.Column="2"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Center"
|
|
Text="{Binding CoreTypeForStorage}" />
|
|
<TextBlock
|
|
Grid.Column="3"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Center"
|
|
Text="{Binding Remarks}"
|
|
TextWrapping="WrapWithOverflow" />
|
|
</Grid>
|
|
</Panel>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ListBox>
|
|
</Border>
|
|
</DockPanel>
|
|
</UserControl>
|