Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions Sources/DashUIKit/Components/Icons/XmarkIcon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,25 @@ import SwiftUI
/// A code-drawn "✕" (close) icon. Mirrors the source SVG (9×9 viewBox, two diagonals
/// inset from 0.75 to 7.75, round caps/joins). Scales cleanly to any `size`.
@available(iOS 14, macOS 11, *)
struct XmarkIcon: View {
var size: CGFloat = 9
var color: Color = Color.dash.primaryText
var lineWidth: CGFloat = 1.5
public struct XmarkIcon: View {
public var size: CGFloat = 9
public var color: Color = Color.dash.primaryText
public var lineWidth: CGFloat = 1.5

var body: some View {
/// A public struct gets no public memberwise initializer, so this one is
/// written out to keep the call site unchanged for module-internal users
/// and available to app code.
public init(
size: CGFloat = 9,
color: Color = Color.dash.primaryText,
lineWidth: CGFloat = 1.5
) {
self.size = size
self.color = color
self.lineWidth = lineWidth
}

public var body: some View {
XmarkShape()
.stroke(color, style: StrokeStyle(lineWidth: lineWidth, lineCap: .round, lineJoin: .round))
.frame(width: size, height: size)
Expand Down
1 change: 1 addition & 0 deletions Sources/DashUIKit/Foundation/Icon_DashUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public enum DashIcon {
case security = "menu-security"
case send = "menu-send"
case sendAccount = "menu-send-account"
case sendAccountDisabled = "menu-send-account-disabled"
case sendAddress = "menu-send-address"
case sendDisabled = "menu-send-disabled"
case settings = "menu-settings"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "menu-send-account-disabled.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "menu-send-account-disabled@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "menu-send-account-disabled@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions docs/feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ ErrorIllustration()

## XmarkIcon

File `Components/Icons/XmarkIcon.swift` · `@available(iOS 14, macOS 11, *)` · internal
File `Components/Icons/XmarkIcon.swift` · `@available(iOS 14, macOS 11, *)` · public

A code-drawn "✕" close icon (a `Shape` with two round-capped diagonals, mirroring a 9×9
SVG), so it scales cleanly to any size without an asset. Used by `Toast`'s dismiss button.
Expand All @@ -107,5 +107,8 @@ SVG), so it scales cleanly to any size without an asset. Used by `Toast`'s dismi
XmarkIcon(size: 24, color: .white, lineWidth: 2)
```

> Internal to the module (not part of the public API) — reach for the bundled
> `navigationbar-close` asset or an SF Symbol from app code.
> Prefer this over the bundled `navigationbar-close` asset when the close control
> is drawn at a non-standard size or needs to take the surrounding tint: being a
> `Shape`, it stays crisp at any `size` and honours `color` / `lineWidth`. The
> asset remains the right choice where the navigation bar's exact artwork is
> wanted.
Loading