Skip to content

Commit

Permalink
Fix ColorPickerCell for phone user interface idiom
Browse files Browse the repository at this point in the history
  • Loading branch information
mvasilak committed Nov 21, 2023
1 parent f9f4c88 commit 4d1c7b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ final class ColorPickerCell: UITableViewCell {
let hexColors = AnnotationsConfig.allColors
let colorPicker = ColorPickerStackView(
hexColors: hexColors,
columnsDistribution: .fixed(numberOfColumns: hexColors.count),
columnsDistribution: UIDevice.current.userInterfaceIdiom == .pad ? .fixed(numberOfColumns: hexColors.count) : .fitInWidth(width: UIScreen.main.bounds.width),
allowsMultipleSelection: false,
circleBackgroundColor: backgroundColor ?? .secondarySystemBackground,
circleBackgroundColor: .secondarySystemGroupedBackground,
circleContentInsets: UIEdgeInsets(top: 11, left: 11, bottom: 11, right: 11),
accessibilityLabelProvider: { hexColor, isSelected in
name(for: hexColor, isSelected: isSelected)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class AnnotationToolOptionsViewController: UIViewController {
circleSelectionLineWidth: 3,
circleSelectionInset: UIEdgeInsets(top: 4, left: 4, bottom: 4, right: 4),
trailingSpacerViewProvider: {
guard UIDevice.current.userInterfaceIdiom == .phone else { return nil }
guard UIDevice.current.userInterfaceIdiom == .phone else { return nil }
let spacerView = UIView()
spacerView.setContentHuggingPriority(.defaultLow, for: .horizontal)
return spacerView
Expand Down

0 comments on commit 4d1c7b2

Please sign in to comment.