Skip to content

Commit

Permalink
fix padding
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Chicherin authored and Denis Chicherin committed May 8, 2021
1 parent f51e79b commit d813f73
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
16 changes: 8 additions & 8 deletions Sources/Floaty.swift
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ open class Floaty: UIView {
itemDefaultSet(item)
item.titleLabelPosition = titlePosition
item.title = title
item.titleView.backgroundColor = itemTitleViewColor
item.titleViewColor = itemTitleViewColor
addItem(item: item)
return item
}
Expand All @@ -581,7 +581,7 @@ open class Floaty: UIView {
let item = FloatyItem()
itemDefaultSet(item)
item.title = title
item.titleView.backgroundColor = itemTitleViewColor
item.titleViewColor = itemTitleViewColor
addItem(item: item)
return item
}
Expand All @@ -596,7 +596,7 @@ open class Floaty: UIView {
itemDefaultSet(item)
item.titleLabelPosition = titlePosition
item.title = title
item.titleView.backgroundColor = itemTitleViewColor
item.titleViewColor = itemTitleViewColor
item.icon = icon
addItem(item: item)
return item
Expand All @@ -610,7 +610,7 @@ open class Floaty: UIView {
let item = FloatyItem()
itemDefaultSet(item)
item.title = title
item.titleView.backgroundColor = itemTitleViewColor
item.titleViewColor = itemTitleViewColor
item.icon = icon
addItem(item: item)
return item
Expand All @@ -624,7 +624,7 @@ open class Floaty: UIView {
let item = FloatyItem()
itemDefaultSet(item)
item.title = title
item.titleView.backgroundColor = itemTitleViewColor
item.titleViewColor = itemTitleViewColor
item.handler = handler
addItem(item: item)
return item
Expand All @@ -640,7 +640,7 @@ open class Floaty: UIView {
itemDefaultSet(item)
item.titleLabelPosition = titlePosition
item.title = title
item.titleView.backgroundColor = itemTitleViewColor
item.titleViewColor = itemTitleViewColor
item.handler = handler
addItem(item: item)
return item
Expand All @@ -654,7 +654,7 @@ open class Floaty: UIView {
let item = FloatyItem()
itemDefaultSet(item)
item.title = title
item.titleView.backgroundColor = itemTitleViewColor
item.titleViewColor = itemTitleViewColor
item.icon = icon
item.handler = handler
addItem(item: item)
Expand All @@ -671,7 +671,7 @@ open class Floaty: UIView {
itemDefaultSet(item)
item.titleLabelPosition = titlePosition
item.title = title
item.titleView.backgroundColor = itemTitleViewColor
item.titleViewColor = itemTitleViewColor
item.icon = icon
item.handler = handler
addItem(item: item)
Expand Down
3 changes: 2 additions & 1 deletion Sources/FloatyItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,14 @@ open class FloatyItem: UIView {
Title background view
*/
@objc open var titleView: UIView = UIView()
var titleViewColor: UIColor = .clear

/**
Item's title.
*/
@objc open var title: String? = nil {
didSet {
let titleViewLeftPadding: CGFloat = 14
let titleViewLeftPadding: CGFloat = titleViewColor == .clear ? 0 : 14
let titleViewTopPadding: CGFloat = 4
let titleViewCornerRadius: CGFloat = 17

Expand Down

0 comments on commit d813f73

Please sign in to comment.