From be02b2ea760360bdb2eda7b24cec8da7e14ae55d Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Mon, 22 Jul 2024 08:28:42 +0200 Subject: [PATCH] Fix toolbar --- IceCubesApp/App/Tabs/ToolbarTab.swift | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/IceCubesApp/App/Tabs/ToolbarTab.swift b/IceCubesApp/App/Tabs/ToolbarTab.swift index e28fdd17..2e8087b2 100644 --- a/IceCubesApp/App/Tabs/ToolbarTab.swift +++ b/IceCubesApp/App/Tabs/ToolbarTab.swift @@ -15,17 +15,19 @@ struct ToolbarTab: ToolbarContent { var body: some ToolbarContent { if !isSecondaryColumn { - ToolbarItem(placement: .topBarLeading) { - if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac { - Button { - withAnimation { - userPreferences.isSidebarExpanded.toggle() - } - } label: { - if userPreferences.isSidebarExpanded { - Image(systemName: "sidebar.squares.left") - } else { - Image(systemName: "sidebar.left") + if horizontalSizeClass == .regular { + ToolbarItem(placement: .topBarLeading) { + if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac { + Button { + withAnimation { + userPreferences.isSidebarExpanded.toggle() + } + } label: { + if userPreferences.isSidebarExpanded { + Image(systemName: "sidebar.squares.left") + } else { + Image(systemName: "sidebar.left") + } } } }