Skip to content
Draft
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "trezor-card.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"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.
12 changes: 12 additions & 0 deletions Bitkit/Assets.xcassets/icons/arrow-widgets.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "arrow-widgets.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "suggestions-widget.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
2 changes: 1 addition & 1 deletion Bitkit/Components/CheckboxRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct CheckboxRow: View {
)

if isChecked {
Image("checkmark")
Image("check-mark")
.resizable()
.frame(width: 22, height: 22)
.foregroundColor(.brandAccent)
Expand Down
47 changes: 0 additions & 47 deletions Bitkit/Components/Core/ButtonDetectionModifier.swift

This file was deleted.

68 changes: 0 additions & 68 deletions Bitkit/Components/Core/ButtonLocationTracking.swift

This file was deleted.

35 changes: 35 additions & 0 deletions Bitkit/Components/Core/DragHandleTracking.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import SwiftUI

/// Preference key for tracking drag handle location in a coordinate space.
/// Used so only the drag handle (e.g. burger icon) starts a reorder drag.
struct DragHandlePreferenceKey: PreferenceKey {
static var defaultValue: [CGRect] = []
static func reduce(value: inout [CGRect], nextValue: () -> [CGRect]) {
value.append(contentsOf: nextValue())
}
}

private struct DragHandleLocationModifier: ViewModifier {
let coordinateSpace: String

func body(content: Content) -> some View {
content
.background(
GeometryReader { geometry in
Color.clear
.preference(
key: DragHandlePreferenceKey.self,
value: [geometry.frame(in: .named(coordinateSpace))]
)
}
)
}
}

public extension View {
/// Reports this view's frame as the drag handle in the given coordinate space.
/// Only touches that start inside this frame will begin a reorder drag.
func trackDragHandle(in coordinateSpace: String = "dragSpace") -> some View {
modifier(DragHandleLocationModifier(coordinateSpace: coordinateSpace))
}
}
Loading
Loading