The first letter of the guiconfig attribute must be capitalized.

This commit is contained in:
2dust
2024-10-23 10:42:35 +08:00
parent 1e7284f141
commit 2d143687b8
51 changed files with 694 additions and 705 deletions
@@ -28,21 +28,21 @@ namespace v2rayN.Desktop.ViewModels
private void RestoreUI()
{
ModifyTheme(_config.uiItem.colorModeDark);
ModifyTheme(_config.UiItem.ColorModeDark);
}
private void BindingUI()
{
ColorModeDark = _config.uiItem.colorModeDark;
CurrentFontSize = _config.uiItem.currentFontSize;
CurrentLanguage = _config.uiItem.currentLanguage;
ColorModeDark = _config.UiItem.ColorModeDark;
CurrentFontSize = _config.UiItem.CurrentFontSize;
CurrentLanguage = _config.UiItem.CurrentLanguage;
this.WhenAnyValue(x => x.ColorModeDark)
.Subscribe(c =>
{
if (_config.uiItem.colorModeDark != ColorModeDark)
if (_config.UiItem.ColorModeDark != ColorModeDark)
{
_config.uiItem.colorModeDark = ColorModeDark;
_config.UiItem.ColorModeDark = ColorModeDark;
ModifyTheme(ColorModeDark);
ConfigHandler.SaveConfig(_config);
}
@@ -55,7 +55,7 @@ namespace v2rayN.Desktop.ViewModels
{
if (CurrentFontSize >= Global.MinFontSize)
{
_config.uiItem.currentFontSize = CurrentFontSize;
_config.UiItem.CurrentFontSize = CurrentFontSize;
double size = CurrentFontSize;
ModifyFontSize(size);
@@ -68,9 +68,9 @@ namespace v2rayN.Desktop.ViewModels
y => y != null && !y.IsNullOrEmpty())
.Subscribe(c =>
{
if (Utils.IsNotEmpty(CurrentLanguage) && _config.uiItem.currentLanguage != CurrentLanguage)
if (Utils.IsNotEmpty(CurrentLanguage) && _config.UiItem.CurrentLanguage != CurrentLanguage)
{
_config.uiItem.currentLanguage = CurrentLanguage;
_config.UiItem.CurrentLanguage = CurrentLanguage;
Thread.CurrentThread.CurrentUICulture = new(CurrentLanguage);
ConfigHandler.SaveConfig(_config);
NoticeHandler.Instance.Enqueue(ResUI.NeedRebootTips);
@@ -25,10 +25,10 @@ namespace v2rayN.Desktop.Views
{
this.Bind(ViewModel, vm => vm.OperationMsg, v => v.txtMsg.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedSource.url, v => v.txtWebDavUrl.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedSource.userName, v => v.txtWebDavUserName.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedSource.password, v => v.txtWebDavPassword.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedSource.dirName, v => v.txtWebDavDirName.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedSource.Url, v => v.txtWebDavUrl.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedSource.UserName, v => v.txtWebDavUserName.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedSource.Password, v => v.txtWebDavPassword.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedSource.DirName, v => v.txtWebDavDirName.Text).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.WebDavCheckCmd, v => v.menuWebDavCheck).DisposeWith(disposables);
+22 -22
View File
@@ -83,7 +83,7 @@ namespace v2rayN.Desktop.Views
this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables);
this.OneWayBind(ViewModel, vm => vm.BlReloadEnabled, v => v.menuReload.IsEnabled).DisposeWith(disposables);
switch (_config.uiItem.mainGirdOrientation)
switch (_config.UiItem.MainGirdOrientation)
{
case EGirdOrientation.Horizontal:
gridMain.IsVisible = true;
@@ -124,7 +124,7 @@ namespace v2rayN.Desktop.Views
}
menuAddServerViaScan.IsVisible = false;
switch (_config.uiItem.mainGirdOrientation)
switch (_config.UiItem.MainGirdOrientation)
{
case EGirdOrientation.Horizontal:
tabProfiles.Content ??= new ProfilesView(this);
@@ -360,7 +360,7 @@ namespace v2rayN.Desktop.Views
public void ShowHideWindow(bool? blShow)
{
var bl = blShow ?? !_config.uiItem.showInTaskbar;
var bl = blShow ?? !_config.UiItem.ShowInTaskbar;
if (bl)
{
this.Show();
@@ -375,46 +375,46 @@ namespace v2rayN.Desktop.Views
{
this.Hide();
}
_config.uiItem.showInTaskbar = bl;
_config.UiItem.ShowInTaskbar = bl;
}
private void RestoreUI()
{
if (_config.uiItem.mainWidth > 0 && _config.uiItem.mainHeight > 0)
if (_config.UiItem.MainWidth > 0 && _config.UiItem.MainHeight > 0)
{
Width = _config.uiItem.mainWidth;
Height = _config.uiItem.mainHeight;
Width = _config.UiItem.MainWidth;
Height = _config.UiItem.MainHeight;
}
if (_config.uiItem.mainGirdHeight1 > 0 && _config.uiItem.mainGirdHeight2 > 0)
if (_config.UiItem.MainGirdHeight1 > 0 && _config.UiItem.MainGirdHeight2 > 0)
{
if (_config.uiItem.mainGirdOrientation == EGirdOrientation.Horizontal)
if (_config.UiItem.MainGirdOrientation == EGirdOrientation.Horizontal)
{
gridMain.ColumnDefinitions[0].Width = new GridLength(_config.uiItem.mainGirdHeight1, GridUnitType.Star);
gridMain.ColumnDefinitions[2].Width = new GridLength(_config.uiItem.mainGirdHeight2, GridUnitType.Star);
gridMain.ColumnDefinitions[0].Width = new GridLength(_config.UiItem.MainGirdHeight1, GridUnitType.Star);
gridMain.ColumnDefinitions[2].Width = new GridLength(_config.UiItem.MainGirdHeight2, GridUnitType.Star);
}
else if (_config.uiItem.mainGirdOrientation == EGirdOrientation.Vertical)
else if (_config.UiItem.MainGirdOrientation == EGirdOrientation.Vertical)
{
gridMain1.RowDefinitions[0].Height = new GridLength(_config.uiItem.mainGirdHeight1, GridUnitType.Star);
gridMain1.RowDefinitions[2].Height = new GridLength(_config.uiItem.mainGirdHeight2, GridUnitType.Star);
gridMain1.RowDefinitions[0].Height = new GridLength(_config.UiItem.MainGirdHeight1, GridUnitType.Star);
gridMain1.RowDefinitions[2].Height = new GridLength(_config.UiItem.MainGirdHeight2, GridUnitType.Star);
}
}
}
private void StorageUI()
{
_config.uiItem.mainWidth = Utils.ToInt(this.Width);
_config.uiItem.mainHeight = Utils.ToInt(this.Height);
_config.UiItem.MainWidth = Utils.ToInt(this.Width);
_config.UiItem.MainHeight = Utils.ToInt(this.Height);
if (_config.uiItem.mainGirdOrientation == EGirdOrientation.Horizontal)
if (_config.UiItem.MainGirdOrientation == EGirdOrientation.Horizontal)
{
_config.uiItem.mainGirdHeight1 = Math.Ceiling(gridMain.ColumnDefinitions[0].ActualWidth + 0.1);
_config.uiItem.mainGirdHeight2 = Math.Ceiling(gridMain.ColumnDefinitions[2].ActualWidth + 0.1);
_config.UiItem.MainGirdHeight1 = Math.Ceiling(gridMain.ColumnDefinitions[0].ActualWidth + 0.1);
_config.UiItem.MainGirdHeight2 = Math.Ceiling(gridMain.ColumnDefinitions[2].ActualWidth + 0.1);
}
else if (_config.uiItem.mainGirdOrientation == EGirdOrientation.Vertical)
else if (_config.UiItem.MainGirdOrientation == EGirdOrientation.Vertical)
{
_config.uiItem.mainGirdHeight1 = Math.Ceiling(gridMain1.RowDefinitions[0].ActualHeight + 0.1);
_config.uiItem.mainGirdHeight2 = Math.Ceiling(gridMain1.RowDefinitions[2].ActualHeight + 0.1);
_config.UiItem.MainGirdHeight1 = Math.Ceiling(gridMain1.RowDefinitions[0].ActualHeight + 0.1);
_config.UiItem.MainGirdHeight2 = Math.Ceiling(gridMain1.RowDefinitions[2].ActualHeight + 0.1);
}
ConfigHandler.SaveConfig(_config);
}
@@ -24,7 +24,7 @@ namespace v2rayN.Desktop.Views
{
clbdestOverride.Items.Add(it);
});
_config.inbound[0].destOverride?.ForEach(it =>
_config.Inbound[0].DestOverride?.ForEach(it =>
{
clbdestOverride.SelectedItems.Add(it);
});
@@ -189,7 +189,7 @@ namespace v2rayN.Desktop.Views
private void LstProfiles_DoubleTapped(object? sender, Avalonia.Input.TappedEventArgs e)
{
if (_config.uiItem.doubleClick2Activate)
if (_config.UiItem.DoubleClick2Activate)
{
ViewModel?.SetDefaultServer();
}
@@ -325,7 +325,7 @@ namespace v2rayN.Desktop.Views
private void RestoreUI()
{
var lvColumnItem = _config.uiItem.mainColumnItem.OrderBy(t => t.Index).ToList();
var lvColumnItem = _config.UiItem.MainColumnItem.OrderBy(t => t.Index).ToList();
var displayIndex = 0;
foreach (var item in lvColumnItem)
{
@@ -348,7 +348,7 @@ namespace v2rayN.Desktop.Views
}
if (item.Name.StartsWith("to"))
{
if (!_config.guiItem.enableStatistics)
if (!_config.GuiItem.EnableStatistics)
{
item2.IsVisible = false;
}
@@ -375,7 +375,7 @@ namespace v2rayN.Desktop.Views
Index = item2.DisplayIndex
});
}
_config.uiItem.mainColumnItem = lvColumnItem;
_config.UiItem.MainColumnItem = lvColumnItem;
ConfigHandler.SaveConfig(_config);
}
@@ -76,7 +76,7 @@ namespace v2rayN.Desktop.Views
{
if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow.Icon = AvaUtils.GetAppIcon(_config.systemProxyItem.sysProxyType);
desktop.MainWindow.Icon = AvaUtils.GetAppIcon(_config.SystemProxyItem.SysProxyType);
}
}