mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
change animation on the recents expander/collapser
fontmanager respecs theme bg move the colorscheme thing back
This commit is contained in:
@@ -27,6 +27,8 @@ struct ShhShellApp: App {
|
|||||||
hostsManager: hostsManager,
|
hostsManager: hostsManager,
|
||||||
keyManager: keyManager
|
keyManager: keyManager
|
||||||
)
|
)
|
||||||
|
.colorScheme(hostsManager.selectedTheme.background.luminance > 0.5 ? .light : .dark)
|
||||||
|
.tint(hostsManager.tint)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,9 +78,6 @@ struct ContentView: View {
|
|||||||
}
|
}
|
||||||
.scrollContentBackground(.hidden)
|
.scrollContentBackground(.hidden)
|
||||||
}
|
}
|
||||||
|
|
||||||
.colorScheme(hostsManager.selectedTheme.background.luminance > 0.5 ? .light : .dark)
|
|
||||||
.tint(hostsManager.tint)
|
|
||||||
.navigationTitle("ShhShell")
|
.navigationTitle("ShhShell")
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItem(placement: .confirmationAction) {
|
ToolbarItem(placement: .confirmationAction) {
|
||||||
|
|||||||
@@ -13,58 +13,63 @@ struct FontManagerView: View {
|
|||||||
@State var testLine: String = "the lazy brown fox jumps over the lazy dog"
|
@State var testLine: String = "the lazy brown fox jumps over the lazy dog"
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
List {
|
ZStack {
|
||||||
VStack {
|
hostsManager.selectedTheme.background.suiColor.opacity(0.7)
|
||||||
HStack {
|
.ignoresSafeArea(.all)
|
||||||
Text("Font Size")
|
List {
|
||||||
Spacer()
|
VStack {
|
||||||
Text("\(Int(hostsManager.fontSize))")
|
HStack {
|
||||||
.contentTransition(.numericText())
|
Text("Font Size")
|
||||||
}
|
Spacer()
|
||||||
.padding(.horizontal)
|
Text("\(Int(hostsManager.fontSize))")
|
||||||
|
.contentTransition(.numericText())
|
||||||
Slider(value: $hostsManager.fontSize, in: 1...20, step: 1) {
|
}
|
||||||
|
.padding(.horizontal)
|
||||||
|
|
||||||
} minimumValueLabel: {
|
Slider(value: $hostsManager.fontSize, in: 1...20, step: 1) {
|
||||||
Label("", systemImage: "textformat.size.smaller")
|
|
||||||
} maximumValueLabel: {
|
} minimumValueLabel: {
|
||||||
Label("", systemImage: "textformat.size.larger")
|
Label("", systemImage: "textformat.size.smaller")
|
||||||
} onEditingChanged: { bool in
|
} maximumValueLabel: {
|
||||||
hostsManager.saveFonts()
|
Label("", systemImage: "textformat.size.larger")
|
||||||
|
} onEditingChanged: { bool in
|
||||||
|
hostsManager.saveFonts()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
ForEach(FontFamilies.allCasesRaw, id: \.self) { fontName in
|
||||||
ForEach(FontFamilies.allCasesRaw, id: \.self) { fontName in
|
let selected = hostsManager.selectedFont == fontName
|
||||||
let selected = hostsManager.selectedFont == fontName
|
Button() {
|
||||||
Button() {
|
hostsManager.selectFont(fontName)
|
||||||
hostsManager.selectFont(fontName)
|
} label: {
|
||||||
} label: {
|
VStack(alignment: .leading, spacing: 5) {
|
||||||
VStack(alignment: .leading, spacing: 5) {
|
Text(fontName)
|
||||||
Text(fontName)
|
.foregroundStyle(.gray)
|
||||||
.foregroundStyle(.gray)
|
HStack {
|
||||||
HStack {
|
Circle()
|
||||||
Circle()
|
.frame(width: 20)
|
||||||
.frame(width: 20)
|
.opacity(selected ? 1 : 0)
|
||||||
.opacity(selected ? 1 : 0)
|
.foregroundStyle(.green)
|
||||||
.foregroundStyle(.green)
|
.animation(.spring, value: selected)
|
||||||
.animation(.spring, value: selected)
|
.transition(.scale)
|
||||||
.transition(.scale)
|
Text(testLine)
|
||||||
Text(testLine)
|
.font(.custom(fontName, size: 15))
|
||||||
.font(.custom(fontName, size: 15))
|
.bold(selected)
|
||||||
.bold(selected)
|
.opacity(selected ? 1 : 0.8)
|
||||||
.opacity(selected ? 1 : 0.8)
|
.contentTransition(.numericText())
|
||||||
.contentTransition(.numericText())
|
.animation(.default, value: testLine)
|
||||||
.animation(.default, value: testLine)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Section("Test String") {
|
||||||
Section("Test String") {
|
TextField("", text: $testLine)
|
||||||
TextField("", text: $testLine)
|
.fixedSize()
|
||||||
.fixedSize()
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.scrollContentBackground(.hidden)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ struct RecentsView: View {
|
|||||||
if historyCount+2 > hostsManager.history.count {
|
if historyCount+2 > hostsManager.history.count {
|
||||||
increment = 1
|
increment = 1
|
||||||
}
|
}
|
||||||
withAnimation { historyCount += increment }
|
withAnimation(.spring) { historyCount += increment }
|
||||||
} label: {
|
} label: {
|
||||||
Image(systemName: "chevron.down")
|
Image(systemName: "chevron.down")
|
||||||
.resizable().scaledToFit()
|
.resizable().scaledToFit()
|
||||||
@@ -76,7 +76,7 @@ struct RecentsView: View {
|
|||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
withAnimation { historyCount = 0 }
|
withAnimation(.spring) { historyCount = 0 }
|
||||||
} label: {
|
} label: {
|
||||||
Image(systemName: "chevron.up.2")
|
Image(systemName: "chevron.up.2")
|
||||||
.resizable().scaledToFit()
|
.resizable().scaledToFit()
|
||||||
|
|||||||
Reference in New Issue
Block a user