mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Fix toggling full screen details
This commit is contained in:
@@ -42,7 +42,7 @@ struct BrowserPlayerControls<Content: View, Toolbar: View>: View {
|
||||
toolbar
|
||||
.borderTop(height: 0.4, color: Color("ControlsBorderColor"))
|
||||
.modifier(ControlBackgroundModifier())
|
||||
ControlsBar()
|
||||
ControlsBar(fullScreen: .constant(false))
|
||||
.edgesIgnoringSafeArea(.bottom)
|
||||
}
|
||||
#endif
|
||||
|
@@ -19,6 +19,9 @@ struct ControlsBar: View {
|
||||
var borderTop = true
|
||||
var borderBottom = true
|
||||
var detailsTogglePlayer = true
|
||||
var detailsToggleFullScreen = false
|
||||
|
||||
@Binding var fullScreen: Bool
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 0) {
|
||||
@@ -55,6 +58,16 @@ struct ControlsBar: View {
|
||||
details
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
} else if detailsToggleFullScreen {
|
||||
Button {
|
||||
withAnimation {
|
||||
fullScreen.toggle()
|
||||
}
|
||||
} label: {
|
||||
details
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
.keyboardShortcut("t")
|
||||
} else {
|
||||
details
|
||||
}
|
||||
@@ -250,7 +263,7 @@ struct ControlsBar: View {
|
||||
|
||||
struct ControlsBar_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ControlsBar()
|
||||
ControlsBar(fullScreen: .constant(false))
|
||||
.injectFixtureEnvironmentObjects()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user