Added theme colour section to settings
This commit is contained in:
parent
7abd5e3ba4
commit
71806c9ca4
@ -32,20 +32,6 @@ struct MainView: View {
|
|||||||
Image(systemName: "gear")
|
Image(systemName: "gear")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ToolbarItem(placement: .topBarTrailing) {
|
|
||||||
Menu {
|
|
||||||
Picker(selection: $filterColor) {
|
|
||||||
ForEach(Constants.colorText, id: \.self) { clr in
|
|
||||||
Text(clr)
|
|
||||||
}
|
|
||||||
} label: {
|
|
||||||
Text("Color")
|
|
||||||
}
|
|
||||||
.pickerStyle(.menu)
|
|
||||||
} label: {
|
|
||||||
Image(systemName: "line.3.horizontal.decrease.circle")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ToolbarItem(placement: .topBarTrailing) {
|
ToolbarItem(placement: .topBarTrailing) {
|
||||||
Button(action: { addNewProject.toggle() }) {
|
Button(action: { addNewProject.toggle() }) {
|
||||||
Label("Add Item", systemImage: "plus")
|
Label("Add Item", systemImage: "plus")
|
||||||
|
@ -19,13 +19,15 @@ struct SettingsView: View {
|
|||||||
@AppStorage(Preferences.teleSeparator) var teleprompterSeparator: String = "---"
|
@AppStorage(Preferences.teleSeparator) var teleprompterSeparator: String = "---"
|
||||||
@AppStorage(Preferences.teleDefaultSize) var teleDefaultSize = 45.0
|
@AppStorage(Preferences.teleDefaultSize) var teleDefaultSize = 45.0
|
||||||
@AppStorage(Preferences.teleAutoScroll) var teleAutoScroll = false
|
@AppStorage(Preferences.teleAutoScroll) var teleAutoScroll = false
|
||||||
|
@AppStorage(Preferences.teleAutoScrollSpeed) var teleAutoScrollSpeed = 1.0
|
||||||
|
|
||||||
|
// @State private var themesColor: Color = .blue
|
||||||
|
@AppStorage(Preferences.themeColour) var themesColor = Color.blue.toHex()!
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationView {
|
NavigationView {
|
||||||
List {
|
List {
|
||||||
|
generalSettings
|
||||||
cueCardSettings
|
cueCardSettings
|
||||||
teleprompterSettings
|
teleprompterSettings
|
||||||
appleWatchSettings
|
appleWatchSettings
|
||||||
@ -41,6 +43,29 @@ struct SettingsView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var generalSettings: some View {
|
||||||
|
Section {
|
||||||
|
Text("Theme Color")
|
||||||
|
HStack {
|
||||||
|
ForEach(Constants.colors, id: \.self) { color in
|
||||||
|
if themesColor == color.toHex()! {
|
||||||
|
ZStack {
|
||||||
|
Circle()
|
||||||
|
.foregroundStyle(color)
|
||||||
|
// .strokeBorder(Color.white,lineWidth: 4)
|
||||||
|
// .background(Circle().foregroundStyle(color))
|
||||||
|
Image(systemName: "checkmark")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Circle()
|
||||||
|
.foregroundStyle(color)
|
||||||
|
.onTapGesture { themesColor = color.toHex()! }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} header: { Text("General") }
|
||||||
|
}
|
||||||
|
|
||||||
var cueCardSettings: some View {
|
var cueCardSettings: some View {
|
||||||
Section {
|
Section {
|
||||||
Stepper("Default Text Size: \(cueDefaultSize.formatted())", value: $cueDefaultSize, in: 1...100)
|
Stepper("Default Text Size: \(cueDefaultSize.formatted())", value: $cueDefaultSize, in: 1...100)
|
||||||
@ -51,6 +76,9 @@ struct SettingsView: View {
|
|||||||
Section {
|
Section {
|
||||||
Stepper("Default Text Size: \(teleDefaultSize.formatted())", value: $teleDefaultSize, in: 1...100)
|
Stepper("Default Text Size: \(teleDefaultSize.formatted())", value: $teleDefaultSize, in: 1...100)
|
||||||
Toggle("AutoScroll", isOn: $teleAutoScroll)
|
Toggle("AutoScroll", isOn: $teleAutoScroll)
|
||||||
|
if teleAutoScroll {
|
||||||
|
Stepper("Default Autoscroll Speed: \(teleAutoScrollSpeed.formatted())", value: $teleAutoScrollSpeed, in: 0.1...10.0, step: 0.1)
|
||||||
|
}
|
||||||
} header: { Text("Teleprompter") }
|
} header: { Text("Teleprompter") }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,8 +11,11 @@ public struct Preferences {
|
|||||||
static let teleSeparator = "teleSeparator"
|
static let teleSeparator = "teleSeparator"
|
||||||
static let teleDefaultSize = "teleDefaultSize"
|
static let teleDefaultSize = "teleDefaultSize"
|
||||||
static let teleAutoScroll = "teleAutoScroll"
|
static let teleAutoScroll = "teleAutoScroll"
|
||||||
|
static let teleAutoScrollSpeed = "teleAutoScrollSpeed"
|
||||||
|
|
||||||
static let watchConnectivity = "watchConnectivity"
|
static let watchConnectivity = "watchConnectivity"
|
||||||
|
|
||||||
static let cueDefaultSize = "cueDefaultSize"
|
static let cueDefaultSize = "cueDefaultSize"
|
||||||
|
|
||||||
|
static let themeColour = "themeColour"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user