Remove rules custom Icon

pull/6510/head
2dust 2025-01-12 14:35:59 +08:00
parent 7a8680711e
commit d3ebc17a10
4 changed files with 26 additions and 22 deletions

View File

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

View File

@ -27,7 +27,7 @@ namespace v2rayN.Desktop.Views
lstRules.SelectionChanged += lstRules_SelectionChanged; lstRules.SelectionChanged += lstRules_SelectionChanged;
lstRules.DoubleTapped += LstRules_DoubleTapped; lstRules.DoubleTapped += LstRules_DoubleTapped;
menuRuleSelectAll.Click += menuRuleSelectAll_Click; menuRuleSelectAll.Click += menuRuleSelectAll_Click;
btnBrowseCustomIcon.Click += btnBrowseCustomIcon_Click; //btnBrowseCustomIcon.Click += btnBrowseCustomIcon_Click;
btnBrowseCustomRulesetPath4Singbox.Click += btnBrowseCustomRulesetPath4Singbox_ClickAsync; btnBrowseCustomRulesetPath4Singbox.Click += btnBrowseCustomRulesetPath4Singbox_ClickAsync;
ViewModel = new RoutingRuleSettingViewModel(routingItem, UpdateViewHandler); ViewModel = new RoutingRuleSettingViewModel(routingItem, UpdateViewHandler);
@ -51,7 +51,7 @@ namespace v2rayN.Desktop.Views
this.Bind(ViewModel, vm => vm.SelectedRouting.DomainStrategy4Singbox, v => v.cmbdomainStrategy4Singbox.SelectedValue).DisposeWith(disposables); 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.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.CustomRulesetPath4Singbox, v => v.txtCustomRulesetPath4Singbox.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedRouting.Sort, v => v.txtSort.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedRouting.Sort, v => v.txtSort.Text).DisposeWith(disposables);
@ -179,16 +179,16 @@ namespace v2rayN.Desktop.Views
lstRules.SelectAll(); lstRules.SelectAll();
} }
private async void btnBrowseCustomIcon_Click(object? sender, RoutedEventArgs e) //private async void btnBrowseCustomIcon_Click(object? sender, RoutedEventArgs e)
{ //{
var fileName = await UI.OpenFileDialog(this, FilePickerFileTypes.ImagePng); // var fileName = await UI.OpenFileDialog(this, FilePickerFileTypes.ImagePng);
if (fileName.IsNullOrEmpty()) // if (fileName.IsNullOrEmpty())
{ // {
return; // return;
} // }
txtCustomIcon.Text = fileName; // txtCustomIcon.Text = fileName;
} //}
private async void btnBrowseCustomRulesetPath4Singbox_ClickAsync(object? sender, RoutedEventArgs e) private async void btnBrowseCustomRulesetPath4Singbox_ClickAsync(object? sender, RoutedEventArgs e)
{ {

View File

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

View File

@ -17,7 +17,7 @@ namespace v2rayN.Views
lstRules.SelectionChanged += lstRules_SelectionChanged; lstRules.SelectionChanged += lstRules_SelectionChanged;
lstRules.MouseDoubleClick += LstRules_MouseDoubleClick; lstRules.MouseDoubleClick += LstRules_MouseDoubleClick;
menuRuleSelectAll.Click += menuRuleSelectAll_Click; menuRuleSelectAll.Click += menuRuleSelectAll_Click;
btnBrowseCustomIcon.Click += btnBrowseCustomIcon_Click; //btnBrowseCustomIcon.Click += btnBrowseCustomIcon_Click;
btnBrowseCustomRulesetPath4Singbox.Click += btnBrowseCustomRulesetPath4Singbox_Click; btnBrowseCustomRulesetPath4Singbox.Click += btnBrowseCustomRulesetPath4Singbox_Click;
ViewModel = new RoutingRuleSettingViewModel(routingItem, UpdateViewHandler); ViewModel = new RoutingRuleSettingViewModel(routingItem, UpdateViewHandler);
@ -41,7 +41,7 @@ namespace v2rayN.Views
this.Bind(ViewModel, vm => vm.SelectedRouting.DomainStrategy4Singbox, v => v.cmbdomainStrategy4Singbox.Text).DisposeWith(disposables); 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.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.CustomRulesetPath4Singbox, v => v.txtCustomRulesetPath4Singbox.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedRouting.Sort, v => v.txtSort.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedRouting.Sort, v => v.txtSort.Text).DisposeWith(disposables);
@ -173,16 +173,16 @@ namespace v2rayN.Views
lstRules.SelectAll(); lstRules.SelectAll();
} }
private void btnBrowseCustomIcon_Click(object sender, System.Windows.RoutedEventArgs e) //private void btnBrowseCustomIcon_Click(object sender, System.Windows.RoutedEventArgs e)
{ //{
if (UI.OpenFileDialog(out string fileName, // if (UI.OpenFileDialog(out string fileName,
"PNG,ICO|*.png;*.ico") != true) // "PNG,ICO|*.png;*.ico") != true)
{ // {
return; // return;
} // }
txtCustomIcon.Text = fileName; // txtCustomIcon.Text = fileName;
} //}
private void btnBrowseCustomRulesetPath4Singbox_Click(object sender, RoutedEventArgs e) private void btnBrowseCustomRulesetPath4Singbox_Click(object sender, RoutedEventArgs e)
{ {