Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions NextcloudTalk/Chat/ChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2126,7 +2126,10 @@ import SwiftUI

emojiShortcutButton.titleLabel?.font = .systemFont(ofSize: 20)
emojiShortcutButton.setTitle(emoji, for: .normal)
emojiShortcutButton.backgroundColor = .systemBackground

if #unavailable(iOS 26.0) {
emojiShortcutButton.backgroundColor = .systemBackground
}

emojiShortcutButton.addAction { [weak self] in
guard let self else { return }
Expand Down Expand Up @@ -2157,7 +2160,11 @@ import SwiftUI
addReactionButton.titleLabel?.font = .systemFont(ofSize: 22)
addReactionButton.setImage(.init(systemName: "plus"), for: .normal)
addReactionButton.tintColor = .label
addReactionButton.backgroundColor = .systemBackground

if #unavailable(iOS 26.0) {
addReactionButton.backgroundColor = .systemBackground
}

addReactionButton.addAction { [weak self] in
guard let self else { return }
self.tableView?.contextMenuInteraction?.dismissMenu()
Expand All @@ -2171,8 +2178,14 @@ import SwiftUI

// The reactionView will be shown after the animation finishes, otherwise we see the view already when animating and this looks odd
reactionView.alpha = 0
reactionView.layer.cornerRadius = CGFloat(emojiButtonSize) / 2
reactionView.backgroundColor = .systemBackground

if #available(iOS 26.0, *) {
let effectView = reactionView.addGlassView()
effectView.layer.cornerRadius = CGFloat(emojiButtonSize) / 2
} else {
reactionView.layer.cornerRadius = CGFloat(emojiButtonSize) / 2
reactionView.backgroundColor = .systemBackground
}

return reactionView
}
Expand Down
22 changes: 22 additions & 0 deletions NextcloudTalk/User Interface/Extensions/UIViewExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,26 @@ extension UIView {
layer.render(in: rendererContext.cgContext)
}
}

@available(iOS 26.0, *)
@discardableResult
func addGlassView(withStyle style: UIGlassEffect.Style = .regular) -> UIVisualEffectView {
self.backgroundColor = .clear

let effectView = UIVisualEffectView()
self.insertSubview(effectView, at: 0)

let glassEffect = UIGlassEffect(style: style)
effectView.effect = glassEffect
effectView.translatesAutoresizingMaskIntoConstraints = false

NSLayoutConstraint.activate([
effectView.leftAnchor.constraint(equalTo: self.leftAnchor),
effectView.rightAnchor.constraint(equalTo: self.rightAnchor),
effectView.topAnchor.constraint(equalTo: self.topAnchor),
effectView.bottomAnchor.constraint(equalTo: self.bottomAnchor)
])

return effectView
}
}
Loading