style: check for updates button hover uses brand lime color

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
徐翔宇 2026-04-15 18:09:08 +08:00
parent 5cfb500ea8
commit 952a9ebaae

View file

@ -673,26 +673,7 @@ private struct AboutTab: View {
}
}
SettingsCard {
Button {
updater.checkForUpdates()
} label: {
HStack(spacing: 8) {
Image(systemName: "arrow.triangle.2.circlepath")
.font(.system(size: 12))
Text(L10n.checkForUpdates)
.font(.system(size: 12, weight: .semibold))
Spacer()
Image(systemName: "chevron.right")
.font(.system(size: 9, weight: .semibold))
.opacity(0.4)
}
.foregroundColor(Theme.detailText.opacity(0.9))
}
.buttonStyle(.plain)
.disabled(!updater.canCheckForUpdates)
.opacity(updater.canCheckForUpdates ? 1.0 : 0.5)
}
CheckForUpdatesCard(updater: updater)
SettingsCard {
HStack(spacing: 8) {
@ -814,6 +795,39 @@ private struct AboutTab: View {
}
}
// MARK: - Check for Updates card (with hover)
private struct CheckForUpdatesCard: View {
@ObservedObject var updater: UpdaterManager
@State private var isHovered = false
private let brandLime = Color(red: 0xCA/255, green: 0xFF/255, blue: 0x00/255)
var body: some View {
SettingsCard {
Button {
updater.checkForUpdates()
} label: {
HStack(spacing: 8) {
Image(systemName: "arrow.triangle.2.circlepath")
.font(.system(size: 12))
Text(L10n.checkForUpdates)
.font(.system(size: 12, weight: .semibold))
Spacer()
Image(systemName: "chevron.right")
.font(.system(size: 9, weight: .semibold))
.opacity(0.4)
}
.foregroundColor(isHovered ? brandLime : Theme.detailText.opacity(0.9))
}
.buttonStyle(.plain)
.disabled(!updater.canCheckForUpdates)
.opacity(updater.canCheckForUpdates ? 1.0 : 0.5)
.onHover { isHovered = $0 }
}
}
}
// MARK: - cmux Connection tab
/// Phone terminal relay diagnostics. Replaces the invisible failure modes