Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix barview #262

Merged
merged 2 commits into from
Oct 19, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

.intuitgithookrc

## Build generated
build/
DerivedData/
Expand Down
9 changes: 2 additions & 7 deletions CardParts/src/Classes/Card Parts/CardPartBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,15 @@ public class CardPartBarView: UIView, CardPartView {
if CardParts.theme.roundedCorners {
if let desiredCornerRadius: CGFloat = cornerRadius {
barLayer.cornerRadius = desiredCornerRadius
backgroundLayer.cornerRadius = desiredCornerRadius
} else {
barLayer.cornerRadius = bounds.height / 2
backgroundLayer.cornerRadius = bounds.height / 2
}
}

let backgroundBounds = CGRect(x: 0, y: 0, width: self.bounds.width , height: desiredHeight)
backgroundLayer.bounds = backgroundBounds
if CardParts.theme.roundedCorners {
if let desiredCornerRadius: CGFloat = cornerRadius {
barLayer.cornerRadius = desiredCornerRadius
} else {
barLayer.cornerRadius = bounds.height / 2
}
}

if CardParts.theme.showTodayLine {
let verticalLineBounds = CGRect(x: 0, y: 0, width: 1.0 , height: self.bounds.height)
Expand Down
2 changes: 1 addition & 1 deletion CardParts/src/Classes/CardPartsTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public class CardPartsMintTheme: CardPartsTheme {
public var barColor: UIColor = UIColor.turboHeaderBlueColor
public var todayLineColor: UIColor = UIColor.Gray8
public var barHeight: CGFloat = 13.5
public var roundedCorners: Bool = false
public var roundedCorners: Bool = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably leave the default value as is?

public var showTodayLine: Bool = true
public var barCornerRadius: CGFloat? = nil

Expand Down