aboutsummaryrefslogtreecommitdiff
path: root/HoloBar
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-02-12 04:16:08 -0800
committerFuwn <[email protected]>2025-02-12 04:16:08 -0800
commit9413d2b8f747d9f19ce31c5faa1de14e3f4090af (patch)
treed47b5ab9972f22bfa01a7637976ed79edeed3430 /HoloBar
parentstyle(HoloBarApp): Tidy buttons (diff)
downloadholobar-9413d2b8f747d9f19ce31c5faa1de14e3f4090af.tar.xz
holobar-9413d2b8f747d9f19ce31c5faa1de14e3f4090af.zip
feat(HoloBarApp): Add avatar visiblity toggle
Diffstat (limited to 'HoloBar')
-rw-r--r--HoloBar/HoloBarApp.swift13
1 files changed, 10 insertions, 3 deletions
diff --git a/HoloBar/HoloBarApp.swift b/HoloBar/HoloBarApp.swift
index e8d678a..3fb0154 100644
--- a/HoloBar/HoloBarApp.swift
+++ b/HoloBar/HoloBarApp.swift
@@ -3,6 +3,7 @@ import SwiftUI
@main
struct HoloBarApp: App {
@StateObject private var fetcher = CharacterFetcher()
+ @State private var showAvatars = false
var body: some Scene {
MenuBarExtra {
@@ -15,9 +16,11 @@ struct HoloBarApp: App {
NSWorkspace.shared.open(character.profileURL)
}) {
HStack {
- AsyncImage(url: character.avatarURL, content: { $0 }, placeholder: {
- Image(systemName: "person.crop.circle")
- })
+ if showAvatars {
+ AsyncImage(url: character.avatarURL, content: { $0 }, placeholder: {
+ Image(systemName: "person.crop.circle")
+ })
+ }
Text(character.name)
}
@@ -33,6 +36,10 @@ struct HoloBarApp: App {
}
#endif
+ Button("\(showAvatars ? "Hide" : "Show") Avatars") {
+ showAvatars.toggle()
+ }
+
Button("Refresh", action: refreshCharacters)
Button("Quit", action: { NSApplication.shared.terminate(nil) })
}