add min width for footer button in session tableview vc

pull/941/head
Ryan Zhao 2 years ago
parent e49b4ccaa1
commit bd23e7ec4a

@ -79,6 +79,7 @@ class ThreadDisappearingMessagesViewModel: SessionTableViewModel<ThreadDisappear
style: .bordered, style: .bordered,
title: "DISAPPERING_MESSAGES_SAVE_TITLE".localized(), title: "DISAPPERING_MESSAGES_SAVE_TITLE".localized(),
isEnabled: true, isEnabled: true,
minWidth: 110,
onTap: { onTap: {
self?.saveChanges() self?.saveChanges()
self?.dismissScreen() self?.dismissScreen()

@ -298,6 +298,7 @@ class SessionTableViewController<NavItemId: Equatable, Section: SessionTableSect
self?.footerButton.setTitle(buttonInfo.title, for: .normal) self?.footerButton.setTitle(buttonInfo.title, for: .normal)
self?.footerButton.setStyle(buttonInfo.style) self?.footerButton.setStyle(buttonInfo.style)
self?.footerButton.isEnabled = buttonInfo.isEnabled self?.footerButton.isEnabled = buttonInfo.isEnabled
self?.footerButton.set(.width, greaterThanOrEqualTo: buttonInfo.minWidth)
} }
self?.onFooterTap = buttonInfo?.onTap self?.onFooterTap = buttonInfo?.onTap

@ -21,18 +21,21 @@ public final class SessionButton: UIButton {
public let style: Style public let style: Style
public let title: String public let title: String
public let isEnabled: Bool public let isEnabled: Bool
public let minWidth: CGFloat
public let onTap: () -> () public let onTap: () -> ()
public init( public init(
style: Style, style: Style,
title: String, title: String,
isEnabled: Bool, isEnabled: Bool,
minWidth: CGFloat = 0,
onTap: @escaping () -> () onTap: @escaping () -> ()
) { ) {
self.style = style self.style = style
self.title = title self.title = title
self.isEnabled = isEnabled self.isEnabled = isEnabled
self.onTap = onTap self.onTap = onTap
self.minWidth = minWidth
} }
} }

Loading…
Cancel
Save