Widget preview: real small-tile proportions + iOS-default-style wallpaper
- Small widget card sized to actual system-small content (158×158pt + padding) instead of filling available width; medium keeps 338×158pt - Wallpaper now mimics the iOS default (dark navy→black in dark mode, soft blue-grey in light) via colorScheme-adaptive gradient - Added 10-widgets-light.png; re-captured 9-widgets-dark.png with data - 95/95 tests green; Release IPA rebuilt + re-served
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 2.4 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 516 KiB After Width: | Height: | Size: 2.4 MiB |
@@ -6,16 +6,12 @@ import WidgetKit
|
||||
/// code the widget extension renders) at small + medium sizes. Used for App
|
||||
/// Store screenshot captures; not reachable from the UI.
|
||||
struct WidgetMockScreen: View {
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
LinearGradient(
|
||||
colors: [
|
||||
Color(red: 0.09, green: 0.10, blue: 0.14),
|
||||
Color(red: 0.02, green: 0.03, blue: 0.06)
|
||||
],
|
||||
startPoint: .top, endPoint: .bottom
|
||||
)
|
||||
.ignoresSafeArea()
|
||||
wallpaper
|
||||
.ignoresSafeArea()
|
||||
|
||||
VStack(alignment: .leading, spacing: 26) {
|
||||
// App icon + name, home-screen style
|
||||
@@ -27,10 +23,10 @@ struct WidgetMockScreen: View {
|
||||
VStack(alignment: .leading, spacing: 3) {
|
||||
Text("FuelBoard")
|
||||
.font(.title2.bold())
|
||||
.foregroundStyle(.white)
|
||||
.foregroundStyle(.primary)
|
||||
Text("Cheapest fuel near you")
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(.white.opacity(0.65))
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
.padding(.top, 8)
|
||||
@@ -44,15 +40,46 @@ struct WidgetMockScreen: View {
|
||||
}
|
||||
}
|
||||
|
||||
/// iOS-default-style wallpaper (dark navy → black in dark mode, soft
|
||||
/// blue-grey in light), matching the system default look.
|
||||
private var wallpaper: some View {
|
||||
Group {
|
||||
if colorScheme == .dark {
|
||||
LinearGradient(
|
||||
colors: [
|
||||
Color(red: 0.09, green: 0.14, blue: 0.26),
|
||||
Color(red: 0.05, green: 0.08, blue: 0.15),
|
||||
Color(red: 0.02, green: 0.03, blue: 0.06)
|
||||
],
|
||||
startPoint: .topLeading, endPoint: .bottomTrailing
|
||||
)
|
||||
} else {
|
||||
LinearGradient(
|
||||
colors: [
|
||||
Color(red: 0.72, green: 0.80, blue: 0.94),
|
||||
Color(red: 0.85, green: 0.90, blue: 0.97),
|
||||
Color(red: 0.94, green: 0.96, blue: 0.99)
|
||||
],
|
||||
startPoint: .topLeading, endPoint: .bottomTrailing
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func widgetCard(_ family: WidgetFamily, label: String) -> some View {
|
||||
VStack(alignment: .leading, spacing: 10) {
|
||||
// Real widget proportions: system small content is 158×158pt,
|
||||
// medium 338×158pt (card adds the 14pt padding each side).
|
||||
let contentW: CGFloat = family == .systemSmall ? 158 : 338
|
||||
let cardW: CGFloat = contentW + 28
|
||||
let cardH: CGFloat = contentW + 28
|
||||
return VStack(alignment: .leading, spacing: 10) {
|
||||
Text(label.uppercased())
|
||||
.font(.caption.weight(.semibold))
|
||||
.tracking(1)
|
||||
.foregroundStyle(.white.opacity(0.5))
|
||||
.foregroundStyle(.secondary)
|
||||
FuelPriceWidgetContent(entry: mockEntry(family: family), family: family, isWidget: false)
|
||||
.padding(14)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.frame(width: cardW, height: cardH, alignment: .leading)
|
||||
.background(Color(.systemBackground), in: RoundedRectangle(cornerRadius: 24, style: .continuous))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
1786807226.939194: Module build session file for module cache at Path(_str: "/Users/apt/workspace/fuelboard/build-pm/ModuleCache.noindex")
|
||||
1786807715.783432: Module build session file for module cache at Path(_str: "/Users/apt/workspace/fuelboard/build-pm/ModuleCache.noindex")
|
||||
|
||||
BIN
Binary file not shown.
+1
-1
@@ -3,7 +3,7 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LastAccessedDate</key>
|
||||
<date>2026-08-15T15:20:26Z</date>
|
||||
<date>2026-08-15T15:28:33Z</date>
|
||||
<key>WorkspacePath</key>
|
||||
<string>/Users/apt/workspace/fuelboard/FuelBoard.xcodeproj</string>
|
||||
</dict>
|
||||
|
||||
Reference in New Issue
Block a user