adds schema view and schema generating command
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
import SwiftUI
|
||||
|
||||
/// The Git view's icons, drawn on Lucide's 24-unit grid at stroke 1.75; the flag is a plain pennant.
|
||||
/// Icons with arcs Lucide draws as curves (cloud, eraser) use the nearest SF Symbol.
|
||||
/// The Git and Schema views' icons, drawn on Lucide's 24-unit grid at stroke 1.75; the flag is a plain pennant.
|
||||
/// Icons with arcs Lucide draws as curves (cloud, eraser, sparkle) use the nearest SF Symbol.
|
||||
enum GitIcon {
|
||||
case gitBranch, cloud, arrowDownToLine, arrowUpFromLine, minimize, chevronDown, chevronRight, eraser, check, flag
|
||||
case database, terminal, search, minus, plus, x, sparkle
|
||||
|
||||
fileprivate var symbol: String? {
|
||||
switch self {
|
||||
case .cloud: "cloud"
|
||||
case .eraser: "eraser"
|
||||
case .sparkle: "sparkle"
|
||||
default: nil
|
||||
}
|
||||
}
|
||||
@@ -49,7 +51,32 @@ enum GitIcon {
|
||||
case .flag:
|
||||
line((5, 22), (5, 3))
|
||||
line((5, 4), (19, 9), (5, 14))
|
||||
case .cloud, .eraser:
|
||||
case .database:
|
||||
path.addEllipse(in: CGRect(x: 3 * k, y: 2 * k, width: 18 * k, height: 6 * k))
|
||||
line((3, 5), (3, 19))
|
||||
line((21, 5), (21, 19))
|
||||
for y in [12.0, 19.0] {
|
||||
// A lower half-ellipse, 9 wide and 3 deep each side, as two Bézier quarters.
|
||||
let c = 0.5523
|
||||
path.move(to: p(3, y))
|
||||
path.addCurve(to: p(12, y + 3), control1: p(3, y + 3 * c), control2: p(12 - 9 * c, y + 3))
|
||||
path.addCurve(to: p(21, y), control1: p(12 + 9 * c, y + 3), control2: p(21, y + 3 * c))
|
||||
}
|
||||
case .terminal:
|
||||
line((4, 17), (10, 11), (4, 5))
|
||||
line((12, 19), (20, 19))
|
||||
case .search:
|
||||
path.addEllipse(in: CGRect(x: 3 * k, y: 3 * k, width: 16 * k, height: 16 * k))
|
||||
line((21, 21), (16.65, 16.65))
|
||||
case .minus:
|
||||
line((5, 12), (19, 12))
|
||||
case .plus:
|
||||
line((5, 12), (19, 12))
|
||||
line((12, 5), (12, 19))
|
||||
case .x:
|
||||
line((18, 6), (6, 18))
|
||||
line((6, 6), (18, 18))
|
||||
case .cloud, .eraser, .sparkle:
|
||||
break
|
||||
}
|
||||
return path
|
||||
|
||||
Reference in New Issue
Block a user