From d5a45d78c41814b826a5b832c921fb11c922fb4f Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Thu, 3 Jul 2025 19:11:06 +0100 Subject: [PATCH] fix the wierd scaling when tapping an ansi color --- ShhShell/Views/Themes/AnsiPickerView.swift | 11 ++++++----- ShhShell/Views/Themes/ThemePreview.swift | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ShhShell/Views/Themes/AnsiPickerView.swift b/ShhShell/Views/Themes/AnsiPickerView.swift index 87fc566..c52ce1f 100644 --- a/ShhShell/Views/Themes/AnsiPickerView.swift +++ b/ShhShell/Views/Themes/AnsiPickerView.swift @@ -11,10 +11,9 @@ struct AnsiPickerView: View { @ObservedObject var hostsManager: HostsManager var body: some View { - ZStack { + ZStack(alignment: .center) { RoundedRectangle(cornerRadius: 15) - .aspectRatio(CGSize(width: 4, height: 1), contentMode: .fit) - .foregroundStyle(hostsManager.selectedTheme.foreground.suiColor.opacity(0.7)) + .foregroundStyle(hostsManager.selectedTheme.foreground.suiColor.opacity(0.5)) GeometryReader { geo in VStack(spacing: 0) { ForEach(0...1, id: \.self) { row in @@ -32,13 +31,15 @@ struct AnsiPickerView: View { hostsManager.selectAnsi(index) } } + .frame(minWidth: 20, minHeight: 20) + .aspectRatio(1, contentMode: .fit) } } } } + .aspectRatio(4, contentMode: .fit) + .clipShape(RoundedRectangle(cornerRadius: 10)) } - .aspectRatio(CGSize(width: 4, height: 1), contentMode: .fit) - .clipShape(RoundedRectangle(cornerRadius: 10)) .padding(5) } } diff --git a/ShhShell/Views/Themes/ThemePreview.swift b/ShhShell/Views/Themes/ThemePreview.swift index 8391591..6340d81 100644 --- a/ShhShell/Views/Themes/ThemePreview.swift +++ b/ShhShell/Views/Themes/ThemePreview.swift @@ -111,5 +111,4 @@ struct ThemePreview: View { canModify: true ) .border(Color.red) - .scaleEffect(2) }