Fix actions button on macOS

This commit is contained in:
Thomas Ricouard 2024-01-27 10:31:25 +01:00
parent 9cf16b2f30
commit 9dfd9c27c7

View file

@ -141,8 +141,12 @@ struct StatusRowActionsView: View {
case .linkOnly: case .linkOnly:
ShareLink(item: url) { ShareLink(item: url) {
action.image(dataController: statusDataController) action.image(dataController: statusDataController)
#if targetEnvironment(macCatalyst)
.font(.scaledBody)
#else
.font(.body) .font(.body)
.dynamicTypeSize(.medium) .dynamicTypeSize(.medium)
#endif
} }
.padding(.vertical, 6) .padding(.vertical, 6)
.padding(.horizontal, 8) .padding(.horizontal, 8)
@ -160,8 +164,12 @@ struct StatusRowActionsView: View {
message: Text(viewModel.finalStatus.content.asRawText)) message: Text(viewModel.finalStatus.content.asRawText))
{ {
action.image(dataController: statusDataController) action.image(dataController: statusDataController)
#if targetEnvironment(macCatalyst)
.font(.scaledBody)
#else
.font(.body) .font(.body)
.dynamicTypeSize(.medium) .dynamicTypeSize(.medium)
#endif
} }
.padding(.vertical, 6) .padding(.vertical, 6)
.padding(.horizontal, 8) .padding(.horizontal, 8)
@ -215,14 +223,22 @@ struct StatusRowActionsView: View {
action action
.image(dataController: statusDataController, privateBoost: privateBoost()) .image(dataController: statusDataController, privateBoost: privateBoost())
.imageScale(.medium) .imageScale(.medium)
.font(.body)
.fontWeight(.black) .fontWeight(.black)
#if targetEnvironment(macCatalyst)
.font(.scaledBody)
#else
.font(.body)
.dynamicTypeSize(.medium) .dynamicTypeSize(.medium)
#endif
} else { } else {
action action
.image(dataController: statusDataController, privateBoost: privateBoost()) .image(dataController: statusDataController, privateBoost: privateBoost())
#if targetEnvironment(macCatalyst)
.font(.scaledBody)
#else
.font(.body) .font(.body)
.dynamicTypeSize(.medium) .dynamicTypeSize(.medium)
#endif
} }
if !isNarrow, if !isNarrow,
let count = action.count(dataController: statusDataController, let count = action.count(dataController: statusDataController,
@ -234,8 +250,12 @@ struct StatusRowActionsView: View {
.minimumScaleFactor(0.6) .minimumScaleFactor(0.6)
.contentTransition(.numericText(value: Double(count))) .contentTransition(.numericText(value: Double(count)))
.foregroundColor(Color(UIColor.secondaryLabel)) .foregroundColor(Color(UIColor.secondaryLabel))
#if targetEnvironment(macCatalyst)
.font(.scaledFootnote)
#else
.font(.footnote) .font(.footnote)
.dynamicTypeSize(.small) .dynamicTypeSize(.small)
#endif
.monospacedDigit() .monospacedDigit()
.opacity(count > 0 ? 1 : 0) .opacity(count > 0 ? 1 : 0)
} }