Fix toolbar

This commit is contained in:
Thomas Ricouard 2024-07-22 08:28:42 +02:00
parent a3326c3fc2
commit be02b2ea76
1 changed files with 13 additions and 11 deletions

View File

@ -15,17 +15,19 @@ struct ToolbarTab: ToolbarContent {
var body: some ToolbarContent { var body: some ToolbarContent {
if !isSecondaryColumn { if !isSecondaryColumn {
ToolbarItem(placement: .topBarLeading) { if horizontalSizeClass == .regular {
if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac { ToolbarItem(placement: .topBarLeading) {
Button { if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac {
withAnimation { Button {
userPreferences.isSidebarExpanded.toggle() withAnimation {
} userPreferences.isSidebarExpanded.toggle()
} label: { }
if userPreferences.isSidebarExpanded { } label: {
Image(systemName: "sidebar.squares.left") if userPreferences.isSidebarExpanded {
} else { Image(systemName: "sidebar.squares.left")
Image(systemName: "sidebar.left") } else {
Image(systemName: "sidebar.left")
}
} }
} }
} }