mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-26 10:11:00 +00:00
Fix sensitive content transition
This commit is contained in:
parent
a85c701f50
commit
9b70519798
1 changed files with 8 additions and 10 deletions
|
@ -275,7 +275,6 @@ struct BlurOverLay: View {
|
||||||
let font: Font?
|
let font: Font?
|
||||||
|
|
||||||
@State private var isFrameExpanded = true
|
@State private var isFrameExpanded = true
|
||||||
@State private var isTextExpanded = true
|
|
||||||
|
|
||||||
@Environment(Theme.self) private var theme
|
@Environment(Theme.self) private var theme
|
||||||
@Environment(\.isInCaptureMode) private var isInCaptureMode: Bool
|
@Environment(\.isInCaptureMode) private var isInCaptureMode: Bool
|
||||||
|
@ -296,32 +295,31 @@ struct BlurOverLay: View {
|
||||||
)
|
)
|
||||||
if !isCompact {
|
if !isCompact {
|
||||||
Button {
|
Button {
|
||||||
withAnimation(.spring(duration: 0.2)) {
|
withAnimation(.spring) {
|
||||||
isTextExpanded.toggle()
|
isFrameExpanded.toggle()
|
||||||
} completion: {
|
|
||||||
withAnimation(.spring(duration: 0.3)) {
|
|
||||||
isFrameExpanded.toggle()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} label: {
|
} label: {
|
||||||
if isTextExpanded {
|
if isFrameExpanded {
|
||||||
ViewThatFits(in: .horizontal) {
|
ViewThatFits(in: .horizontal) {
|
||||||
HStack {
|
HStack {
|
||||||
Image(systemName: "eye")
|
Image(systemName: "eye")
|
||||||
|
.matchedGeometryEffect(id: "eye", in: buttonSpace)
|
||||||
Text(sensitive ? "status.media.sensitive.show" : "status.media.content.show")
|
Text(sensitive ? "status.media.sensitive.show" : "status.media.content.show")
|
||||||
}
|
}
|
||||||
HStack {
|
HStack {
|
||||||
Image(systemName: "eye")
|
Image(systemName: "eye")
|
||||||
|
.matchedGeometryEffect(id: "eye", in: buttonSpace)
|
||||||
Text("Show")
|
Text("Show")
|
||||||
}
|
}
|
||||||
Image(systemName: "eye")
|
Image(systemName: "eye")
|
||||||
|
.matchedGeometryEffect(id: "eye", in: buttonSpace)
|
||||||
}
|
}
|
||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
.foregroundColor(theme.labelColor)
|
.foregroundColor(theme.labelColor)
|
||||||
.matchedGeometryEffect(id: "text", in: buttonSpace)
|
|
||||||
} else {
|
} else {
|
||||||
Image(systemName: "eye.slash")
|
Image(systemName: "eye.slash")
|
||||||
.matchedGeometryEffect(id: "text", in: buttonSpace)
|
.transition(.opacity)
|
||||||
|
.matchedGeometryEffect(id: "eye", in: buttonSpace)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.foregroundColor(theme.labelColor)
|
.foregroundColor(theme.labelColor)
|
||||||
|
|
Loading…
Reference in a new issue