mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-02-23 13:06:16 +00:00
Make status action button areas bigger
This commit is contained in:
parent
f6b7b9807f
commit
f699c33dfb
1 changed files with 24 additions and 25 deletions
|
@ -189,44 +189,43 @@ struct StatusRowActionsView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func actionButton(action: Action) -> some View {
|
private func actionButton(action: Action) -> some View {
|
||||||
HStack(spacing: 2) {
|
Button {
|
||||||
Button {
|
handleAction(action: action)
|
||||||
handleAction(action: action)
|
} label: {
|
||||||
} label: {
|
HStack(spacing: 2) {
|
||||||
if action == .boost {
|
if action == .boost {
|
||||||
action
|
action
|
||||||
.image(dataController: statusDataController, privateBoost: privateBoost())
|
.image(dataController: statusDataController, privateBoost: privateBoost())
|
||||||
.imageScale(.medium)
|
.imageScale(.medium)
|
||||||
.font(.scaledBody)
|
.font(.scaledBody)
|
||||||
.fontWeight(.black)
|
.fontWeight(.black)
|
||||||
.contentShape(Rectangle())
|
|
||||||
} else {
|
} else {
|
||||||
action
|
action
|
||||||
.image(dataController: statusDataController, privateBoost: privateBoost())
|
.image(dataController: statusDataController, privateBoost: privateBoost())
|
||||||
.font(.scaledBody)
|
.font(.scaledBody)
|
||||||
.contentShape(Rectangle())
|
}
|
||||||
|
if !isNarrow,
|
||||||
|
let count = action.count(dataController: statusDataController,
|
||||||
|
isFocused: isFocused,
|
||||||
|
theme: theme), !viewModel.isRemote
|
||||||
|
{
|
||||||
|
Text("\(count)")
|
||||||
|
.contentTransition(.numericText(value: Double(count)))
|
||||||
|
.foregroundColor(Color(UIColor.secondaryLabel))
|
||||||
|
.font(.scaledFootnote)
|
||||||
|
.monospacedDigit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.buttonStyle(
|
.contentShape(Rectangle())
|
||||||
.statusAction(
|
|
||||||
isOn: action.isOn(dataController: statusDataController),
|
|
||||||
tintColor: action.tintColor(theme: theme)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.disabled(action == .boost &&
|
|
||||||
(viewModel.status.visibility == .direct || viewModel.status.visibility == .priv && viewModel.status.account.id != currentAccount.account?.id))
|
|
||||||
if !isNarrow,
|
|
||||||
let count = action.count(dataController: statusDataController,
|
|
||||||
isFocused: isFocused,
|
|
||||||
theme: theme), !viewModel.isRemote
|
|
||||||
{
|
|
||||||
Text("\(count)")
|
|
||||||
.contentTransition(.numericText(value: Double(count)))
|
|
||||||
.foregroundColor(Color(UIColor.secondaryLabel))
|
|
||||||
.font(.scaledFootnote)
|
|
||||||
.monospacedDigit()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
.buttonStyle(
|
||||||
|
.statusAction(
|
||||||
|
isOn: action.isOn(dataController: statusDataController),
|
||||||
|
tintColor: action.tintColor(theme: theme)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.disabled(action == .boost &&
|
||||||
|
(viewModel.status.visibility == .direct || viewModel.status.visibility == .priv && viewModel.status.account.id != currentAccount.account?.id))
|
||||||
.accessibilityElement(children: .combine)
|
.accessibilityElement(children: .combine)
|
||||||
.accessibilityLabel(action.accessibilityLabel(dataController: statusDataController, privateBoost: privateBoost()))
|
.accessibilityLabel(action.accessibilityLabel(dataController: statusDataController, privateBoost: privateBoost()))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue