Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Commit

Permalink
Minor home view UI updates
Browse files Browse the repository at this point in the history
* Replace COB and IOB labels with SF Symbols (syringe, fork+knife)
* Make BG bobble slightly smaller
  • Loading branch information
dnzxy committed Dec 24, 2023
1 parent 282f29c commit afbecb5
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 48 deletions.
3 changes: 1 addition & 2 deletions FreeAPS/Sources/Modules/DataTable/DataTableStateModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ extension DataTable {
@Published var externalInsulinAmount: Decimal = 0
@Published var externalInsulinDate = Date()
@Published var historyLayout: HistoryLayout = .twoTabs

var units: GlucoseUnits = .mmolL


override func subscribe() {
units = settingsManager.settings.units
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ struct CircleShape: View {
) : .white

Circle()
.stroke(gradient, lineWidth: 6)
.stroke(gradient, lineWidth: 5)
.background(Circle().fill(colorBackground))
.frame(width: 130, height: 130)
.frame(width: 115, height: 115)
}
}

Expand All @@ -213,8 +213,8 @@ struct TriangleShape: View {
var body: some View {
Triangle()
.fill(color)
.frame(width: 35, height: 35)
.frame(width: 50, height: 35)
.rotationEffect(.degrees(90))
.offset(x: 70)
.offset(x: 55)
}
}
84 changes: 42 additions & 42 deletions FreeAPS/Sources/Modules/Home/View/Header/PumpView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,67 +39,67 @@ struct PumpView: View {

var body: some View {
HStack {
Text("IOB").font(.callout).foregroundColor(.secondary)
Image(systemName: "syringe.fill")
.font(.system(size: 15))
.foregroundColor(Color.insulin)
Text(
(numberFormatter.string(from: (state.suggestion?.iob ?? 0) as NSNumber) ?? "0") +
NSLocalizedString(" U", comment: "Insulin unit")
)
.font(.callout).fontWeight(.bold)
}

Spacer()
Spacer()

Text("COB").font(.callout).foregroundColor(.secondary)
HStack {
Image(systemName: "fork.knife")
.font(.system(size: 15))
.foregroundColor(.loopYellow)
Text(
(numberFormatter.string(from: (state.suggestion?.cob ?? 0) as NSNumber) ?? "0") +
NSLocalizedString(" g", comment: "gram of carbs")
)
.font(.callout).fontWeight(.bold)
}

Spacer()

if let reservoir = reservoir {
HStack {
Image(systemName: "drop.fill")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(maxHeight: 15)
.foregroundColor(reservoirColor)
if reservoir == 0xDEAD_BEEF {
Text("50+ " + NSLocalizedString("U", comment: "Insulin unit")).font(.callout).fontWeight(.bold)
} else {
Text(
reservoirFormatter
.string(from: reservoir as NSNumber)! + NSLocalizedString(" U", comment: "Insulin unit")
)
.font(.callout).fontWeight(.bold)
}
Spacer()

if let reservoir = reservoir {
HStack {
Image(systemName: "drop.fill")
.font(.system(size: 15))
.foregroundColor(reservoirColor)
if reservoir == 0xDEAD_BEEF {
Text("50+ " + NSLocalizedString("U", comment: "Insulin unit")).font(.callout).fontWeight(.bold)
} else {
Text(
reservoirFormatter
.string(from: reservoir as NSNumber)! + NSLocalizedString(" U", comment: "Insulin unit")
)
.font(.callout).fontWeight(.bold)
}
}
}

Spacer()

if let battery = battery, battery.display ?? false, expiresAtDate == nil {
HStack {
Image(systemName: "battery.100")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(maxHeight: 15)
.foregroundColor(batteryColor)
Text("\(Int(battery.percent ?? 100)) %").font(.callout)
.fontWeight(.bold)
}
Spacer()

if let battery = battery, battery.display ?? false, expiresAtDate == nil {
HStack {
Image(systemName: "battery.100")
.font(.system(size: 15))
.foregroundColor(batteryColor)
Text("\(Int(battery.percent ?? 100)) %").font(.callout)
.fontWeight(.bold)
}
}

if let date = expiresAtDate {
HStack {
Image(systemName: "stopwatch.fill")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(maxHeight: 15)
.foregroundColor(timerColor)
if let date = expiresAtDate {
HStack {
Image(systemName: "stopwatch.fill")
.font(.system(size: 15))
.foregroundColor(timerColor)

Text(remainingTimeString(time: date.timeIntervalSince(timerDate))).font(.callout).fontWeight(.bold)
}
Text(remainingTimeString(time: date.timeIntervalSince(timerDate))).font(.callout).fontWeight(.bold)
}
}
}
Expand Down

0 comments on commit afbecb5

Please sign in to comment.