mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
add a label to show the current
and grouped the slider and the label
This commit is contained in:
@@ -10,19 +10,28 @@ import SwiftUI
|
|||||||
struct FontManagerView: View {
|
struct FontManagerView: View {
|
||||||
@ObservedObject var hostsManager: HostsManager
|
@ObservedObject var hostsManager: HostsManager
|
||||||
|
|
||||||
@State var testLine: String = "the lazy bronw 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 {
|
List {
|
||||||
Slider(value: $hostsManager.fontSize, in: 1...15, step: 1) {
|
VStack {
|
||||||
Text("\(Int(hostsManager.fontSize))")
|
HStack {
|
||||||
// Label("\(Int(hostsManager.fontSize))", systemImage: "textformat.size")
|
Text("Font Size")
|
||||||
} minimumValueLabel: {
|
Spacer()
|
||||||
Label("", systemImage: "textformat.size.smaller")
|
Text("\(Int(hostsManager.fontSize))")
|
||||||
} maximumValueLabel: {
|
.contentTransition(.numericText())
|
||||||
Label("", systemImage: "textformat.size.larger")
|
}
|
||||||
} onEditingChanged: { bool in
|
.padding(.horizontal)
|
||||||
hostsManager.saveFonts()
|
|
||||||
|
Slider(value: $hostsManager.fontSize, in: 1...20, step: 1) {
|
||||||
|
|
||||||
|
} minimumValueLabel: {
|
||||||
|
Label("", systemImage: "textformat.size.smaller")
|
||||||
|
} maximumValueLabel: {
|
||||||
|
Label("", systemImage: "textformat.size.larger")
|
||||||
|
} onEditingChanged: { bool in
|
||||||
|
hostsManager.saveFonts()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ForEach(FontFamilies.allCasesRaw, id: \.self) { fontName in
|
ForEach(FontFamilies.allCasesRaw, id: \.self) { fontName in
|
||||||
|
|||||||
Reference in New Issue
Block a user