From 4a05570dc2dd24debd986ef0ccc54e170078697d Mon Sep 17 00:00:00 2001 From: Evan Hahn Date: Fri, 10 Jun 2022 11:49:51 -0500 Subject: [PATCH] Fix small visual bugs in group member sheet This fixes two small regressions introduced in 80e8379738978f1e54c4ea3fa7f1ae3d69d3deec: 1. There's a bit too much spacing at the top. 2. In dark mode, the grabber had the wrong background color. (As you can see in the code, my solution here is a temporary workaround before we do a larger refactor.) --- .../ThreadSettings/MemberActionSheet.swift | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Signal/src/ViewControllers/ThreadSettings/MemberActionSheet.swift b/Signal/src/ViewControllers/ThreadSettings/MemberActionSheet.swift index 0f1b2e34ba..37360a466d 100644 --- a/Signal/src/ViewControllers/ThreadSettings/MemberActionSheet.swift +++ b/Signal/src/ViewControllers/ThreadSettings/MemberActionSheet.swift @@ -18,7 +18,18 @@ class MemberActionSheet: InteractiveSheetViewController { let address: SignalServiceAddress override var interactiveScrollViews: [UIScrollView] { [tableViewController.tableView] } - override var sheetBackgroundColor: UIColor { tableViewController.tableBackgroundColor } + + override var sheetBackgroundColor: UIColor { + // We can't use `tableViewController.tableBackgroundColor` directly because it changes + // depending on whether it's inside a view controller. When this variable is first used, + // `tableViewController` isn't a child yet, so the color will be different. + // + // In the long term, we should consider a larger refactor, likely by turning this sheet's + // contents into a "regular" view. + // + // See IOS-2468 for more details. + OWSTableViewController2.tableBackgroundColor(isUsingPresentedStyle: true) + } var contentSizeHeight: CGFloat { tableViewController.tableView.contentSize.height + tableViewController.tableView.adjustedContentInset.totalHeight @@ -128,10 +139,9 @@ class MemberActionSheet: InteractiveSheetViewController { let contents = OWSTableContents() defer { tableViewController.setContents(contents, shouldReload: shouldReload) } - // Leave space at the top for the handle - let handleSection = OWSTableSection() - handleSection.customHeaderHeight = 50 - contents.addSection(handleSection) + let topSpacerSection = OWSTableSection() + topSpacerSection.customHeaderHeight = 12 + contents.addSection(topSpacerSection) let section = OWSTableSection() contents.addSection(section)