aboutsummaryrefslogtreecommitdiff
path: root/Hotline/macOS/TrackerView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Hotline/macOS/TrackerView.swift')
-rw-r--r--Hotline/macOS/TrackerView.swift17
1 files changed, 17 insertions, 0 deletions
diff --git a/Hotline/macOS/TrackerView.swift b/Hotline/macOS/TrackerView.swift
index 0fac8b0..cdeef7f 100644
--- a/Hotline/macOS/TrackerView.swift
+++ b/Hotline/macOS/TrackerView.swift
@@ -24,6 +24,11 @@ struct TrackerView: View {
List(selection: $selection) {
ForEach(bookmarks, id: \.self) { bookmark in
TrackerItemView(bookmark: bookmark)
+ .onAppear {
+ if bookmark.autoconnect, let server = bookmark.server {
+ openWindow(id: "server", value: server)
+ }
+ }
.tag(bookmark)
if bookmark.type == .tracker && bookmark.expanded {
@@ -403,7 +408,19 @@ struct TrackerItemView: View {
.frame(width: 11, height: 11, alignment: .center)
.opacity(0.5)
.padding(.leading, 3)
+ Image(systemName: "bolt.fill")
+ .resizable()
+ .renderingMode(.template)
+ .aspectRatio(contentMode: .fit)
+ .frame(width: 13, height: 13, alignment: .center)
+ .opacity(0.5)
+ .padding(.leading, 3)
.padding(.trailing, 2)
+ .foregroundStyle(bookmark.autoconnect ? Color.accentColor : Color.gray)
+ .onTapGesture {
+ bookmark.autoconnect.toggle()
+ try? bookmark.modelContext?.save()
+ }
Image("Server")
.resizable()
.scaledToFit()