2020-06-30 15:22:23 +02:00
|
|
|
//
|
|
|
|
// SidebarToolbar.swift
|
|
|
|
// Multiplatform iOS
|
|
|
|
//
|
|
|
|
// Created by Stuart Breckenridge on 30/6/20.
|
|
|
|
// Copyright © 2020 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct SidebarToolbar: View {
|
2020-07-03 09:05:12 +02:00
|
|
|
|
|
|
|
@EnvironmentObject private var appSettings: AppDefaults
|
2020-06-30 15:22:23 +02:00
|
|
|
@State private var showSettings: Bool = false
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
VStack {
|
|
|
|
Divider()
|
|
|
|
HStack(alignment: .center) {
|
|
|
|
Button(action: {
|
|
|
|
showSettings = true
|
|
|
|
}, label: {
|
|
|
|
Image(systemName: "gear")
|
|
|
|
.font(.title3)
|
|
|
|
.foregroundColor(.accentColor)
|
|
|
|
}).help("Settings")
|
|
|
|
Spacer()
|
|
|
|
Text("Last updated")
|
|
|
|
.font(.caption)
|
|
|
|
.foregroundColor(.secondary)
|
|
|
|
Spacer()
|
|
|
|
Button(action: {}, label: {
|
|
|
|
Image(systemName: "plus")
|
|
|
|
.font(.title3)
|
|
|
|
.foregroundColor(.accentColor)
|
|
|
|
}).help("Add")
|
|
|
|
}
|
|
|
|
.padding(.horizontal, 16)
|
|
|
|
.padding(.bottom, 12)
|
|
|
|
.padding(.top, 4)
|
|
|
|
}
|
|
|
|
.background(VisualEffectBlur(blurStyle: .systemChromeMaterial).edgesIgnoringSafeArea(.bottom))
|
|
|
|
.sheet(isPresented: $showSettings, onDismiss: { showSettings = false }) {
|
2020-07-03 09:05:12 +02:00
|
|
|
SettingsView().modifier(PreferredColorSchemeModifier(preferredColorScheme: appSettings.userInterfaceColorPalette))
|
2020-06-30 15:22:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct SidebarToolbar_Previews: PreviewProvider {
|
|
|
|
static var previews: some View {
|
|
|
|
SidebarToolbar()
|
|
|
|
}
|
|
|
|
}
|