Fix buttons touch zone

This commit is contained in:
Thomas Ricouard 2024-01-22 21:20:43 +01:00
parent 62eeba5334
commit 245d35db82
4 changed files with 11 additions and 9 deletions

View file

@ -1208,7 +1208,7 @@
INFOPLIST_FILE = IceCubesApp/Info.plist; INFOPLIST_FILE = IceCubesApp/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Ice Cubes"; INFOPLIST_KEY_CFBundleDisplayName = "Ice Cubes";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking";
INFOPLIST_KEY_NSCameraUsageDescription = "Upload photos & videos to Mastodon"; INFOPLIST_KEY_NSCameraUsageDescription = "Upload photos & videos to attach to your Mastodon posts.";
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Upload photos & videos to Mastodon"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Upload photos & videos to Mastodon";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
@ -1262,7 +1262,7 @@
INFOPLIST_FILE = IceCubesApp/Info.plist; INFOPLIST_FILE = IceCubesApp/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Ice Cubes"; INFOPLIST_KEY_CFBundleDisplayName = "Ice Cubes";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking"; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking";
INFOPLIST_KEY_NSCameraUsageDescription = "Upload photos & videos to Mastodon"; INFOPLIST_KEY_NSCameraUsageDescription = "Upload photos & videos to attach to your Mastodon posts.";
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Upload photos & videos to Mastodon"; INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Upload photos & videos to Mastodon";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;

View file

@ -119,9 +119,9 @@ public final class Status: AnyStatus, Codable, Identifiable, Equatable, Hashable
reblog: nil, reblog: nil,
mediaAttachments: [], mediaAttachments: [],
mentions: [], mentions: [],
repliesCount: 0, repliesCount: 34,
reblogsCount: 0, reblogsCount: 8,
favouritesCount: 0, favouritesCount: 150,
card: nil, card: nil,
favourited: false, favourited: false,
reblogged: false, reblogged: false,

View file

@ -35,7 +35,6 @@ struct StatusActionButtonStyle: ButtonStyle {
sparklesCounter += 1 sparklesCounter += 1
} }
} }
.contentShape(Rectangle())
} }
func brightness(configuration: Configuration) -> Double { func brightness(configuration: Configuration) -> Double {

View file

@ -144,11 +144,12 @@ struct StatusRowActionsView: View {
.font(.scaledBody) .font(.scaledBody)
} }
.padding(.vertical, 6) .padding(.vertical, 6)
.padding(.trailing, 8) .padding(.horizontal, 8)
#if os(visionOS) #if os(visionOS)
.buttonStyle(.borderless) .buttonStyle(.borderless)
#else #else
.buttonStyle(.statusAction()) .buttonStyle(.statusAction())
.offset(x: -8)
#endif #endif
.accessibilityElement(children: .combine) .accessibilityElement(children: .combine)
.accessibilityLabel("status.action.share-link") .accessibilityLabel("status.action.share-link")
@ -161,11 +162,12 @@ struct StatusRowActionsView: View {
.font(.scaledBody) .font(.scaledBody)
} }
.padding(.vertical, 6) .padding(.vertical, 6)
.padding(.trailing, 8) .padding(.horizontal, 8)
#if os(visionOS) #if os(visionOS)
.buttonStyle(.borderless) .buttonStyle(.borderless)
#else #else
.buttonStyle(.statusAction()) .buttonStyle(.statusAction())
.offset(x: -8)
#endif #endif
.accessibilityElement(children: .combine) .accessibilityElement(children: .combine)
.accessibilityLabel("status.action.share-link") .accessibilityLabel("status.action.share-link")
@ -234,7 +236,7 @@ struct StatusRowActionsView: View {
} }
} }
.padding(.vertical, 6) .padding(.vertical, 6)
.padding(.trailing, 8) .padding(.horizontal, 8)
.contentShape(Rectangle()) .contentShape(Rectangle())
} }
#if os(visionOS) #if os(visionOS)
@ -246,6 +248,7 @@ struct StatusRowActionsView: View {
tintColor: action.tintColor(theme: theme) tintColor: action.tintColor(theme: theme)
) )
) )
.offset(x: -8)
#endif #endif
.disabled(action == .boost && .disabled(action == .boost &&
(viewModel.status.visibility == .direct || viewModel.status.visibility == .priv && viewModel.status.account.id != currentAccount.account?.id)) (viewModel.status.visibility == .direct || viewModel.status.visibility == .priv && viewModel.status.account.id != currentAccount.account?.id))