Skip to content

Commit

Permalink
Fix tint coloring in new swiftui based contact list
Browse files Browse the repository at this point in the history
  • Loading branch information
tmolitor-stud-tu committed Aug 29, 2024
1 parent 46d92e5 commit 41be78e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
4 changes: 1 addition & 3 deletions Monal/Classes/ContactsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ struct ContactViewEntry: View {
selectedContactForContactDetails = ObservableKVOWrapper<MLContact>(contact)
} label: {
Image(systemName: "info.circle")
.tint(.blue)
.imageScale(.large)
}
.accessibilityLabel("Open contact details")
Expand Down Expand Up @@ -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
Expand Down
28 changes: 15 additions & 13 deletions Monal/Classes/SwiftuiHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -558,31 +558,33 @@ struct AddTopLevelNavigation<Content: View>: View {
let build: () -> Content
let delegate: SheetDismisserProtocol
@StateObject private var sizeClass: ObservableKVOWrapper<SizeClassWrapper>

init(withDelegate delegate: SheetDismisserProtocol, to build: @autoclosure @escaping () -> Content) {
self.build = build
self.delegate = delegate

let activeChats = (UIApplication.shared.delegate as! MonalAppDelegate).activeChats!
self._sizeClass = StateObject(wrappedValue: ObservableKVOWrapper<SizeClassWrapper>(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: [])
}
}
}
}
}
}
}
Expand Down

0 comments on commit 41be78e

Please sign in to comment.