Skip to content

Commit 50449df

Browse files
committed
Improved
1 parent fe3836b commit 50449df

23 files changed

+93
-60
lines changed

v2rayN/v2rayN.Desktop/Views/AddServer2Window.axaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@
2323
x:Name="btnSave"
2424
Width="100"
2525
Content="{x:Static resx:ResUI.TbConfirm}"
26-
Cursor="Hand" />
26+
Cursor="Hand"
27+
IsDefault="True" />
2728
<Button
2829
x:Name="btnCancel"
2930
Width="100"
3031
Margin="8,0"
3132
Content="{x:Static resx:ResUI.TbCancel}"
32-
Cursor="Hand" />
33+
Cursor="Hand"
34+
IsCancel="True" />
3335
</StackPanel>
3436
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
3537
<Grid>

v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@
2323
x:Name="btnSave"
2424
Width="100"
2525
Content="{x:Static resx:ResUI.TbConfirm}"
26-
Cursor="Hand" />
26+
Cursor="Hand"
27+
IsDefault="True" />
2728
<Button
2829
x:Name="btnCancel"
2930
Width="100"
3031
Margin="8,0"
3132
Content="{x:Static resx:ResUI.TbCancel}"
32-
Cursor="Hand" />
33+
Cursor="Hand"
34+
IsCancel="True" />
3335
</StackPanel>
3436
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
3537
<Grid>

v2rayN/v2rayN.Desktop/Views/CheckUpdateView.axaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
77
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
88
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
9-
d:DesignHeight="450"
9+
d:DesignHeight="600"
1010
d:DesignWidth="800"
1111
x:DataType="vms:CheckUpdateViewModel"
1212
mc:Ignorable="d">
1313

1414
<DockPanel Classes="Margin8">
1515
<StackPanel
16-
HorizontalAlignment="Right"
16+
HorizontalAlignment="Center"
1717
Classes="Margin8"
1818
DockPanel.Dock="Bottom"
1919
Orientation="Horizontal">
@@ -67,14 +67,16 @@
6767
Grid.Column="0"
6868
Margin="8"
6969
HorizontalAlignment="Left"
70-
VerticalAlignment="Center"
70+
VerticalAlignment="Top"
7171
IsChecked="{Binding IsSelected}" />
7272
<TextBlock
7373
Grid.Column="1"
74+
HorizontalAlignment="Left"
7475
VerticalAlignment="Center"
7576
Text="{Binding CoreType}" />
7677
<TextBlock
7778
Grid.Column="2"
79+
HorizontalAlignment="Left"
7880
VerticalAlignment="Center"
7981
Text="{Binding Remarks}"
8082
TextWrapping="WrapWithOverflow" />

v2rayN/v2rayN.Desktop/Views/DNSSettingWindow.axaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@
2323
x:Name="btnSave"
2424
Width="100"
2525
Content="{x:Static resx:ResUI.TbConfirm}"
26-
Cursor="Hand" />
26+
Cursor="Hand"
27+
IsDefault="True" />
2728
<Button
2829
x:Name="btnCancel"
2930
Width="100"
3031
Margin="8,0"
3132
Content="{x:Static resx:ResUI.TbCancel}"
32-
Cursor="Hand" />
33+
Cursor="Hand"
34+
IsCancel="True" />
3335
</StackPanel>
3436

3537
<TabControl HorizontalContentAlignment="Left">

v2rayN/v2rayN.Desktop/Views/GlobalHotkeySettingWindow.axaml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
mc:Ignorable="d">
1616
<DockPanel Classes="Margin8">
1717
<StackPanel
18-
Classes="Margin8"
1918
HorizontalAlignment="Center"
19+
Classes="Margin8"
2020
DockPanel.Dock="Bottom"
2121
Orientation="Horizontal">
2222
<Button
@@ -28,13 +28,15 @@
2828
x:Name="btnSave"
2929
Width="100"
3030
Content="{x:Static resx:ResUI.TbConfirm}"
31-
Cursor="Hand" />
31+
Cursor="Hand"
32+
IsDefault="True" />
3233
<Button
3334
x:Name="btnCancel"
3435
Width="100"
3536
Margin="8,0"
3637
Content="{x:Static resx:ResUI.TbCancel}"
37-
Cursor="Hand" />
38+
Cursor="Hand"
39+
IsCancel="True" />
3840
</StackPanel>
3941
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
4042
<Grid>
@@ -66,77 +68,77 @@
6668
<TextBlock
6769
Grid.Row="1"
6870
Grid.Column="0"
69-
Classes="Margin8"
7071
VerticalAlignment="Center"
72+
Classes="Margin8"
7173
Text="{x:Static resx:ResUI.TbDisplayGUI}" />
7274

7375
<TextBox
7476
x:Name="txtGlobalHotkey0"
7577
Grid.Row="1"
7678
Grid.Column="1"
77-
Classes="Margin8"
7879
VerticalAlignment="Center"
80+
Classes="Margin8"
7981
IsReadOnly="True" />
8082

8183
<TextBlock
8284
Grid.Row="2"
8385
Grid.Column="0"
84-
Classes="Margin8"
8586
VerticalAlignment="Center"
87+
Classes="Margin8"
8688
Text="{x:Static resx:ResUI.TbClearSystemProxy}" />
8789
<TextBox
8890
x:Name="txtGlobalHotkey1"
8991
Grid.Row="2"
9092
Grid.Column="1"
91-
Classes="Margin8"
9293
VerticalAlignment="Center"
94+
Classes="Margin8"
9395
IsReadOnly="True" />
9496

9597
<TextBlock
9698
Grid.Row="3"
9799
Grid.Column="0"
98-
Classes="Margin8"
99100
VerticalAlignment="Center"
101+
Classes="Margin8"
100102
Text="{x:Static resx:ResUI.TbSetSystemProxy}" />
101103
<TextBox
102104
x:Name="txtGlobalHotkey2"
103105
Grid.Row="3"
104106
Grid.Column="1"
105-
Classes="Margin8"
106107
VerticalAlignment="Center"
108+
Classes="Margin8"
107109
IsReadOnly="True" />
108110
<TextBlock
109111
Grid.Row="4"
110112
Grid.Column="0"
111-
Classes="Margin8"
112113
VerticalAlignment="Center"
114+
Classes="Margin8"
113115
Text="{x:Static resx:ResUI.TbNotChangeSystemProxy}" />
114116
<TextBox
115117
x:Name="txtGlobalHotkey3"
116118
Grid.Row="4"
117119
Grid.Column="1"
118-
Classes="Margin8"
119120
VerticalAlignment="Center"
121+
Classes="Margin8"
120122
IsReadOnly="True" />
121123
<TextBlock
122124
Grid.Row="5"
123125
Grid.Column="0"
124-
Classes="Margin8"
125126
VerticalAlignment="Center"
127+
Classes="Margin8"
126128
Text="{x:Static resx:ResUI.TbSystemProxyPac}" />
127129
<TextBox
128130
x:Name="txtGlobalHotkey4"
129131
Grid.Row="5"
130132
Grid.Column="1"
131-
Classes="Margin8"
132133
VerticalAlignment="Center"
134+
Classes="Margin8"
133135
IsReadOnly="True" />
134136
</Grid>
135137

136138
<TextBlock
137139
Grid.Row="1"
138-
Classes="Margin8"
139140
VerticalAlignment="Center"
141+
Classes="Margin8"
140142
Text="{x:Static resx:ResUI.TbGlobalHotkeySettingTip}" />
141143
</Grid>
142144
</ScrollViewer>

v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -320,17 +320,17 @@ private void menuSettingsSetUWP_Click(object? sender, RoutedEventArgs e)
320320

321321
public async Task ScanScreenTaskAsync()
322322
{
323-
ShowHideWindow(false);
324-
325-
//var dpiXY = QRCodeHelper.GetDpiXY(Application.Current.MainWindow);
326-
//string result = await Task.Run(() =>
323+
//ShowHideWindow(false);
324+
325+
NoticeHandler.Instance.SendMessageAndEnqueue("Not yet implemented.(还未实现)");
326+
return;
327+
//if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
327328
//{
328-
// return QRCodeHelper.ScanScreen(dpiXY.Item1, dpiXY.Item2);
329-
//});
330-
331-
ShowHideWindow(true);
329+
// //var bytes = QRCodeHelper.CaptureScreen(desktop);
330+
// //await ViewModel?.ScanScreenResult(bytes);
331+
//}
332332

333-
//ViewModel?.ScanScreenResult(result);
333+
//ShowHideWindow(true);
334334
}
335335
private async Task ScanImageTaskAsync()
336336
{

v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@
2323
x:Name="btnSave"
2424
Width="100"
2525
Content="{x:Static resx:ResUI.TbConfirm}"
26-
Cursor="Hand" />
26+
Cursor="Hand"
27+
IsDefault="True" />
2728
<Button
2829
x:Name="btnCancel"
2930
Width="100"
3031
Margin="8,0"
3132
Content="{x:Static resx:ResUI.TbCancel}"
32-
Cursor="Hand" />
33+
Cursor="Hand"
34+
IsCancel="True" />
3335
</StackPanel>
3436

3537
<TabControl HorizontalContentAlignment="Stretch">

v2rayN/v2rayN.Desktop/Views/QrcodeView.axaml.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ public QrcodeView(string? url)
1717

1818
private Bitmap? GetQRCode(string? url)
1919
{
20-
var qrCodeImage = QRCodeHelper.GenQRCode(url);
21-
if (qrCodeImage is null) return null;
22-
var ms = new MemoryStream(qrCodeImage);
20+
var bytes = QRCodeHelper.GenQRCode(url);
21+
return ByteToBitmap(bytes);
22+
}
23+
24+
private Bitmap? ByteToBitmap(byte[]? bytes)
25+
{
26+
if (bytes is null) return null;
27+
28+
using var ms = new MemoryStream(bytes);
2329
return new Bitmap(ms);
2430
}
2531
}

v2rayN/v2rayN.Desktop/Views/RoutingRuleDetailsWindow.axaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,15 @@
158158
x:Name="btnSave"
159159
Width="100"
160160
Content="{x:Static resx:ResUI.TbConfirm}"
161-
Cursor="Hand" />
161+
Cursor="Hand"
162+
IsDefault="True" />
162163
<Button
163164
x:Name="btnCancel"
164165
Width="100"
165166
Margin="8,0"
166167
Content="{x:Static resx:ResUI.TbCancel}"
167-
Cursor="Hand" />
168+
Cursor="Hand"
169+
IsCancel="True" />
168170
</StackPanel>
169171

170172
<Grid Classes="Margin8">

v2rayN/v2rayN.Desktop/Views/RoutingRuleSettingWindow.axaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@
3535
x:Name="btnSave"
3636
Width="100"
3737
Content="{x:Static resx:ResUI.TbConfirm}"
38-
Cursor="Hand" />
38+
Cursor="Hand"
39+
IsDefault="True" />
3940
<Button
4041
x:Name="btnCancel"
4142
Width="100"
4243
Margin="8,0"
4344
Content="{x:Static resx:ResUI.TbCancel}"
44-
Cursor="Hand" />
45+
Cursor="Hand"
46+
IsCancel="True" />
4547
</StackPanel>
4648

4749
<Grid Classes="Margin8" DockPanel.Dock="Top">

0 commit comments

Comments
 (0)