Skip to content

Commit

Permalink
Remove rules custom Icon
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Jan 12, 2025
1 parent 7a86807 commit d3ebc17
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 22 deletions.
2 changes: 2 additions & 0 deletions v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
Classes="Margin8"
TextWrapping="Wrap" />

<!--
<TextBlock
Grid.Row="3"
Grid.Column="0"
Expand All @@ -144,6 +145,7 @@
Grid.Column="2"
Classes="Margin8"
Content="{x:Static resx:ResUI.TbBrowse}" />
-->

<TextBlock
Grid.Row="4"
Expand Down
22 changes: 11 additions & 11 deletions v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public RoutingRuleSettingWindow(RoutingItem routingItem)
lstRules.SelectionChanged += lstRules_SelectionChanged;
lstRules.DoubleTapped += LstRules_DoubleTapped;
menuRuleSelectAll.Click += menuRuleSelectAll_Click;
btnBrowseCustomIcon.Click += btnBrowseCustomIcon_Click;
//btnBrowseCustomIcon.Click += btnBrowseCustomIcon_Click;
btnBrowseCustomRulesetPath4Singbox.Click += btnBrowseCustomRulesetPath4Singbox_ClickAsync;

ViewModel = new RoutingRuleSettingViewModel(routingItem, UpdateViewHandler);
Expand All @@ -51,7 +51,7 @@ public RoutingRuleSettingWindow(RoutingItem routingItem)
this.Bind(ViewModel, vm => vm.SelectedRouting.DomainStrategy4Singbox, v => v.cmbdomainStrategy4Singbox.SelectedValue).DisposeWith(disposables);

this.Bind(ViewModel, vm => vm.SelectedRouting.Url, v => v.txtUrl.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedRouting.CustomIcon, v => v.txtCustomIcon.Text).DisposeWith(disposables);
//this.Bind(ViewModel, vm => vm.SelectedRouting.CustomIcon, v => v.txtCustomIcon.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedRouting.CustomRulesetPath4Singbox, v => v.txtCustomRulesetPath4Singbox.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedRouting.Sort, v => v.txtSort.Text).DisposeWith(disposables);

Expand Down Expand Up @@ -179,16 +179,16 @@ private void menuRuleSelectAll_Click(object? sender, RoutedEventArgs e)
lstRules.SelectAll();
}

private async void btnBrowseCustomIcon_Click(object? sender, RoutedEventArgs e)
{
var fileName = await UI.OpenFileDialog(this, FilePickerFileTypes.ImagePng);
if (fileName.IsNullOrEmpty())
{
return;
}
//private async void btnBrowseCustomIcon_Click(object? sender, RoutedEventArgs e)
//{
// var fileName = await UI.OpenFileDialog(this, FilePickerFileTypes.ImagePng);
// if (fileName.IsNullOrEmpty())
// {
// return;
// }

txtCustomIcon.Text = fileName;
}
// txtCustomIcon.Text = fileName;
//}

private async void btnBrowseCustomRulesetPath4Singbox_ClickAsync(object? sender, RoutedEventArgs e)
{
Expand Down
2 changes: 2 additions & 0 deletions v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
Style="{StaticResource DefTextBox}"
TextWrapping="Wrap" />

<!--
<TextBlock
Grid.Row="3"
Grid.Column="0"
Expand All @@ -210,6 +211,7 @@
Margin="{StaticResource MarginLeftRight4}"
Content="{x:Static resx:ResUI.TbBrowse}"
Style="{StaticResource DefButton}" />
-->

<TextBlock
Grid.Row="4"
Expand Down
22 changes: 11 additions & 11 deletions v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public RoutingRuleSettingWindow(RoutingItem routingItem)
lstRules.SelectionChanged += lstRules_SelectionChanged;
lstRules.MouseDoubleClick += LstRules_MouseDoubleClick;
menuRuleSelectAll.Click += menuRuleSelectAll_Click;
btnBrowseCustomIcon.Click += btnBrowseCustomIcon_Click;
//btnBrowseCustomIcon.Click += btnBrowseCustomIcon_Click;
btnBrowseCustomRulesetPath4Singbox.Click += btnBrowseCustomRulesetPath4Singbox_Click;

ViewModel = new RoutingRuleSettingViewModel(routingItem, UpdateViewHandler);
Expand All @@ -41,7 +41,7 @@ public RoutingRuleSettingWindow(RoutingItem routingItem)
this.Bind(ViewModel, vm => vm.SelectedRouting.DomainStrategy4Singbox, v => v.cmbdomainStrategy4Singbox.Text).DisposeWith(disposables);

this.Bind(ViewModel, vm => vm.SelectedRouting.Url, v => v.txtUrl.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedRouting.CustomIcon, v => v.txtCustomIcon.Text).DisposeWith(disposables);
//this.Bind(ViewModel, vm => vm.SelectedRouting.CustomIcon, v => v.txtCustomIcon.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedRouting.CustomRulesetPath4Singbox, v => v.txtCustomRulesetPath4Singbox.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedRouting.Sort, v => v.txtSort.Text).DisposeWith(disposables);

Expand Down Expand Up @@ -173,16 +173,16 @@ private void menuRuleSelectAll_Click(object sender, System.Windows.RoutedEventAr
lstRules.SelectAll();
}

private void btnBrowseCustomIcon_Click(object sender, System.Windows.RoutedEventArgs e)
{
if (UI.OpenFileDialog(out string fileName,
"PNG,ICO|*.png;*.ico") != true)
{
return;
}
//private void btnBrowseCustomIcon_Click(object sender, System.Windows.RoutedEventArgs e)
//{
// if (UI.OpenFileDialog(out string fileName,
// "PNG,ICO|*.png;*.ico") != true)
// {
// return;
// }

txtCustomIcon.Text = fileName;
}
// txtCustomIcon.Text = fileName;
//}

private void btnBrowseCustomRulesetPath4Singbox_Click(object sender, RoutedEventArgs e)
{
Expand Down

0 comments on commit d3ebc17

Please sign in to comment.