From cf8c6f5e8e520bf33a9132346da4f2d1832938d3 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 21 Jul 2020 17:40:51 -0500 Subject: [PATCH] Layout sidebar items differently on macOS and iOS due to rendering differences in the platforms --- .../Shared/Sidebar/SidebarItemView.swift | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/Multiplatform/Shared/Sidebar/SidebarItemView.swift b/Multiplatform/Shared/Sidebar/SidebarItemView.swift index 8ffd03553..82f94c536 100644 --- a/Multiplatform/Shared/Sidebar/SidebarItemView.swift +++ b/Multiplatform/Shared/Sidebar/SidebarItemView.swift @@ -16,17 +16,31 @@ struct SidebarItemView: View { var sidebarItem: SidebarItem var body: some View { - HStack(alignment: .top) { - if let image = feedIconImageLoader.image { - IconImageView(iconImage: image) - .frame(width: 20, height: 20, alignment: .center) + HStack { + #if os(macOS) + HStack { + if let image = feedIconImageLoader.image { + IconImageView(iconImage: image) + .frame(width: 20, height: 20, alignment: .center) + } + Text(verbatim: sidebarItem.nameForDisplay) + Spacer() + if sidebarItem.unreadCount > 0 { + UnreadCountView(count: sidebarItem.unreadCount) + } + } + #else + HStack(alignment: .top) { + if let image = feedIconImageLoader.image { + IconImageView(iconImage: image) + .frame(width: 20, height: 20) + } + Text(verbatim: sidebarItem.nameForDisplay) } - Text(verbatim: sidebarItem.nameForDisplay) Spacer() if sidebarItem.unreadCount > 0 { UnreadCountView(count: sidebarItem.unreadCount) } - #if os(iOS) if sidebarItem.representedType == .webFeed || sidebarItem.representedType == .pseudoFeed { Spacer() .frame(width: 16)