From 000567a8bb6dedb214288c6ee13a965e1f32d62b Mon Sep 17 00:00:00 2001 From: JOJO <1498581755@qq.com> Date: Tue, 5 May 2026 21:50:19 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20=E5=8F=8D=E8=BD=AC=E8=A1=8C?= =?UTF-8?q?=E5=8F=B7=20stepper=EF=BC=9A+=E4=B8=8A=E7=A7=BB=20-=E4=B8=8B?= =?UTF-8?q?=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/FloatingMonitor/Views/SettingsView.swift | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Sources/FloatingMonitor/Views/SettingsView.swift b/Sources/FloatingMonitor/Views/SettingsView.swift index 729ce19..3c93c99 100644 --- a/Sources/FloatingMonitor/Views/SettingsView.swift +++ b/Sources/FloatingMonitor/Views/SettingsView.swift @@ -121,11 +121,17 @@ struct SettingsView: View { .font(.system(size: 11)) .frame(width: 26, alignment: .leading) - // 行号 stepper - Stepper("", value: row, in: 1...10) - .labelsHidden() - .scaleEffect(0.7) - .frame(width: 24) + // 行号 stepper(+向上 -向下) + Stepper { + Text("") + } onIncrement: { + if row.wrappedValue > 1 { row.wrappedValue -= 1 } + } onDecrement: { + if row.wrappedValue < 10 { row.wrappedValue += 1 } + } + .labelsHidden() + .scaleEffect(0.7) + .frame(width: 24) Text("\(row.wrappedValue)") .font(.system(size: 11, design: .monospaced)) .foregroundColor(.secondary)