Skip to content

Commit

Permalink
Improve
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Jan 27, 2024
1 parent e71525d commit 6f22b74
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 20 deletions.
18 changes: 18 additions & 0 deletions v2rayN/v2rayN/Resx/ResUI.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions v2rayN/v2rayN/Resx/ResUI.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1183,4 +1183,10 @@
<data name="TbPath7" xml:space="preserve">
<value>obfs password</value>
</data>
<data name="TbRuleMatchingTips" xml:space="preserve">
<value>(Domain or IP or ProcName) and Port and Protocol and InboundTag =&gt; OutboundTag</value>
</data>
<data name="TbAutoScrollToEnd" xml:space="preserve">
<value>Auto ScrollToEnd</value>
</data>
</root>
6 changes: 6 additions & 0 deletions v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1180,4 +1180,10 @@
<data name="TbPath7" xml:space="preserve">
<value>混淆密码(obfs password)</value>
</data>
<data name="TbRuleMatchingTips" xml:space="preserve">
<value>(Domain 或 IP 或 进程名) 与 Port 与 Protocol 与 InboundTag =&gt; OutboundTag</value>
</data>
<data name="TbAutoScrollToEnd" xml:space="preserve">
<value>自动滚动到末尾</value>
</data>
</root>
6 changes: 6 additions & 0 deletions v2rayN/v2rayN/Resx/ResUI.zh-Hant.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1153,4 +1153,10 @@
<data name="TbSettingsEnableIPv6Address" xml:space="preserve">
<value>啟用IPv6</value>
</data>
<data name="TbRuleMatchingTips" xml:space="preserve">
<value>(Domain 或 IP 或 进程名) 与 Port 与 Protocol 与 InboundTag =&gt; OutboundTag</value>
</data>
<data name="TbAutoScrollToEnd" xml:space="preserve">
<value>自动滚动到末尾</value>
</data>
</root>
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/ViewModels/AddServer2ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private void SaveServer()

private void BrowseServer()
{
UI.Show(ResUI.CustomServerTips);
//UI.Show(ResUI.CustomServerTips);

if (UI.OpenFileDialog(out string fileName,
"Config|*.json|YAML|*.yaml;*.yml|All|*.*") != true)
Expand Down
7 changes: 7 additions & 0 deletions v2rayN/v2rayN/Views/AddServer2Window.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TipPreSocksPort}"
TextWrapping="Wrap" />
<TextBlock
Width="500"
Margin="8,0"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.CustomServerTips}"
TextWrapping="Wrap" />
</StackPanel>
</Grid>
</Grid>
Expand Down
12 changes: 10 additions & 2 deletions v2rayN/v2rayN/Views/MsgView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:v2rayN.Views"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:resx="clr-namespace:v2rayN.Resx"
xmlns:vms="clr-namespace:v2rayN.ViewModels"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
Expand Down Expand Up @@ -41,6 +39,16 @@
Margin="8,0"
HorizontalAlignment="Left"
IsChecked="True" />
<TextBlock
Margin="8,0"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbAutoScrollToEnd}" />
<ToggleButton
x:Name="togScrollToEnd"
Margin="8,0"
HorizontalAlignment="Left"
IsChecked="True" />
</StackPanel>
<TextBox
Name="txtMsg"
Expand Down
10 changes: 7 additions & 3 deletions v2rayN/v2rayN/Views/MsgView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ namespace v2rayN.Views
{
public partial class MsgView
{
private static Config _config;
private static Config? _config;

private string lastMsgFilter;
private string lastMsgFilter = string.Empty;
private bool lastMsgFilterNotAvailable;

public MsgView()
Expand Down Expand Up @@ -65,6 +65,11 @@ public void AppendText(string msg)
lastMsgFilter = MsgFilter;

ShowMsg(msg);

if (togScrollToEnd.IsChecked ?? true)
{
txtMsg.ScrollToEnd();
}
}

private void ShowMsg(string msg)
Expand All @@ -78,7 +83,6 @@ private void ShowMsg(string msg)
{
this.txtMsg.AppendText(Environment.NewLine);
}
txtMsg.ScrollToEnd();
}

public void ClearMsg()
Expand Down
35 changes: 21 additions & 14 deletions v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:v2rayN.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:reactiveui="http://reactiveui.net"
xmlns:resx="clr-namespace:v2rayN.Resx"
Expand Down Expand Up @@ -36,6 +35,7 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Row="0"
Expand All @@ -52,6 +52,13 @@
Margin="4"
MaxDropDownHeight="1000"
Style="{StaticResource DefComboBox}" />
<TextBlock
Grid.Row="0"
Grid.Column="2"
Margin="4"
HorizontalAlignment="Left"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbRuleMatchingTips}" />

<TextBlock
Grid.Row="1"
Expand All @@ -68,6 +75,16 @@
Margin="4"
HorizontalAlignment="Left"
Style="{StaticResource DefTextBox}" />
<TextBlock
Grid.Row="1"
Grid.Column="2"
Margin="4"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}">
<Hyperlink Click="linkRuleobjectDoc_Click">
<TextBlock Text="{x:Static resx:ResUI.TbRuleobjectDoc}" />
</Hyperlink>
</TextBlock>

<TextBlock
Grid.Row="2"
Expand Down Expand Up @@ -115,18 +132,8 @@
HorizontalAlignment="Left" />

<TextBlock
Grid.Row="5"
Grid.Column="0"
Margin="4"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}">
<Hyperlink Click="linkRuleobjectDoc_Click">
<TextBlock Text="{x:Static resx:ResUI.TbRuleobjectDoc}" />
</Hyperlink>
</TextBlock>
<TextBlock
Grid.Row="5"
Grid.Column="1"
Grid.Row="4"
Grid.Column="2"
Margin="4"
HorizontalAlignment="Left"
Style="{StaticResource ToolbarTextBlock}"
Expand All @@ -144,7 +151,7 @@
</Grid.ColumnDefinitions>
<StackPanel
Grid.Column="0"
HorizontalAlignment="Left"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<CheckBox x:Name="chkAutoSort">
<TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.TbAutoSort}" />
Expand Down

0 comments on commit 6f22b74

Please sign in to comment.