Skip to content

Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit

fix(ui): smooth the mark's reflection and center it in its tile

raymondchinsadaede8ce6a6
diff --git a/app/Sources/BridgeplayUI/BridgeplayTheme.swift b/app/Sources/BridgeplayUI/BridgeplayTheme.swift
index a5ce0f1..261657c 100644
--- a/app/Sources/BridgeplayUI/BridgeplayTheme.swift
+++ b/app/Sources/BridgeplayUI/BridgeplayTheme.swift
@@ -134,15 +134,17 @@ public struct BridgeShape: Shape {
public func path(in rect: CGRect) -> Path {
let s = min(rect.width, rect.height) / 24
+ // 2.04, not 2.4, puts the drawn mark (strokes included) in the middle of the box.
func p(_ x: CGFloat, _ y: CGFloat) -> CGPoint {
- CGPoint(x: rect.minX + (2.4 + x * 0.8) * s, y: rect.minY + (2.4 + y * 0.8) * s)
+ CGPoint(x: rect.minX + (2.4 + x * 0.8) * s, y: rect.minY + (2.04 + y * 0.8) * s)
}
var path = Path()
switch part {
case .deck:
+ // The towers stop at 4.6, under the cable, so no cap shows around its peaks.
path.move(to: p(2, 14)); path.addLine(to: p(22, 14))
- path.move(to: p(6.5, 4)); path.addLine(to: p(6.5, 14))
- path.move(to: p(17.5, 4)); path.addLine(to: p(17.5, 14))
+ path.move(to: p(6.5, 4.6)); path.addLine(to: p(6.5, 14))
+ path.move(to: p(17.5, 4.6)); path.addLine(to: p(17.5, 14))
case .cable:
path.move(to: p(2, 7))
path.addCurve(to: p(6.5, 4), control1: p(4.5, 7), control2: p(5.5, 4))
@@ -150,13 +152,15 @@ public struct BridgeShape: Shape {
path.addCurve(to: p(17.5, 4), control1: p(14.5, 11), control2: p(16.5, 4))
path.addCurve(to: p(22, 7), control1: p(18.5, 4), control2: p(19.5, 7))
case .echo:
- path.move(to: p(6.5, 16.5)); path.addLine(to: p(6.5, 19.5))
- path.move(to: p(17.5, 16.5)); path.addLine(to: p(17.5, 19.5))
+ // One smooth arch: it keeps sloping where it meets the pillars instead of
+ // flattening into a step, and the pillars end on it.
+ path.move(to: p(6.5, 16.5)); path.addLine(to: p(6.5, 19.4))
+ path.move(to: p(17.5, 16.5)); path.addLine(to: p(17.5, 19.4))
path.move(to: p(2, 21))
- path.addCurve(to: p(6.5, 19.4), control1: p(4.5, 21), control2: p(5.5, 19.4))
- path.addCurve(to: p(12, 17.3), control1: p(7.5, 19.4), control2: p(9.5, 17.3))
- path.addCurve(to: p(17.5, 19.4), control1: p(14.5, 17.3), control2: p(16.5, 19.4))
- path.addCurve(to: p(22, 21), control1: p(18.5, 19.4), control2: p(19.5, 21))
+ path.addCurve(to: p(6.5, 19.4), control1: p(3.5, 21), control2: p(5, 19.955))
+ path.addCurve(to: p(12, 17.3), control1: p(8.33, 18.72), control2: p(10.17, 17.3))
+ path.addCurve(to: p(17.5, 19.4), control1: p(13.83, 17.3), control2: p(15.67, 18.72))
+ path.addCurve(to: p(22, 21), control1: p(19, 19.955), control2: p(20.5, 21))
}
return path
}
@@ -181,6 +185,45 @@ public struct BridgeplayMark: View {
}
public var body: some View {
+ BridgeStrokes(size: size)
+ .frame(width: size, height: size)
+ .background(RoundedRectangle(cornerRadius: size * 0.25, style: .continuous).fill(.black))
+ .overlay(RoundedRectangle(cornerRadius: size * 0.25, style: .continuous).strokeBorder(BP.lineStrong, lineWidth: 1))
+ .accessibilityHidden(true)
+ }
+}
+
+// The mark on the app icon's glass tile. Shown on its own only, never next to the wordmark.
+public struct GlassMark: View {
+ public var size: CGFloat
+
+ public init(size: CGFloat) {
+ self.size = size
+ }
+
+ public var body: some View {
+ let tile = RoundedRectangle(cornerRadius: size * 0.25, style: .continuous)
+ ZStack {
+ tile.fill(LinearGradient(stops: [.init(color: Color(hex: 0x232326), location: 0),
+ .init(color: Color(hex: 0x0B0B0D), location: 0.7),
+ .init(color: Color(hex: 0x060607), location: 1)],
+ startPoint: .top, endPoint: .bottom))
+ tile.fill(RadialGradient(colors: [.white.opacity(0.16), .clear], center: UnitPoint(x: 0.5, y: -0.1),
+ startRadius: 0, endRadius: size * 0.66))
+ BridgeStrokes(size: size)
+ .shadow(color: .black.opacity(0.6), radius: size * 0.012, y: size * 0.01)
+ }
+ .frame(width: size, height: size)
+ .overlay(tile.strokeBorder(.white.opacity(0.13), lineWidth: 1))
+ .shadow(color: .black.opacity(0.7), radius: size * 0.08, y: size * 0.05)
+ .accessibilityHidden(true)
+ }
+}
+
+private struct BridgeStrokes: View {
+ let size: CGFloat
+
+ var body: some View {
ZStack {
BridgeShape(part: .deck)
.stroke(BP.fg, style: StrokeStyle(lineWidth: BridgeShape.width(.deck, size: size), lineCap: .round))
@@ -189,9 +232,5 @@ public struct BridgeplayMark: View {
BridgeShape(part: .echo)
.stroke(BP.fg.opacity(0.35), style: StrokeStyle(lineWidth: BridgeShape.width(.echo, size: size), lineCap: .round))
}
- .frame(width: size, height: size)
- .background(RoundedRectangle(cornerRadius: size * 0.25, style: .continuous).fill(.black))
- .overlay(RoundedRectangle(cornerRadius: size * 0.25, style: .continuous).strokeBorder(BP.lineStrong, lineWidth: 1))
- .accessibilityHidden(true)
}
}
diff --git a/helpers/icon/bridgeplay-mark.svg b/helpers/icon/bridgeplay-mark.svg
index c11c624..9f8321a 100644
--- a/helpers/icon/bridgeplay-mark.svg
+++ b/helpers/icon/bridgeplay-mark.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect width="24" height="24" rx="6" fill="#000"/><g transform="translate(2.4 2.4) scale(.8)"><path d="M2 14h20" stroke="#f5f5f7" stroke-width="1.8" stroke-linecap="round"/><path d="M6.5 4v10M17.5 4v10" stroke="#f5f5f7" stroke-width="1.8" stroke-linecap="round"/><path d="M2 7c2.5 0 3.5-3 4.5-3S9.5 11 12 11s4.5-7 5.5-7 2 3 4.5 3" fill="none" stroke="#f5f5f7" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/><path d="M6.5 16.5v3M17.5 16.5v3M2 21c2.5 0 3.5-1.6 4.5-1.6S9.5 17.3 12 17.3s4.5 2.1 5.5 2.1 2 1.6 4.5 1.6" fill="none" stroke="#f5f5f7" stroke-width="1.2" stroke-linecap="round" opacity=".35"/></g></svg>
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect width="24" height="24" rx="6" fill="#000"/><g transform="translate(2.4 2.04) scale(.8)"><path d="M2 14h20" stroke="#f5f5f7" stroke-width="1.8" stroke-linecap="round"/><path d="M6.5 4.6v9.4M17.5 4.6v9.4" stroke="#f5f5f7" stroke-width="1.8" stroke-linecap="round"/><path d="M2 7c2.5 0 3.5-3 4.5-3S9.5 11 12 11s4.5-7 5.5-7 2 3 4.5 3" fill="none" stroke="#f5f5f7" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/><path d="M6.5 16.5v2.9M17.5 16.5v2.9M2 21C3.5 21 5 19.955 6.5 19.4C8.33 18.72 10.17 17.3 12 17.3C13.83 17.3 15.67 18.72 17.5 19.4C19 19.955 20.5 21 22 21" fill="none" stroke="#f5f5f7" stroke-width="1.2" stroke-linecap="round" opacity=".35"/></g></svg>
diff --git a/installer/native/READ ME FIRST.html b/installer/native/READ ME FIRST.html
index 7516d29..a55acee 100644
--- a/installer/native/READ ME FIRST.html
+++ b/installer/native/READ ME FIRST.html
@@ -78,7 +78,7 @@
<body>
<main>
<span class="wordmark">
- <svg class="mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M2 14h20" stroke="#f5f5f7" stroke-width="1.8" stroke-linecap="round"/><path d="M6.5 4v10M17.5 4v10" stroke="#f5f5f7" stroke-width="1.8" stroke-linecap="round"/><path d="M2 7c2.5 0 3.5-3 4.5-3S9.5 11 12 11s4.5-7 5.5-7 2 3 4.5 3" fill="none" stroke="#f5f5f7" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/><path d="M6.5 16.5v3M17.5 16.5v3M2 21c2.5 0 3.5-1.6 4.5-1.6S9.5 17.3 12 17.3s4.5 2.1 5.5 2.1 2 1.6 4.5 1.6" fill="none" stroke="#f5f5f7" stroke-width="1.2" stroke-linecap="round" opacity=".35"/></svg>
+ <svg class="mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M2 14h20" stroke="#f5f5f7" stroke-width="1.8" stroke-linecap="round"/><path d="M6.5 4.6v9.4M17.5 4.6v9.4" stroke="#f5f5f7" stroke-width="1.8" stroke-linecap="round"/><path d="M2 7c2.5 0 3.5-3 4.5-3S9.5 11 12 11s4.5-7 5.5-7 2 3 4.5 3" fill="none" stroke="#f5f5f7" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/><path d="M6.5 16.5v2.9M17.5 16.5v2.9M2 21C3.5 21 5 19.955 6.5 19.4C8.33 18.72 10.17 17.3 12 17.3C13.83 17.3 15.67 18.72 17.5 19.4C19 19.955 20.5 21 22 21" fill="none" stroke="#f5f5f7" stroke-width="1.2" stroke-linecap="round" opacity=".35"/></svg>
Bridgeplay
</span>