From 41be78ed5bd35bee52e9125bf2ef7c1ebbd4d167 Mon Sep 17 00:00:00 2001 From: Thilo Molitor Date: Thu, 29 Aug 2024 03:35:15 +0200 Subject: [PATCH] Fix tint coloring in new swiftui based contact list --- Monal/Classes/ContactsView.swift | 4 +--- Monal/Classes/SwiftuiHelpers.swift | 28 +++++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Monal/Classes/ContactsView.swift b/Monal/Classes/ContactsView.swift index 8ab09693c..cb22805af 100644 --- a/Monal/Classes/ContactsView.swift +++ b/Monal/Classes/ContactsView.swift @@ -59,7 +59,6 @@ struct ContactViewEntry: View { selectedContactForContactDetails = ObservableKVOWrapper(contact) } label: { Image(systemName: "info.circle") - .tint(.blue) .imageScale(.large) } .accessibilityLabel("Open contact details") @@ -161,13 +160,12 @@ struct ContactsView: View { Image(systemName: "person.3.fill") } .accessibilityLabel("Create contact group") - .tint(monalGreen) + NavigationLink(destination: AddContactMenu(delegate: SheetDismisserProtocol(), dismissWithNewContact: dismissWithContact)) { Image(systemName: "person.fill.badge.plus") .overlay { NumberlessBadge($contacts.requestCount) } } .accessibilityLabel(contacts.requestCount > 0 ? "Add contact (contact requests pending)" : "Add New Contact") - .tint(monalGreen) } } .sheet(item: $selectedContactForContactDetails) { selectedContact in diff --git a/Monal/Classes/SwiftuiHelpers.swift b/Monal/Classes/SwiftuiHelpers.swift index 4adbff364..1966f2310 100644 --- a/Monal/Classes/SwiftuiHelpers.swift +++ b/Monal/Classes/SwiftuiHelpers.swift @@ -558,6 +558,7 @@ struct AddTopLevelNavigation: View { let build: () -> Content let delegate: SheetDismisserProtocol @StateObject private var sizeClass: ObservableKVOWrapper + init(withDelegate delegate: SheetDismisserProtocol, to build: @autoclosure @escaping () -> Content) { self.build = build self.delegate = delegate @@ -565,24 +566,25 @@ struct AddTopLevelNavigation: View { let activeChats = (UIApplication.shared.delegate as! MonalAppDelegate).activeChats! self._sizeClass = StateObject(wrappedValue: ObservableKVOWrapper(activeChats.sizeClass)) } + var body: some View { NavigationStack { build() - .navigationBarTitleDisplayMode(.automatic) - .navigationBarBackButtonHidden(true) // will not be shown because swiftui does not know we navigated here from UIKit - .toolbar { - let isCompact = UIUserInterfaceSizeClass(rawValue: sizeClass.horizontal) == .compact - if isCompact { - ToolbarItem(placement: .topBarLeading) { - Button(action : { - self.delegate.dismiss() - }){ - Image(systemName: "arrow.backward") - .tint(monalGreen) - }.keyboardShortcut(.escape, modifiers: []) + .navigationBarTitleDisplayMode(.automatic) + .navigationBarBackButtonHidden(true) // will not be shown because swiftui does not know we navigated here from UIKit + .toolbar { + let isCompact = UIUserInterfaceSizeClass(rawValue: sizeClass.horizontal) == .compact + if isCompact { + ToolbarItem(placement: .topBarLeading) { + Button(action : { + self.delegate.dismiss() + }) { + Image(systemName: "arrow.backward") + } + .keyboardShortcut(.escape, modifiers: []) + } } } - } } } }