From fc3ba6c030d755f461d0a340985e2e9d843ac22e Mon Sep 17 00:00:00 2001
From: 2dust <31833384+2dust@users.noreply.github.com>
Date: Wed, 16 Oct 2024 19:36:38 +0800
Subject: [PATCH] Improved UI
---
v2rayN/ServiceLib/Resx/ResUI.Designer.cs | 54 +++++++++----------
v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx | 2 +-
v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx | 2 +-
v2rayN/v2rayN.Desktop/App.axaml | 13 ++---
.../Assets/GlobalResources.axaml | 11 ++++
.../{Styles => Assets}/GlobalStyles.axaml | 0
.../v2rayN.Desktop/Views/StatusBarView.axaml | 14 +++--
.../Views/StatusBarView.axaml.cs | 2 +-
v2rayN/v2rayN/Views/StatusBarView.xaml | 15 ++++--
9 files changed, 64 insertions(+), 49 deletions(-)
create mode 100644 v2rayN/v2rayN.Desktop/Assets/GlobalResources.axaml
rename v2rayN/v2rayN.Desktop/{Styles => Assets}/GlobalStyles.axaml (100%)
diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
index 9c3e1f69..fe2fec2e 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
+++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
@@ -1113,33 +1113,6 @@ namespace ServiceLib.Resx {
}
}
- ///
- /// 查找类似 Regional presets 的本地化字符串。
- ///
- public static string menuRegionalPresets {
- get {
- return ResourceManager.GetString("menuRegionalPresets", resourceCulture);
- }
- }
-
- ///
- /// 查找类似 Default 的本地化字符串。
- ///
- public static string menuRegionalPresetsDefault {
- get {
- return ResourceManager.GetString("menuRegionalPresetsDefault", resourceCulture);
- }
- }
-
- ///
- /// 查找类似 Russia 的本地化字符串。
- ///
- public static string menuRegionalPresetsRussia {
- get {
- return ResourceManager.GetString("menuRegionalPresetsRussia", resourceCulture);
- }
- }
-
///
/// 查找类似 Auto column width adjustment 的本地化字符串。
///
@@ -1212,6 +1185,33 @@ namespace ServiceLib.Resx {
}
}
+ ///
+ /// 查找类似 Regional presets setting 的本地化字符串。
+ ///
+ public static string menuRegionalPresets {
+ get {
+ return ResourceManager.GetString("menuRegionalPresets", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Default 的本地化字符串。
+ ///
+ public static string menuRegionalPresetsDefault {
+ get {
+ return ResourceManager.GetString("menuRegionalPresetsDefault", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Russia 的本地化字符串。
+ ///
+ public static string menuRegionalPresetsRussia {
+ get {
+ return ResourceManager.GetString("menuRegionalPresetsRussia", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Reload 的本地化字符串。
///
diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
index 2a8e1bd6..99c3226e 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
@@ -953,7 +953,7 @@
导入旧的配置文件guiNConfig
- 启用Tun模式
+ 启用Tun
为局域网开启新的端口
diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
index 722b97d5..e345d2c6 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
@@ -953,7 +953,7 @@
匯入舊的設定檔guiNConfig
- 啟用TUN模式
+ 啟用TUN
為區域網路開啟新的埠
diff --git a/v2rayN/v2rayN.Desktop/App.axaml b/v2rayN/v2rayN.Desktop/App.axaml
index cabf69a2..22559940 100644
--- a/v2rayN/v2rayN.Desktop/App.axaml
+++ b/v2rayN/v2rayN.Desktop/App.axaml
@@ -7,21 +7,16 @@
x:DataType="vms:StatusBarViewModel"
RequestedThemeVariant="Default">
-
+
- M512 0a512 512 0 1 0 512 512A512 512 0 0 0 512 0z m47.402667 580.906667l-50.090667 50.816q-25.045333 24.448-45.098667 44.8c-13.397333 13.610667-24.405333 24.704-33.194666 33.493333s-13.994667 13.781333-15.701334 15.018667c-4.266667 3.797333-9.002667 7.722667-14.421333 11.904a77.397333 77.397333 0 0 1-17.066667 9.984 255.232 255.232 0 0 1-25.6 10.581333 832.426667 832.426667 0 0 1-70.528 22.485333c-11.093333 2.901333-19.285333 4.821333-24.704 5.589334-11.306667 1.28-18.816-0.384-22.485333-4.992a29.397333 29.397333 0 0 1-3.114667-23.210667 198.016 198.016 0 0 1 6.016-25.6c3.114667-11.093333 6.485333-22.485333 9.984-34.389333s6.997333-22.912 10.282667-32.896a164.821333 164.821333 0 0 1 8.106667-20.693334 96.64 96.64 0 0 1 8.533333-16 101.504 101.504 0 0 1 13.482667-16c2.517333-2.517333 8.533333-8.533333 17.493333-17.792s20.693333-20.992 34.389333-34.816l231.253334-231.253333 117.12 118.016-134.741334 134.741333z m224.938666-229.333334a51.2 51.2 0 0 1-9.984 15.701334q-7.509333 7.509333-13.482666 13.184c-4.010667 3.797333-7.381333 7.082667-10.282667 9.984s-6.485333 6.314667-9.386667 8.789333l-117.290666-117.162667c4.992-4.608 11.008-10.112 17.92-16.597333s12.8-11.605333 17.066666-15.317333a54.613333 54.613333 0 0 1 18.218667-9.685334 56.917333 56.917333 0 0 1 18.517333-2.517333 71.936 71.936 0 0 1 17.493334 2.816 94.464 94.464 0 0 1 14.72 5.589333 113.536 113.536 0 0 1 29.098666 24.106667 138.666667 138.666667 0 0 1 24.704 36.010667 66.389333 66.389333 0 0 1 4.266667 13.184 79.573333 79.573333 0 0 1 1.621333 15.701333 44.330667 44.330667 0 0 1-3.114666 16.213333z m0 0
- M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0z m238.08 570.88h-179.2v179.2c0 32.768-26.112 58.88-58.88 58.88s-58.88-26.112-58.88-58.88v-179.2h-179.2c-32.768 0-58.88-26.112-58.88-58.88s26.112-58.88 58.88-58.88h179.2v-179.2c0-32.768 26.112-58.88 58.88-58.88s58.88 26.112 58.88 58.88v179.2h179.2c32.768 0 58.88 26.112 58.88 58.88s-26.112 58.88-58.88 58.88z
- M512 1024C229.248 1024 0 794.752 0 512S229.248 0 512 0s512 229.248 512 512-229.248 512-512 512zM216.576 488.789333h-23.168v46.421334h23.168v56.448c0 7.296 5.973333 13.226667 13.269333 13.226666h42.965334c7.296 0 13.226667-5.930667 13.226666-13.226666v-159.317334a13.269333 13.269333 0 0 0-13.226666-13.226666H229.845333a13.269333 13.269333 0 0 0-13.226666 13.226666v56.448z m415.104 0.426667H403.712V366.037333a13.269333 13.269333 0 0 0-13.269333-13.269333H325.802667a13.269333 13.269333 0 0 0-13.226667 13.226667v292.053333c0 7.338667 5.888 13.269333 13.226667 13.269333h64.64c7.338667 0 13.269333-5.930667 13.269333-13.226666v-123.306667h227.968v123.306667c0 7.296 5.930667 13.226667 13.226667 13.226666h64.64c7.338667 0 13.269333-5.930667 13.269333-13.226666V365.952a13.269333 13.269333 0 0 0-13.226667-13.269333h-64.64a13.269333 13.269333 0 0 0-13.269333 13.226666v123.306667z m187.093333-0.426667v-56.448a13.269333 13.269333 0 0 0-13.226666-13.226666h-42.965334a13.269333 13.269333 0 0 0-13.269333 13.226666v159.317334c0 7.296 5.973333 13.226667 13.269333 13.226666h42.922667c7.338667 0 13.269333-5.930667 13.269333-13.226666v-56.448h23.168v-46.421334h-23.168z
- M511.9,276.3c43.8,0 79.2,-35.5 79.2,-79.2 0,-43.8 -35.5,-79.2 -79.2,-79.2 -43.8,0 -79.2,35.5 -79.2,79.2 0,43.8 35.5,79.2 79.2,79.2zM511.9,434.8c-43.8,0 -79.2,35.5 -79.2,79.2 0,43.8 35.5,79.2 79.2,79.2 43.8,0 79.2,-35.5 79.2,-79.2 0,-43.8 -35.5,-79.2 -79.2,-79.2zM511.9,751.8c-43.8,0 -79.2,35.4 -79.2,79.2 0,43.8 35.5,79.2 79.2,79.2 43.8,0 79.2,-35.5 79.2,-79.2 0,-43.8 -35.5,-79.2 -79.2,-79.2z
- M809.984 169.984l0 86.016-596.010667 0 0-86.016 148.010667 0 43.989333-41.984 212.010667 0 43.989333 41.984 148.010667 0zM256 809.984l0-512 512 0 0 512q0 34.005333-25.984 59.989333t-59.989333 25.984l-340.010667 0q-34.005333 0-59.989333-25.984t-25.984-59.989333z
- M704 896v80c0 26.51-21.49 48-48 48H112c-26.51 0-48-21.49-48-48V240c0-26.51 21.49-48 48-48h144v592c0 61.758 50.242 112 112 112h336z m0-688V0H368c-26.51 0-48 21.49-48 48v736c0 26.51 21.49 48 48 48h544c26.51 0 48-21.49 48-48V256H752c-26.4 0-48-21.6-48-48z m241.942-62.058L814.058 14.058A48 48 0 0 0 780.118 0H768v192h192v-12.118a48 48 0 0 0-14.058-33.94z
- M849.652671 679.144788l111.007233-174.965917-50.615794 0C905.498584 274.107915 717.720873 88.965218 486.575446 88.965218c-233.998405 0-423.716304 189.698456-423.716304 423.707095 0 233.998405 189.716876 423.715281 423.716304 423.715281 113.936959 0 217.278605-45.079708 293.440216-118.235868l-62.46568-108.306728c-55.750745 65.205071-138.455375 106.709347-230.974535 106.709347-167.843706 0-303.882032-136.039349-303.882032-303.883055S318.732763 208.788234 486.575446 208.788234c164.951843 0 298.899554 131.522476 303.44508 295.389614l-51.357691 0L849.652671 679.144788z
- M273.28 899.328c-6.4 6.4-16 9.6-25.6 9.6-6.4 0-12.8-3.2-18.56-6.4-102.4-85.76-162.56-209.92-162.56-343.68 0-245.12 200.32-445.44 445.44-445.44s445.44 200.32 445.44 445.44c0 133.76-56.96 257.92-162.56 343.68-12.16 12.8-34.56 9.6-44.16-3.2-12.8-12.8-9.6-35.2 3.2-44.8a377.152 377.152 0 0 0 136.96-292.48c0-209.92-172.16-382.08-382.08-382.08-206.72-3.2-378.88 168.96-378.88 378.88 0 114.56 51.2 222.72 140.16 295.68 12.8 12.8 16 32 3.2 44.8z m394.88-540.8c12.8-12.8 31.36-12.8 44.16 0 12.8 12.8 12.8 32 0 44.8l-138.88 138.88c1.28 5.12 2.56 10.88 2.56 16.64 0 35.2-28.8 64-64 64-5.76 0-11.52-1.28-16.64-2.56l-24.32 24.32c-6.4 6.4-12.8 9.6-22.4 9.6-9.6 0-16-3.2-22.4-9.6-12.8-12.8-12.8-31.36 0-44.16l24.32-24.96a69.76 69.76 0 0 1-1.92-16.64c0-35.2 28.16-63.36 63.36-63.36 5.76 0 11.52 0.64 16.64 1.92z
+
+
+
diff --git a/v2rayN/v2rayN.Desktop/Assets/GlobalResources.axaml b/v2rayN/v2rayN.Desktop/Assets/GlobalResources.axaml
new file mode 100644
index 00000000..31992fcc
--- /dev/null
+++ b/v2rayN/v2rayN.Desktop/Assets/GlobalResources.axaml
@@ -0,0 +1,11 @@
+
+ M512 0a512 512 0 1 0 512 512A512 512 0 0 0 512 0z m47.402667 580.906667l-50.090667 50.816q-25.045333 24.448-45.098667 44.8c-13.397333 13.610667-24.405333 24.704-33.194666 33.493333s-13.994667 13.781333-15.701334 15.018667c-4.266667 3.797333-9.002667 7.722667-14.421333 11.904a77.397333 77.397333 0 0 1-17.066667 9.984 255.232 255.232 0 0 1-25.6 10.581333 832.426667 832.426667 0 0 1-70.528 22.485333c-11.093333 2.901333-19.285333 4.821333-24.704 5.589334-11.306667 1.28-18.816-0.384-22.485333-4.992a29.397333 29.397333 0 0 1-3.114667-23.210667 198.016 198.016 0 0 1 6.016-25.6c3.114667-11.093333 6.485333-22.485333 9.984-34.389333s6.997333-22.912 10.282667-32.896a164.821333 164.821333 0 0 1 8.106667-20.693334 96.64 96.64 0 0 1 8.533333-16 101.504 101.504 0 0 1 13.482667-16c2.517333-2.517333 8.533333-8.533333 17.493333-17.792s20.693333-20.992 34.389333-34.816l231.253334-231.253333 117.12 118.016-134.741334 134.741333z m224.938666-229.333334a51.2 51.2 0 0 1-9.984 15.701334q-7.509333 7.509333-13.482666 13.184c-4.010667 3.797333-7.381333 7.082667-10.282667 9.984s-6.485333 6.314667-9.386667 8.789333l-117.290666-117.162667c4.992-4.608 11.008-10.112 17.92-16.597333s12.8-11.605333 17.066666-15.317333a54.613333 54.613333 0 0 1 18.218667-9.685334 56.917333 56.917333 0 0 1 18.517333-2.517333 71.936 71.936 0 0 1 17.493334 2.816 94.464 94.464 0 0 1 14.72 5.589333 113.536 113.536 0 0 1 29.098666 24.106667 138.666667 138.666667 0 0 1 24.704 36.010667 66.389333 66.389333 0 0 1 4.266667 13.184 79.573333 79.573333 0 0 1 1.621333 15.701333 44.330667 44.330667 0 0 1-3.114666 16.213333z m0 0
+ M512 0C229.376 0 0 229.376 0 512s229.376 512 512 512 512-229.376 512-512S794.624 0 512 0z m238.08 570.88h-179.2v179.2c0 32.768-26.112 58.88-58.88 58.88s-58.88-26.112-58.88-58.88v-179.2h-179.2c-32.768 0-58.88-26.112-58.88-58.88s26.112-58.88 58.88-58.88h179.2v-179.2c0-32.768 26.112-58.88 58.88-58.88s58.88 26.112 58.88 58.88v179.2h179.2c32.768 0 58.88 26.112 58.88 58.88s-26.112 58.88-58.88 58.88z
+ M512 1024C229.248 1024 0 794.752 0 512S229.248 0 512 0s512 229.248 512 512-229.248 512-512 512zM216.576 488.789333h-23.168v46.421334h23.168v56.448c0 7.296 5.973333 13.226667 13.269333 13.226666h42.965334c7.296 0 13.226667-5.930667 13.226666-13.226666v-159.317334a13.269333 13.269333 0 0 0-13.226666-13.226666H229.845333a13.269333 13.269333 0 0 0-13.226666 13.226666v56.448z m415.104 0.426667H403.712V366.037333a13.269333 13.269333 0 0 0-13.269333-13.269333H325.802667a13.269333 13.269333 0 0 0-13.226667 13.226667v292.053333c0 7.338667 5.888 13.269333 13.226667 13.269333h64.64c7.338667 0 13.269333-5.930667 13.269333-13.226666v-123.306667h227.968v123.306667c0 7.296 5.930667 13.226667 13.226667 13.226666h64.64c7.338667 0 13.269333-5.930667 13.269333-13.226666V365.952a13.269333 13.269333 0 0 0-13.226667-13.269333h-64.64a13.269333 13.269333 0 0 0-13.269333 13.226666v123.306667z m187.093333-0.426667v-56.448a13.269333 13.269333 0 0 0-13.226666-13.226666h-42.965334a13.269333 13.269333 0 0 0-13.269333 13.226666v159.317334c0 7.296 5.973333 13.226667 13.269333 13.226666h42.922667c7.338667 0 13.269333-5.930667 13.269333-13.226666v-56.448h23.168v-46.421334h-23.168z
+ M511.9,276.3c43.8,0 79.2,-35.5 79.2,-79.2 0,-43.8 -35.5,-79.2 -79.2,-79.2 -43.8,0 -79.2,35.5 -79.2,79.2 0,43.8 35.5,79.2 79.2,79.2zM511.9,434.8c-43.8,0 -79.2,35.5 -79.2,79.2 0,43.8 35.5,79.2 79.2,79.2 43.8,0 79.2,-35.5 79.2,-79.2 0,-43.8 -35.5,-79.2 -79.2,-79.2zM511.9,751.8c-43.8,0 -79.2,35.4 -79.2,79.2 0,43.8 35.5,79.2 79.2,79.2 43.8,0 79.2,-35.5 79.2,-79.2 0,-43.8 -35.5,-79.2 -79.2,-79.2z
+ M809.984 169.984l0 86.016-596.010667 0 0-86.016 148.010667 0 43.989333-41.984 212.010667 0 43.989333 41.984 148.010667 0zM256 809.984l0-512 512 0 0 512q0 34.005333-25.984 59.989333t-59.989333 25.984l-340.010667 0q-34.005333 0-59.989333-25.984t-25.984-59.989333z
+ M704 896v80c0 26.51-21.49 48-48 48H112c-26.51 0-48-21.49-48-48V240c0-26.51 21.49-48 48-48h144v592c0 61.758 50.242 112 112 112h336z m0-688V0H368c-26.51 0-48 21.49-48 48v736c0 26.51 21.49 48 48 48h544c26.51 0 48-21.49 48-48V256H752c-26.4 0-48-21.6-48-48z m241.942-62.058L814.058 14.058A48 48 0 0 0 780.118 0H768v192h192v-12.118a48 48 0 0 0-14.058-33.94z
+ M849.652671 679.144788l111.007233-174.965917-50.615794 0C905.498584 274.107915 717.720873 88.965218 486.575446 88.965218c-233.998405 0-423.716304 189.698456-423.716304 423.707095 0 233.998405 189.716876 423.715281 423.716304 423.715281 113.936959 0 217.278605-45.079708 293.440216-118.235868l-62.46568-108.306728c-55.750745 65.205071-138.455375 106.709347-230.974535 106.709347-167.843706 0-303.882032-136.039349-303.882032-303.883055S318.732763 208.788234 486.575446 208.788234c164.951843 0 298.899554 131.522476 303.44508 295.389614l-51.357691 0L849.652671 679.144788z
+ M273.28 899.328c-6.4 6.4-16 9.6-25.6 9.6-6.4 0-12.8-3.2-18.56-6.4-102.4-85.76-162.56-209.92-162.56-343.68 0-245.12 200.32-445.44 445.44-445.44s445.44 200.32 445.44 445.44c0 133.76-56.96 257.92-162.56 343.68-12.16 12.8-34.56 9.6-44.16-3.2-12.8-12.8-9.6-35.2 3.2-44.8a377.152 377.152 0 0 0 136.96-292.48c0-209.92-172.16-382.08-382.08-382.08-206.72-3.2-378.88 168.96-378.88 378.88 0 114.56 51.2 222.72 140.16 295.68 12.8 12.8 16 32 3.2 44.8z m394.88-540.8c12.8-12.8 31.36-12.8 44.16 0 12.8 12.8 12.8 32 0 44.8l-138.88 138.88c1.28 5.12 2.56 10.88 2.56 16.64 0 35.2-28.8 64-64 64-5.76 0-11.52-1.28-16.64-2.56l-24.32 24.32c-6.4 6.4-12.8 9.6-22.4 9.6-9.6 0-16-3.2-22.4-9.6-12.8-12.8-12.8-31.36 0-44.16l24.32-24.96a69.76 69.76 0 0 1-1.92-16.64c0-35.2 28.16-63.36 63.36-63.36 5.76 0 11.52 0.64 16.64 1.92z
+
+
diff --git a/v2rayN/v2rayN.Desktop/Styles/GlobalStyles.axaml b/v2rayN/v2rayN.Desktop/Assets/GlobalStyles.axaml
similarity index 100%
rename from v2rayN/v2rayN.Desktop/Styles/GlobalStyles.axaml
rename to v2rayN/v2rayN.Desktop/Assets/GlobalStyles.axaml
diff --git a/v2rayN/v2rayN.Desktop/Views/StatusBarView.axaml b/v2rayN/v2rayN.Desktop/Views/StatusBarView.axaml
index e5de9e7a..d46ae9ab 100644
--- a/v2rayN/v2rayN.Desktop/Views/StatusBarView.axaml
+++ b/v2rayN/v2rayN.Desktop/Views/StatusBarView.axaml
@@ -37,11 +37,15 @@
Width="100"
Margin="8,0"
VerticalAlignment="Center"
- DockPanel.Dock="Left">
-
+ DockPanel.Dock="Left"
+ Orientation="Horizontal">
+
@@ -53,7 +57,7 @@
Orientation="Horizontal">
@@ -63,7 +67,7 @@
vm.SelectedRouting, v => v.cmbRoutings2.SelectedItem).DisposeWith(disposables);
});
- togEnableTun.IsVisible = (Utils.IsWindows() || AppHandler.Instance.IsAdministrator);
+ spEnableTun.IsVisible = (Utils.IsWindows() || AppHandler.Instance.IsAdministrator);
}
private async Task UpdateViewHandler(EViewAction action, object? obj)
diff --git a/v2rayN/v2rayN/Views/StatusBarView.xaml b/v2rayN/v2rayN/Views/StatusBarView.xaml
index 3c0d6e5c..db141cd2 100644
--- a/v2rayN/v2rayN/Views/StatusBarView.xaml
+++ b/v2rayN/v2rayN/Views/StatusBarView.xaml
@@ -41,12 +41,17 @@
Width="auto"
Margin="{StaticResource MarginLeftRight8}"
VerticalAlignment="Center"
- DockPanel.Dock="Left">
-
+ DockPanel.Dock="Left"
+ Orientation="Horizontal">
+
+ HorizontalAlignment="Left"
+ VerticalAlignment="Center" />