From f1b81a3e5c454ee0ba6a4c0926416a70d4f72058 Mon Sep 17 00:00:00 2001 From: askeew Date: Mon, 8 Dec 2025 21:43:34 +0100 Subject: [PATCH] Fix center alignment and larger hit test area for Timeline switcher Changelog-None Signed-off-by: Askeew --- .../Views/PostingTimelineSwitcherView.swift | 16 +++++++++------- .../Timeline/Views/PostingTimelineView.swift | 6 +++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/damus/Features/Timeline/Views/PostingTimelineSwitcherView.swift b/damus/Features/Timeline/Views/PostingTimelineSwitcherView.swift index cfdea909..aa27900f 100644 --- a/damus/Features/Timeline/Views/PostingTimelineSwitcherView.swift +++ b/damus/Features/Timeline/Views/PostingTimelineSwitcherView.swift @@ -36,10 +36,9 @@ struct PostingTimelineSwitcherView: View { } } } label: { - Image(systemName: "square.stack") - .foregroundColor(DamusColors.purple) - .frame(height: 35) + Color.clear } + .frame(width: 50, height: 35) .menuOrder(.fixed) .accessibilityLabel(NSLocalizedString("Timeline switcher, select \(TimelineSource.follows.description) or \(TimelineSource.favorites.description)", comment: "Accessibility label for the timeline switcher button at the topbar")) } @@ -68,10 +67,13 @@ struct PostingTimelineSwitcherView: View { struct PostingTimelineSwitcherView_Previews: PreviewProvider { static var previews: some View { - PostingTimelineSwitcherView( - damusState: test_damus_state, - timelineSource: .constant(.follows) - ) + VStack { + PostingTimelineSwitcherView( + damusState: test_damus_state, + timelineSource: .constant(.follows) + ) + Spacer() + } } } diff --git a/damus/Features/Timeline/Views/PostingTimelineView.swift b/damus/Features/Timeline/Views/PostingTimelineView.swift index 26572234..461adf1f 100644 --- a/damus/Features/Timeline/Views/PostingTimelineView.swift +++ b/damus/Features/Timeline/Views/PostingTimelineView.swift @@ -64,7 +64,7 @@ struct PostingTimelineView: View { HStack {} .frame(height: getSafeAreaTop()) - HStack(alignment: .top) { + HStack(alignment: .center) { TopbarSideMenuButton(damus_state: damus_state, isSideBarOpened: $isSideBarOpened) Spacer() @@ -77,8 +77,12 @@ struct PostingTimelineView: View { timelineSource: $timeline_source ) if #available(iOS 17.0, *) { + Image(systemName: "square.stack") + .foregroundColor(DamusColors.purple) + .overlay( switchView .popoverTip(PostingTimelineSwitcherView.TimelineSwitcherTip.shared) + ) } else { switchView }