mirror of
https://github.com/2dust/v2rayN.git
synced 2025-05-03 05:38:51 +00:00
commit
6fd2499daf
12 changed files with 122 additions and 3 deletions
|
@ -11,6 +11,17 @@ namespace v2rayN.Views
|
||||||
public AddServer2Window(ProfileItem profileItem)
|
public AddServer2Window(ProfileItem profileItem)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||||
|
if (this.Width > SystemParameters.WorkArea.Width)
|
||||||
|
{
|
||||||
|
this.Width = SystemParameters.WorkArea.Width;
|
||||||
|
}
|
||||||
|
if (this.Height > SystemParameters.WorkArea.Height)
|
||||||
|
{
|
||||||
|
this.Height = SystemParameters.WorkArea.Height;
|
||||||
|
}
|
||||||
|
|
||||||
this.Owner = Application.Current.MainWindow;
|
this.Owner = Application.Current.MainWindow;
|
||||||
this.Loaded += Window_Loaded;
|
this.Loaded += Window_Loaded;
|
||||||
ViewModel = new AddServer2ViewModel(profileItem, this);
|
ViewModel = new AddServer2ViewModel(profileItem, this);
|
||||||
|
|
|
@ -15,6 +15,17 @@ namespace v2rayN.Views
|
||||||
public AddServerWindow(ProfileItem profileItem)
|
public AddServerWindow(ProfileItem profileItem)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||||
|
if (this.Width > SystemParameters.WorkArea.Width)
|
||||||
|
{
|
||||||
|
this.Width = SystemParameters.WorkArea.Width;
|
||||||
|
}
|
||||||
|
if (this.Height > SystemParameters.WorkArea.Height)
|
||||||
|
{
|
||||||
|
this.Height = SystemParameters.WorkArea.Height;
|
||||||
|
}
|
||||||
|
|
||||||
this.Owner = Application.Current.MainWindow;
|
this.Owner = Application.Current.MainWindow;
|
||||||
this.Loaded += Window_Loaded;
|
this.Loaded += Window_Loaded;
|
||||||
cmbNetwork.SelectionChanged += CmbNetwork_SelectionChanged;
|
cmbNetwork.SelectionChanged += CmbNetwork_SelectionChanged;
|
||||||
|
|
|
@ -14,6 +14,17 @@ namespace v2rayN.Views
|
||||||
public DNSSettingWindow()
|
public DNSSettingWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||||
|
if (this.Width > SystemParameters.WorkArea.Width)
|
||||||
|
{
|
||||||
|
this.Width = SystemParameters.WorkArea.Width;
|
||||||
|
}
|
||||||
|
if (this.Height > SystemParameters.WorkArea.Height)
|
||||||
|
{
|
||||||
|
this.Height = SystemParameters.WorkArea.Height;
|
||||||
|
}
|
||||||
|
|
||||||
this.Owner = Application.Current.MainWindow;
|
this.Owner = Application.Current.MainWindow;
|
||||||
_config = LazyConfig.Instance.GetConfig();
|
_config = LazyConfig.Instance.GetConfig();
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,17 @@ namespace v2rayN.Views
|
||||||
public GlobalHotkeySettingWindow()
|
public GlobalHotkeySettingWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||||
|
if (this.Width > SystemParameters.WorkArea.Width)
|
||||||
|
{
|
||||||
|
this.Width = SystemParameters.WorkArea.Width;
|
||||||
|
}
|
||||||
|
if (this.Height > SystemParameters.WorkArea.Height)
|
||||||
|
{
|
||||||
|
this.Height = SystemParameters.WorkArea.Height;
|
||||||
|
}
|
||||||
|
|
||||||
this.Owner = Application.Current.MainWindow;
|
this.Owner = Application.Current.MainWindow;
|
||||||
_config = LazyConfig.Instance.GetConfig();
|
_config = LazyConfig.Instance.GetConfig();
|
||||||
_config.globalHotkeys ??= new List<KeyEventItem>();
|
_config.globalHotkeys ??= new List<KeyEventItem>();
|
||||||
|
|
|
@ -15,8 +15,6 @@
|
||||||
Title="v2rayN"
|
Title="v2rayN"
|
||||||
Width="900"
|
Width="900"
|
||||||
Height="700"
|
Height="700"
|
||||||
MinWidth="900"
|
|
||||||
MinHeight="700"
|
|
||||||
x:TypeArguments="vms:MainWindowViewModel"
|
x:TypeArguments="vms:MainWindowViewModel"
|
||||||
Background="{DynamicResource MaterialDesignPaper}"
|
Background="{DynamicResource MaterialDesignPaper}"
|
||||||
FontFamily="{x:Static conv:MaterialDesignFonts.MyFont}"
|
FontFamily="{x:Static conv:MaterialDesignFonts.MyFont}"
|
||||||
|
|
|
@ -25,6 +25,17 @@ namespace v2rayN.Views
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||||
|
if (this.Width > SystemParameters.WorkArea.Width)
|
||||||
|
{
|
||||||
|
this.Width = SystemParameters.WorkArea.Width;
|
||||||
|
}
|
||||||
|
if (this.Height > SystemParameters.WorkArea.Height)
|
||||||
|
{
|
||||||
|
this.Height = SystemParameters.WorkArea.Height;
|
||||||
|
}
|
||||||
|
|
||||||
_config = LazyConfig.Instance.GetConfig();
|
_config = LazyConfig.Instance.GetConfig();
|
||||||
|
|
||||||
App.Current.SessionEnding += Current_SessionEnding;
|
App.Current.SessionEnding += Current_SessionEnding;
|
||||||
|
|
|
@ -18,6 +18,17 @@ namespace v2rayN.Views
|
||||||
public OptionSettingWindow()
|
public OptionSettingWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||||
|
if (this.Width > SystemParameters.WorkArea.Width)
|
||||||
|
{
|
||||||
|
this.Width = SystemParameters.WorkArea.Width;
|
||||||
|
}
|
||||||
|
if (this.Height > SystemParameters.WorkArea.Height)
|
||||||
|
{
|
||||||
|
this.Height = SystemParameters.WorkArea.Height;
|
||||||
|
}
|
||||||
|
|
||||||
this.Owner = Application.Current.MainWindow;
|
this.Owner = Application.Current.MainWindow;
|
||||||
_config = LazyConfig.Instance.GetConfig();
|
_config = LazyConfig.Instance.GetConfig();
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,17 @@ namespace v2rayN.Views
|
||||||
public RoutingRuleDetailsWindow(RulesItem rulesItem)
|
public RoutingRuleDetailsWindow(RulesItem rulesItem)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||||
|
if (this.Width > SystemParameters.WorkArea.Width)
|
||||||
|
{
|
||||||
|
this.Width = SystemParameters.WorkArea.Width;
|
||||||
|
}
|
||||||
|
if (this.Height > SystemParameters.WorkArea.Height)
|
||||||
|
{
|
||||||
|
this.Height = SystemParameters.WorkArea.Height;
|
||||||
|
}
|
||||||
|
|
||||||
this.Owner = Application.Current.MainWindow;
|
this.Owner = Application.Current.MainWindow;
|
||||||
this.Loaded += Window_Loaded;
|
this.Loaded += Window_Loaded;
|
||||||
clbProtocol.SelectionChanged += ClbProtocol_SelectionChanged;
|
clbProtocol.SelectionChanged += ClbProtocol_SelectionChanged;
|
||||||
|
|
|
@ -13,6 +13,17 @@ namespace v2rayN.Views
|
||||||
public RoutingRuleSettingWindow(RoutingItem routingItem)
|
public RoutingRuleSettingWindow(RoutingItem routingItem)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||||
|
if (this.Width > SystemParameters.WorkArea.Width)
|
||||||
|
{
|
||||||
|
this.Width = SystemParameters.WorkArea.Width;
|
||||||
|
}
|
||||||
|
if (this.Height > SystemParameters.WorkArea.Height)
|
||||||
|
{
|
||||||
|
this.Height = SystemParameters.WorkArea.Height;
|
||||||
|
}
|
||||||
|
|
||||||
this.Owner = Application.Current.MainWindow;
|
this.Owner = Application.Current.MainWindow;
|
||||||
this.Loaded += Window_Loaded;
|
this.Loaded += Window_Loaded;
|
||||||
this.PreviewKeyDown += RoutingRuleSettingWindow_PreviewKeyDown;
|
this.PreviewKeyDown += RoutingRuleSettingWindow_PreviewKeyDown;
|
||||||
|
|
|
@ -12,6 +12,17 @@ namespace v2rayN.Views
|
||||||
public RoutingSettingWindow()
|
public RoutingSettingWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||||
|
if (this.Width > SystemParameters.WorkArea.Width)
|
||||||
|
{
|
||||||
|
this.Width = SystemParameters.WorkArea.Width;
|
||||||
|
}
|
||||||
|
if (this.Height > SystemParameters.WorkArea.Height)
|
||||||
|
{
|
||||||
|
this.Height = SystemParameters.WorkArea.Height;
|
||||||
|
}
|
||||||
|
|
||||||
this.Owner = Application.Current.MainWindow;
|
this.Owner = Application.Current.MainWindow;
|
||||||
this.Closing += RoutingSettingWindow_Closing;
|
this.Closing += RoutingSettingWindow_Closing;
|
||||||
this.PreviewKeyDown += RoutingSettingWindow_PreviewKeyDown;
|
this.PreviewKeyDown += RoutingSettingWindow_PreviewKeyDown;
|
||||||
|
|
|
@ -11,6 +11,17 @@ namespace v2rayN.Views
|
||||||
public SubEditWindow(SubItem subItem)
|
public SubEditWindow(SubItem subItem)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||||
|
if (this.Width > SystemParameters.WorkArea.Width)
|
||||||
|
{
|
||||||
|
this.Width = SystemParameters.WorkArea.Width;
|
||||||
|
}
|
||||||
|
if (this.Height > SystemParameters.WorkArea.Height)
|
||||||
|
{
|
||||||
|
this.Height = SystemParameters.WorkArea.Height;
|
||||||
|
}
|
||||||
|
|
||||||
this.Owner = Application.Current.MainWindow;
|
this.Owner = Application.Current.MainWindow;
|
||||||
this.Loaded += Window_Loaded;
|
this.Loaded += Window_Loaded;
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,17 @@ namespace v2rayN.Views
|
||||||
public SubSettingWindow()
|
public SubSettingWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
// 设置窗口的尺寸不大于屏幕的尺寸
|
||||||
|
if (this.Width > SystemParameters.WorkArea.Width)
|
||||||
|
{
|
||||||
|
this.Width = SystemParameters.WorkArea.Width;
|
||||||
|
}
|
||||||
|
if (this.Height > SystemParameters.WorkArea.Height)
|
||||||
|
{
|
||||||
|
this.Height = SystemParameters.WorkArea.Height;
|
||||||
|
}
|
||||||
|
|
||||||
this.Owner = Application.Current.MainWindow;
|
this.Owner = Application.Current.MainWindow;
|
||||||
|
|
||||||
ViewModel = new SubSettingViewModel(this);
|
ViewModel = new SubSettingViewModel(this);
|
||||||
|
|
Loading…
Reference in a new issue