mirror of
https://github.com/ninxsoft/Mist.git
synced 2025-05-19 01:35:24 -04:00
Update TextRibbon.swift (#65)
* Update TextRibbon.swift * Add back rotation effect * Added comment for future reference * Fixed typo * Fix text selection on TextRibbon
This commit is contained in:
parent
f215031df1
commit
e3a6d930d5
2 changed files with 4 additions and 2 deletions
|
@ -10,15 +10,16 @@ import SwiftUI
|
||||||
struct TextRibbon: View {
|
struct TextRibbon: View {
|
||||||
var title: String
|
var title: String
|
||||||
var length: CGFloat
|
var length: CGFloat
|
||||||
private let degrees: CGFloat = -45
|
private let degrees: CGFloat = -45.001
|
||||||
|
// app crashes when value is exactly -45 ¯\_(ツ)_/¯
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Text(title)
|
Text(title)
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
.frame(width: length)
|
.frame(width: length)
|
||||||
.background(Color.accentColor)
|
.background(Color.accentColor)
|
||||||
.rotationEffect(.degrees(degrees))
|
|
||||||
.mask(Circle().frame(width: length, height: length))
|
.mask(Circle().frame(width: length, height: length))
|
||||||
|
.rotationEffect(.degrees(degrees))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ struct ListRowDetail: View {
|
||||||
ScaledImage(name: imageName, length: length)
|
ScaledImage(name: imageName, length: length)
|
||||||
if beta {
|
if beta {
|
||||||
TextRibbon(title: "BETA", length: length * 0.9)
|
TextRibbon(title: "BETA", length: length * 0.9)
|
||||||
|
.textSelection(.disabled)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HStack(spacing: spacing) {
|
HStack(spacing: spacing) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue