Commit a404c51d by Orkhan Alikhanov

Fixed minor dialogView bugs

parent 77c252e5
...@@ -179,13 +179,12 @@ private extension DialogView { ...@@ -179,13 +179,12 @@ private extension DialogView {
func layoutScrollView() { func layoutScrollView() {
let h = titleArea.frame.height + buttonArea.frame.height let h = titleArea.frame.height + buttonArea.frame.height
let allowed = min(maxSize.height - h, contentView.frame.height) let allowed = min(frame.height - h, contentView.frame.height)
scrollView.frame.size = CGSize(width: frame.width, height: max(allowed, 0)) scrollView.frame.size = CGSize(width: frame.width, height: max(allowed, 0))
scrollView.frame.origin.y = titleArea.frame.maxY scrollView.frame.origin.y = titleArea.frame.maxY
scrollView.contentSize = contentView.frame.size scrollView.contentSize = contentView.frame.size
} }
/// Lays out dividers /// Lays out dividers
...@@ -194,8 +193,8 @@ private extension DialogView { ...@@ -194,8 +193,8 @@ private extension DialogView {
func layoutDividers() { func layoutDividers() {
let isScrollable = contentView.frame.height > scrollView.frame.height let isScrollable = contentView.frame.height > scrollView.frame.height
titleArea.isDividerHidden = titleLabel.isEmpty || !isScrollable || scrollView.isAtTop titleArea.isDividerHidden = titleArea.frame.height == 0 || !isScrollable || scrollView.isAtTop
buttonArea.isDividerHidden = nonHiddenButtons.isEmpty || !isScrollable || scrollView.isAtBottom buttonArea.isDividerHidden = buttonArea.frame.height == 0 || !isScrollable || scrollView.isAtBottom
titleArea.layoutDivider() titleArea.layoutDivider()
buttonArea.layoutDivider() buttonArea.layoutDivider()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment