ui issue on create widget view
This commit is contained in:
Trey t
2022-03-28 09:47:29 -05:00
parent 544d4821be
commit 834095fd29

View File

@@ -98,7 +98,6 @@ struct CreateWidgetView: View {
} }
var bottomBarButtons: some View { var bottomBarButtons: some View {
Group {
HStack(alignment: .center, spacing: 0) { HStack(alignment: .center, spacing: 0) {
Button(action: { Button(action: {
EventLogger.log(event: "create_widget_view_shuffle") EventLogger.log(event: "create_widget_view_shuffle")
@@ -110,7 +109,7 @@ struct CreateWidgetView: View {
}) })
.frame(minWidth: 0, maxWidth: .infinity) .frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 40) .frame(minHeight: 40, maxHeight: .infinity)
.background(.blue) .background(.blue)
Button(action: { Button(action: {
@@ -127,7 +126,7 @@ struct CreateWidgetView: View {
}) })
.frame(minWidth: 0, maxWidth: .infinity) .frame(minWidth: 0, maxWidth: .infinity)
.frame(height: 40) .frame(minHeight: 40, maxHeight: .infinity)
.background(.green) .background(.green)
Button(action: { Button(action: {
@@ -143,8 +142,8 @@ struct CreateWidgetView: View {
.foregroundColor(Color(UIColor.white)) .foregroundColor(Color(UIColor.white))
}) })
.frame(height: 40)
.frame(minWidth: 0, maxWidth: .infinity) .frame(minWidth: 0, maxWidth: .infinity)
.frame(minHeight: 40, maxHeight: .infinity)
.background(.pink) .background(.pink)
if customWidget.isSaved { if customWidget.isSaved {
@@ -160,16 +159,15 @@ struct CreateWidgetView: View {
.foregroundColor(Color(UIColor.white)) .foregroundColor(Color(UIColor.white))
}) })
.frame(height: 40)
.frame(minWidth: 0, maxWidth: .infinity) .frame(minWidth: 0, maxWidth: .infinity)
.frame(minHeight: 40, maxHeight: .infinity)
.background(.orange) .background(.orange)
} }
} }
} .frame(minHeight: 40, maxHeight: .infinity)
} }
var colorOptions: some View { var colorOptions: some View {
Group {
VStack { VStack {
HStack(spacing: 0) { HStack(spacing: 0) {
VStack(alignment: .center) { VStack(alignment: .center) {
@@ -235,15 +233,14 @@ struct CreateWidgetView: View {
.frame(minWidth: 0, maxWidth: .infinity) .frame(minWidth: 0, maxWidth: .infinity)
} }
} }
.multilineTextAlignment(.center)
.padding() .padding()
.background( .background(
theme.currentTheme.secondaryBGColor theme.currentTheme.secondaryBGColor
) )
} }
}
var bgImageOptions: some View { var bgImageOptions: some View {
Group {
HStack { HStack {
ForEach(CustomWidgetBackGroundOptions.selectable, id: \.self) { bg in ForEach(CustomWidgetBackGroundOptions.selectable, id: \.self) { bg in
Image(bg.rawValue, bundle: .main) Image(bg.rawValue, bundle: .main)
@@ -260,7 +257,7 @@ struct CreateWidgetView: View {
.onTapGesture { .onTapGesture {
update(background: .random) update(background: .random)
} }
Divider()
ColorPicker("", selection: $customWidget.bgOverlayColor) ColorPicker("", selection: $customWidget.bgOverlayColor)
} }
.padding() .padding()
@@ -268,54 +265,49 @@ struct CreateWidgetView: View {
theme.currentTheme.secondaryBGColor theme.currentTheme.secondaryBGColor
) )
} }
}
var faceImageOptions: some View { var faceImageOptions: some View {
Group {
HStack(alignment: .center) { HStack(alignment: .center) {
Spacer()
VStack(alignment: .center) {
Text(String(localized: "create_widget_view_left_eye")) Text(String(localized: "create_widget_view_left_eye"))
.onTapGesture(perform: { .onTapGesture(perform: {
showLeftEyeImagePicker.toggle() showLeftEyeImagePicker.toggle()
}) })
.foregroundColor(textColor) .foregroundColor(textColor)
.foregroundColor(textColor) .foregroundColor(textColor)
} .frame(minWidth: 0, maxWidth: .infinity)
Spacer() Divider()
VStack(alignment: .center) {
Text(String(localized: "create_widget_view_right_eye")) Text(String(localized: "create_widget_view_right_eye"))
.onTapGesture(perform: { .onTapGesture(perform: {
showRightEyeImagePicker.toggle() showRightEyeImagePicker.toggle()
}) })
.foregroundColor(textColor) .foregroundColor(textColor)
} .frame(minWidth: 0, maxWidth: .infinity)
Spacer() Divider()
VStack(alignment: .center) {
Text(String(localized: "create_widget_view_mouth")) Text(String(localized: "create_widget_view_mouth"))
.onTapGesture(perform: { .onTapGesture(perform: {
showMuthImagePicker.toggle() showMuthImagePicker.toggle()
}) })
.foregroundColor(textColor) .foregroundColor(textColor)
.foregroundColor(textColor) .foregroundColor(textColor)
} .frame(minWidth: 0, maxWidth: .infinity)
Spacer()
} }
.padding() .padding()
.background( .background(
theme.currentTheme.secondaryBGColor theme.currentTheme.secondaryBGColor
) )
} }
}
var body: some View { var body: some View {
GeometryReader { geo in
VStack(spacing: 0) { VStack(spacing: 0) {
widgetView widgetView
.cornerRadius(10) .cornerRadius(10)
.padding() .padding()
.frame(width: geo.size.width, height: geo.size.width)
Spacer() Spacer()
ScrollView {
VStack(spacing: 0) {
Divider().background(Color(UIColor.tertiarySystemBackground)) Divider().background(Color(UIColor.tertiarySystemBackground))
faceImageOptions faceImageOptions
@@ -332,6 +324,9 @@ struct CreateWidgetView: View {
bottomBarButtons bottomBarButtons
} }
}
}
}
.sheet(isPresented: $showRightEyeImagePicker) { .sheet(isPresented: $showRightEyeImagePicker) {
ImagePickerGridView(pickedImageClosure: { image in ImagePickerGridView(pickedImageClosure: { image in
update(eye: .right, eyeOption: image) update(eye: .right, eyeOption: image)