mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
Reduce space between room avatar and name
This commit is contained in:
@@ -24,6 +24,11 @@ enum ThreadRoomTitleViewMode {
|
||||
|
||||
@objcMembers
|
||||
class ThreadRoomTitleView: RoomTitleView {
|
||||
|
||||
private enum Constants {
|
||||
static let roomNameLeadingMarginForEncryptedRoom: CGFloat = 10
|
||||
static let roomNameLeadingMarginForPlainRoom: CGFloat = 4
|
||||
}
|
||||
|
||||
var mode: ThreadRoomTitleViewMode = .allThreads {
|
||||
didSet {
|
||||
@@ -35,6 +40,7 @@ class ThreadRoomTitleView: RoomTitleView {
|
||||
@IBOutlet private weak var roomAvatarView: RoomAvatarView!
|
||||
@IBOutlet private weak var roomEncryptionBadgeView: UIImageView!
|
||||
@IBOutlet private weak var roomNameLabel: UILabel!
|
||||
@IBOutlet private weak var roomNameLeadingConstraint: NSLayoutConstraint!
|
||||
|
||||
// MARK: - Methods
|
||||
|
||||
@@ -45,6 +51,11 @@ class ThreadRoomTitleView: RoomTitleView {
|
||||
roomAvatarView.avatarImageView.image = nil
|
||||
}
|
||||
roomEncryptionBadgeView.image = model.roomEncryptionBadge
|
||||
if roomEncryptionBadgeView.image == nil {
|
||||
roomNameLeadingConstraint.constant = Constants.roomNameLeadingMarginForPlainRoom
|
||||
} else {
|
||||
roomNameLeadingConstraint.constant = Constants.roomNameLeadingMarginForEncryptedRoom
|
||||
}
|
||||
roomEncryptionBadgeView.isHidden = model.roomEncryptionBadge == nil
|
||||
roomNameLabel.text = model.roomDisplayName
|
||||
}
|
||||
|
||||
@@ -102,6 +102,7 @@
|
||||
<outlet property="roomAvatarView" destination="FJB-2F-rrQ" id="SUd-p8-VCH"/>
|
||||
<outlet property="roomEncryptionBadgeView" destination="Mli-PC-WUh" id="MuX-Qw-DfQ"/>
|
||||
<outlet property="roomNameLabel" destination="8lk-sN-3IP" id="wFm-R4-fBo"/>
|
||||
<outlet property="roomNameLeadingConstraint" destination="Y1z-dr-Y0X" id="dWJ-U0-inJ"/>
|
||||
<outlet property="titleLabel" destination="BnG-NU-7Mg" id="gDw-Pr-oR8"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="10.869565217391305" y="-256.47321428571428"/>
|
||||
|
||||
Reference in New Issue
Block a user