Fix permission UI layout jumping and center footer text

- Added fixed height and padding to "Granted" labels to match button sizes
- Prevents layout jumping when transitioning between button and granted state
- Small buttons use height 22px, large buttons use height 38px
- Centered the footer text in DashboardSettingsView permissions section
- Consistent visual appearance across all permission UI elements
This commit is contained in:
Peter Steinberger 2025-06-17 23:03:00 +02:00
parent 322658d9a9
commit 30e8b86f27
2 changed files with 14 additions and 0 deletions

View file

@ -854,6 +854,9 @@ private struct PermissionsSection: View {
.foregroundColor(.secondary)
}
.font(.caption)
.padding(.horizontal, 10)
.padding(.vertical, 2)
.frame(height: 22) // Match small button height
} else {
Button("Grant Permission") {
appleScriptManager.requestPermission()
@ -885,6 +888,9 @@ private struct PermissionsSection: View {
.foregroundColor(.secondary)
}
.font(.caption)
.padding(.horizontal, 10)
.padding(.vertical, 2)
.frame(height: 22) // Match small button height
} else {
Button("Grant Permission") {
AccessibilityPermissionManager.shared.requestPermission()
@ -900,6 +906,8 @@ private struct PermissionsSection: View {
} footer: {
Text("Terminal automation is required for all terminals. Accessibility is only needed for terminals that simulate keyboard input.")
.font(.caption)
.frame(maxWidth: .infinity)
.multilineTextAlignment(.center)
}
.task {
_ = await appleScriptManager.checkPermission()

View file

@ -280,6 +280,9 @@ private struct RequestPermissionsPageView: View {
.foregroundColor(.secondary)
}
.font(.body)
.padding(.horizontal, 16)
.padding(.vertical, 8)
.frame(height: 38) // Match large button height
} else {
Button("Grant Automation Permission") {
appleScriptManager.requestPermission()
@ -297,6 +300,9 @@ private struct RequestPermissionsPageView: View {
.foregroundColor(.secondary)
}
.font(.body)
.padding(.horizontal, 16)
.padding(.vertical, 8)
.frame(height: 38) // Match large button height
} else {
Button("Grant Accessibility Permission") {
AccessibilityPermissionManager.shared.requestPermission()