fix ansi picker having fucked up arrangements

prettify ui on thememanager
This commit is contained in:
neon443
2025-07-03 17:18:23 +01:00
parent fdc5c4c503
commit 69f2ee7c87
3 changed files with 18 additions and 7 deletions

View File

@@ -5,7 +5,7 @@
// Created by neon443 on 06/06/2025.
//
VERSION = 1.3.1
VERSION = 1.5
BUILD = 51
// Configuration settings file format documentation can be found at:

View File

@@ -13,10 +13,10 @@ struct AnsiPickerView: View {
var body: some View {
GeometryReader { geo in
VStack(spacing: 0) {
ForEach(1...2, id: \.self) { row in
ForEach(0...1, id: \.self) { row in
HStack(spacing: 0) {
ForEach(1...8, id: \.self) { col in
let index = (row * col)-1
let index = (col+(row*8))-1
var isSelected: Bool { hostsManager.selectedAnsi == index }
ZStack {
Rectangle()
@@ -37,9 +37,8 @@ struct AnsiPickerView: View {
}
}
}
.clipShape(RoundedRectangle(cornerRadius: 15))
.frame(width: 400, height: 100)
}
.clipShape(RoundedRectangle(cornerRadius: 15))
}
}

View File

@@ -34,11 +34,23 @@ struct ThemeManagerView: View {
.ignoresSafeArea(.all)
GeometryReader { geo in
VStack {
AnsiPickerView(hostsManager: hostsManager)
let columns: Int = max(1, Int((geo.size.width - 2*spacing) / (minColWidth + spacing)))
let layout = Array(repeating: grid, count: columns)
ScrollView {
HStack {
Text("Accent Color")
.padding(.top)
.padding(.horizontal)
.font(.headline)
Spacer()
}
HStack {
AnsiPickerView(hostsManager: hostsManager)
.frame(width: 400, height: 100)
Spacer()
}
.padding(.horizontal)
if hostsManager.themes.isEmpty {
VStack(alignment: .leading) {
Image(systemName: "paintpalette")