Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions PopMenu/Classes/PopMenuAppearance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public typealias Color = UIColor
/// Appearance for PopMenu.
/// Use for configuring custom styles and looks.
final public class PopMenuAppearance: NSObject {
/// The minimum width for the menu; Default: auto-sizing
public var popMenuMinimumWidth: CGFloat? = .none

/// Background and tint colors.
public var popMenuColor: PopMenuColor = .default()
Expand Down
7 changes: 6 additions & 1 deletion PopMenu/View Controller & Views/PopMenuViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,12 @@ extension PopMenuViewController {
contentFitWidth += action.iconWidthHeight
}

return min(contentFitWidth,maxContentWidth)

if let minimumWidth = self.appearance.popMenuMinimumWidth {
return max(minimumWidth, min(contentFitWidth,maxContentWidth))
} else {
return min(contentFitWidth,maxContentWidth)
}
}

/// Setup actions view.
Expand Down