big u/i restructures - still ugly
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 26.0, *)
|
||||
struct RerollPickerView: View {
|
||||
@EnvironmentObject var current: Roll
|
||||
@Binding var mode: RerollMode
|
||||
@@ -24,30 +23,18 @@ struct RerollPickerView: View {
|
||||
)
|
||||
HStack(spacing: 8) {
|
||||
Text("Reroll")
|
||||
HStack(spacing: 6) {
|
||||
Picker("Reroll", selection: actionBinding) {
|
||||
ForEach(RerollMode.allCases, id: \.self) { m in
|
||||
let isSelected = mode == m
|
||||
Button(action: { actionBinding.wrappedValue = m }) {
|
||||
Text(m.label)
|
||||
.fontWeight(isSelected ? .semibold : .regular)
|
||||
.padding(.horizontal, 12)
|
||||
.padding(.vertical, 6)
|
||||
.foregroundColor(isSelected ? Color(UIColor.systemBackground) : .primary)
|
||||
.background(isSelected ? Color.green : Color.gray)
|
||||
.clipShape(Capsule())
|
||||
.overlay(Capsule().stroke(Color.primary, lineWidth: 1))
|
||||
.glassEffect()
|
||||
}
|
||||
Text(m.label).tag(m)
|
||||
}
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
}
|
||||
.padding(.horizontal)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
if #available(iOS 26.0, *) {
|
||||
RerollPickerView(mode: .constant(.none))
|
||||
.environmentObject(Roll())
|
||||
}
|
||||
RerollPickerView(mode: .constant(.none))
|
||||
.environmentObject(Roll())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user