mirror of
https://github.com/shadowsocks/ShadowsocksX-NG.git
synced 2026-11-02 16:53:45 +00:00
feat: add status bar runtime dots toggle
This commit is contained in:
@@ -1,6 +1,23 @@
|
||||
{
|
||||
"sourceLanguage": "zh-Hans",
|
||||
"strings": {
|
||||
"显示状态栏运行状态圆点": {
|
||||
"extractionState": "manual",
|
||||
"localizations": {
|
||||
"en": {
|
||||
"stringUnit": {
|
||||
"state": "translated",
|
||||
"value": "Show runtime status dots in the menu bar"
|
||||
}
|
||||
},
|
||||
"zh-Hans": {
|
||||
"stringUnit": {
|
||||
"state": "translated",
|
||||
"value": "显示状态栏运行状态圆点"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"服务器库无法读取": {
|
||||
"extractionState": "manual",
|
||||
"localizations": {
|
||||
|
||||
@@ -9,6 +9,7 @@ struct SettingsView: View {
|
||||
@ObservedObject var loginController: LaunchAtLoginController
|
||||
@ObservedObject var silentLaunch: SilentLaunchController
|
||||
@State private var presentedEditor: SettingsEditorSheet?
|
||||
@AppStorage("showStatusBarRuntimeDots") private var showStatusBarRuntimeDots = true
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
@@ -69,6 +70,9 @@ struct SettingsView: View {
|
||||
.toggleStyle(.switch)
|
||||
}
|
||||
.padding(.vertical, 4)
|
||||
Toggle("显示状态栏运行状态圆点", isOn: $showStatusBarRuntimeDots)
|
||||
.toggleStyle(.switch)
|
||||
.padding(.vertical, 4)
|
||||
LanguageSettingsRow()
|
||||
} header: {
|
||||
sectionHeader(String(localized: "常规"))
|
||||
|
||||
@@ -67,6 +67,7 @@ struct StatusMenuLabel: View {
|
||||
let statusDisplay: StatusDisplayModel
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
@Environment(\.displayScale) private var displayScale
|
||||
@AppStorage("showStatusBarRuntimeDots") private var showStatusBarRuntimeDots = true
|
||||
|
||||
var body: some View {
|
||||
Image(nsImage: statusImage)
|
||||
@@ -85,9 +86,11 @@ struct StatusMenuLabel: View {
|
||||
.font(.system(size: 16))
|
||||
.foregroundStyle(.primary)
|
||||
.frame(width: 18, height: 18)
|
||||
VStack(spacing: 5) {
|
||||
RuntimeStatusDot(tone: statusDisplay.agent.row.tone, diameter: 4)
|
||||
RuntimeStatusDot(tone: statusDisplay.systemProxy.row.tone, diameter: 4)
|
||||
if showStatusBarRuntimeDots {
|
||||
VStack(spacing: 5) {
|
||||
RuntimeStatusDot(tone: statusDisplay.agent.row.tone, diameter: 4)
|
||||
RuntimeStatusDot(tone: statusDisplay.systemProxy.row.tone, diameter: 4)
|
||||
}
|
||||
}
|
||||
}
|
||||
.environment(\.colorScheme, colorScheme))
|
||||
|
||||
Reference in New Issue
Block a user