Skip to content

Instantly share code, notes, and snippets.

@drewolbrich
Created June 26, 2024 16:23
Show Gist options
  • Save drewolbrich/1386c0d01b9391bf8acec768025687fd to your computer and use it in GitHub Desktop.
Save drewolbrich/1386c0d01b9391bf8acec768025687fd to your computer and use it in GitHub Desktop.
//
// InputNotWorkingIndicator.swift
//
// Created by Drew Olbrich on 6/26/24.
// Copyright © 2024 Lunar Skydiving LLC. All rights reserved.
//
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
import SwiftUI
/// A recreation of the Mac Virtual Display "Input temporarily not working" indicator.
struct InputNotWorkingIndicator: View {
var body: some View {
HStack(spacing: 13) {
Image(systemName: "exclamationmark.triangle.fill")
.resizable()
.scaledToFit()
.frame(width: 22, height: 22)
VStack(spacing: 2) {
Text("Input temporarily not working")
.fontWeight(.semibold)
Text("Trying to reconnect, please wait")
.font(.system(size: 16.3))
.foregroundStyle(.secondary)
}
}
.padding(EdgeInsets(top: 12, leading: 19, bottom: 14, trailing: 23))
.background(.regularMaterial)
.glassBackgroundEffect(in: .capsule)
}
}
#Preview(windowStyle: .automatic) {
InputNotWorkingIndicator()
}
@radicalappdev
Copy link

Nightmare fuel for visionOS devs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment