mirror of
https://github.com/maxgoedjen/secretive.git
synced 2026-03-06 17:57:23 +01:00
More UI tweaks and fixes (#697)
* Integrations to window * Cleanup of presenting. * Older name for copy * For copyable view too
This commit is contained in:
@@ -32,7 +32,7 @@ struct ConfigurationItemView<Content: View>: View {
|
||||
Spacer()
|
||||
switch action {
|
||||
case .copy(let string):
|
||||
Button(.copyableClickToCopyButton, systemImage: "document.on.document") {
|
||||
Button(.copyableClickToCopyButton, systemImage: "doc.on.doc") {
|
||||
NSPasteboard.general.declareTypes([.string], owner: nil)
|
||||
NSPasteboard.general.setString(string, forType: .string)
|
||||
}
|
||||
|
||||
@@ -21,46 +21,18 @@ struct IntegrationsView: View {
|
||||
}
|
||||
}
|
||||
} detail: {
|
||||
IntegrationsDetailView(selectedInstruction: $selectedInstruction)
|
||||
.fauxToolbar {
|
||||
Button(.setupDoneButton) {
|
||||
dismiss()
|
||||
}
|
||||
.normalButton()
|
||||
}
|
||||
IntegrationsDetailView(selectedInstruction: $selectedInstruction)
|
||||
}
|
||||
.toolbar {
|
||||
Button(.setupDoneButton) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
.hiddenToolbar()
|
||||
.windowBackgroundStyle(.thinMaterial)
|
||||
.onAppear {
|
||||
selectedInstruction = instructions.gettingStarted
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension View {
|
||||
|
||||
func fauxToolbar<Content: View>(content: () -> Content) -> some View {
|
||||
modifier(FauxToolbarModifier(toolbarContent: content()))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct FauxToolbarModifier<ToolbarContent: View>: ViewModifier {
|
||||
|
||||
var toolbarContent: ToolbarContent
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
content
|
||||
Divider()
|
||||
HStack {
|
||||
Spacer()
|
||||
toolbarContent
|
||||
.padding(.top, 8)
|
||||
.padding(.trailing, 16)
|
||||
.padding(.bottom, 16)
|
||||
}
|
||||
}
|
||||
|
||||
.frame(minWidth: 400, minHeight: 400)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user