mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-17 13:21:44 +00:00
* style: apply SwiftFormat 0.62.1 rules Refs #103202 * ci: enforce deterministic Swift lint Refs #103202 * refactor: keep gateway connect lint-clean Refs #103202 * style: keep iOS typography checks warning-free * ci: route MLX Swift changes through pre-push * fix: preserve native i18n extraction after Swift cleanup * refactor: keep rebased Swift surfaces lint-clean * style: format latest Swift additions * chore: refresh native i18n inventory * style: keep generated Swift formatter-clean * fix: preserve node route invalidation callbacks * fix: keep native translation IDs stable * fix: retain native translation identifiers * fix: preserve translations across Swift source moves
44 lines
1.4 KiB
Swift
44 lines
1.4 KiB
Swift
import SwiftUI
|
|
|
|
struct SelectionStateIndicator: View {
|
|
let selected: Bool
|
|
|
|
var body: some View {
|
|
if self.selected {
|
|
Image(systemName: "checkmark.circle.fill")
|
|
.foregroundStyle(Color.accentColor)
|
|
} else {
|
|
Image(systemName: "arrow.right.circle")
|
|
.foregroundStyle(.secondary)
|
|
}
|
|
}
|
|
}
|
|
|
|
extension View {
|
|
func openClawSelectableRowChrome(selected: Bool, hovered: Bool = false) -> some View {
|
|
self
|
|
.padding(.horizontal, 10)
|
|
.padding(.vertical, 8)
|
|
.frame(maxWidth: .infinity, alignment: .leading)
|
|
.background(
|
|
RoundedRectangle(cornerRadius: 10, style: .continuous)
|
|
.fill(self.openClawRowBackground(selected: selected, hovered: hovered)))
|
|
.contentShape(RoundedRectangle(cornerRadius: 10, style: .continuous))
|
|
.overlay(
|
|
RoundedRectangle(cornerRadius: 10, style: .continuous)
|
|
.strokeBorder(
|
|
selected ? Color.accentColor.opacity(0.45) : Color.clear,
|
|
lineWidth: 1))
|
|
}
|
|
|
|
private func openClawRowBackground(selected: Bool, hovered: Bool) -> Color {
|
|
if selected {
|
|
return Color.accentColor.opacity(0.12)
|
|
}
|
|
if hovered {
|
|
return Color.secondary.opacity(0.08)
|
|
}
|
|
return Color.clear
|
|
}
|
|
}
|