Size tweaks

This commit is contained in:
Peter Steinberger 2025-06-17 13:51:42 +02:00
parent 9d35443f7f
commit 513e0dc3a0
2 changed files with 14 additions and 23 deletions

View file

@ -13,11 +13,11 @@ struct SettingsView: View {
/// Define ideal sizes for each tab /// Define ideal sizes for each tab
private let tabSizes: [SettingsTab: CGSize] = [ private let tabSizes: [SettingsTab: CGSize] = [
.general: CGSize(width: 500, height: 520), .general: CGSize(width: 500, height: 570),
.dashboard: CGSize(width: 500, height: 570), .dashboard: CGSize(width: 500, height: 570),
.advanced: CGSize(width: 500, height: 520), .advanced: CGSize(width: 500, height: 570),
.debug: CGSize(width: 500, height: 520), .debug: CGSize(width: 500, height: 570),
.about: CGSize(width: 500, height: 520) .about: CGSize(width: 500, height: 570)
] ]
var body: some View { var body: some View {

View file

@ -41,10 +41,11 @@ struct WelcomeView: View {
.transition(.asymmetric(insertion: .move(edge: .trailing), removal: .move(edge: .leading))) .transition(.asymmetric(insertion: .move(edge: .trailing), removal: .move(edge: .leading)))
} }
} }
.frame(maxHeight: .infinity)
.animation(.easeInOut, value: currentPage) .animation(.easeInOut, value: currentPage)
// Custom page indicators and navigation // Custom page indicators and navigation - Fixed height container
VStack(spacing: 16) { VStack(spacing: 0) {
// Page indicators // Page indicators
HStack(spacing: 8) { HStack(spacing: 8) {
ForEach(0..<4) { index in ForEach(0..<4) { index in
@ -61,7 +62,7 @@ struct WelcomeView: View {
.pointingHandCursor() .pointingHandCursor()
} }
} }
.padding(.top, 12) .frame(height: 32) // Fixed height for indicator area
// Navigation button // Navigation button
HStack { HStack {
@ -75,8 +76,9 @@ struct WelcomeView: View {
.buttonStyle(.borderedProminent) .buttonStyle(.borderedProminent)
} }
.padding(.horizontal, 20) .padding(.horizontal, 20)
.padding(.bottom, 20) .frame(height: 60) // Fixed height for button area
} }
.frame(height: 92) // Total fixed height: 32 + 60
} }
.frame(width: 640, height: 560) .frame(width: 640, height: 560)
.background(Color(NSColor.windowBackgroundColor)) .background(Color(NSColor.windowBackgroundColor))
@ -110,8 +112,6 @@ struct WelcomeView: View {
private struct WelcomePageView: View { private struct WelcomePageView: View {
var body: some View { var body: some View {
VStack(spacing: 40) { VStack(spacing: 40) {
Spacer()
// App icon // App icon
Image(nsImage: NSImage(named: "AppIcon") ?? NSImage()) Image(nsImage: NSImage(named: "AppIcon") ?? NSImage())
.resizable() .resizable()
@ -138,9 +138,8 @@ private struct WelcomePageView: View {
.frame(maxWidth: 480) .frame(maxWidth: 480)
.fixedSize(horizontal: false, vertical: true) .fixedSize(horizontal: false, vertical: true)
} }
Spacer()
} }
.frame(maxWidth: .infinity, maxHeight: .infinity)
.padding() .padding()
} }
} }
@ -153,8 +152,6 @@ private struct VTCommandPageView: View {
var body: some View { var body: some View {
VStack(spacing: 30) { VStack(spacing: 30) {
Spacer()
// App icon // App icon
Image(nsImage: NSImage(named: "AppIcon") ?? NSImage()) Image(nsImage: NSImage(named: "AppIcon") ?? NSImage())
.resizable() .resizable()
@ -220,9 +217,8 @@ private struct VTCommandPageView: View {
} }
} }
} }
Spacer()
} }
.frame(maxWidth: .infinity, maxHeight: .infinity)
.padding() .padding()
.onAppear { .onAppear {
cliInstaller.checkInstallationStatus() cliInstaller.checkInstallationStatus()
@ -244,8 +240,6 @@ private struct ProtectDashboardPageView: View {
var body: some View { var body: some View {
VStack(spacing: 30) { VStack(spacing: 30) {
Spacer()
// App icon // App icon
Image(nsImage: NSImage(named: "AppIcon") ?? NSImage()) Image(nsImage: NSImage(named: "AppIcon") ?? NSImage())
.resizable() .resizable()
@ -315,9 +309,8 @@ private struct ProtectDashboardPageView: View {
.foregroundColor(.secondary) .foregroundColor(.secondary)
} }
} }
Spacer()
} }
.frame(maxWidth: .infinity, maxHeight: .infinity)
.padding() .padding()
} }
@ -369,8 +362,6 @@ private struct AccessDashboardPageView: View {
var body: some View { var body: some View {
VStack(spacing: 30) { VStack(spacing: 30) {
Spacer()
// App icon // App icon
Image(nsImage: NSImage(named: "AppIcon") ?? NSImage()) Image(nsImage: NSImage(named: "AppIcon") ?? NSImage())
.resizable() .resizable()
@ -433,8 +424,8 @@ private struct AccessDashboardPageView: View {
CreditLink(name: "@steipete", url: "https://steipete.me") CreditLink(name: "@steipete", url: "https://steipete.me")
} }
} }
.padding(.bottom, 8)
} }
.frame(maxWidth: .infinity, maxHeight: .infinity)
.padding() .padding()
} }
} }