HomeLayout.swift 1.3 KB

12345678910111213141516171819202122232425
  1. import CoreGraphics
  2. /// Fixed zone heights for the non-scrolling Home dashboard; the chart takes the remainder.
  3. enum HomeLayout {
  4. /// header slot: pump panel / glucose bobble / loop status; includes room
  5. /// for the sensor arc/tag overhanging the bobble
  6. static let headerHeight: CGFloat = 172
  7. /// meal panel slot (IOB / COB / delivery rate)
  8. static let mealSlotHeight: CGFloat = 44
  9. /// shared slot for adjustment panel and bolus progress (was 8% of screen height)
  10. static let bottomPanelHeight: CGFloat = 60
  11. /// stats banner slot below the adjustment panel (multi-use panel later)
  12. static let statsBannerHeight: CGFloat = 60
  13. /// clear air above, between, and below the bottom-zone panels
  14. static let bottomZonePadding: CGFloat = 10
  15. static var bottomZoneHeight: CGFloat { bottomPanelHeight + statsBannerHeight + 3 * bottomZonePadding }
  16. /// pull distance that triggers the forced loop
  17. static let refreshTriggerDistance: CGFloat = 70
  18. /// indicator row height while the loop runs
  19. static let refreshIndicatorHeight: CGFloat = 40
  20. /// minimum usable chart height; must stay below the natural SE allocation
  21. /// (598 − header − meal slot − bottom zone = 238) or the bottom zone overflows
  22. static let chartMinHeight: CGFloat = 220
  23. }