Skip to content

Commit

Permalink
Merge pull request element-hq#7428 from vector-im/alfogrillo/avatar_t…
Browse files Browse the repository at this point in the history
…appability

Improve avatar tappability
  • Loading branch information
Alfonso Grillo authored Mar 16, 2023
2 parents c560237 + 31de127 commit 571deb8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Riot/Modules/Home/AllChats/AllChatsCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ class AllChatsCoordinator: NSObject, SplitViewMasterCoordinatorProtocol {
view.backgroundColor = .clear

let avatarInsets: UIEdgeInsets = .init(top: 7, left: 7, bottom: 7, right: 7)
let button: UIButton = .init(frame: view.bounds.inset(by: avatarInsets))
let button: UIButton = .init(frame: view.bounds)
button.imageEdgeInsets = avatarInsets
button.setImage(Asset.Images.tabPeople.image, for: .normal)
button.menu = avatarMenu
button.showsMenuAsPrimaryAction = true
Expand All @@ -386,12 +387,12 @@ class AllChatsCoordinator: NSObject, SplitViewMasterCoordinatorProtocol {
}

private func updateAvatarButtonItem() {
guard let avatarView = avatarMenuView, let button = avatarMenuButton, let avatar = userAvatarViewData(from: currentMatrixSession) else {
return
if let avatar = userAvatarViewData(from: currentMatrixSession) {
avatarMenuView?.fill(with: avatar)
avatarMenuButton?.setImage(nil, for: .normal)
} else {
avatarMenuButton?.setImage(Asset.Images.tabPeople.image, for: .normal)
}

button.setImage(nil, for: .normal)
avatarView.fill(with: avatar)
}

private func showRoom(withId roomId: String, eventId: String? = nil) {
Expand Down
1 change: 1 addition & 0 deletions changelog.d/pr-7427.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Room list: increase tappability area of the avatar button.

0 comments on commit 571deb8

Please sign in to comment.