Skip to content

Commit 4678381

Browse files
committed
Fix colours and imports on macOS
1 parent 9c94ac0 commit 4678381

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

Sources/Flow/Nodes/IntNode.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
//
77

88
import SwiftUI
9+
#if canImport(UIKit)
10+
import UIKit
11+
#elseif canImport(AppKit)
12+
import AppKit
13+
#endif
914

1015
public class IntNode: BaseNode {
1116

@@ -48,7 +53,12 @@ public class IntNode: BaseNode {
4853
Port(name: "Value", type: .output, valueType: Int.self, parentNodeId: id)
4954
]
5055

56+
#if canImport(UIKit)
5157
titleBarColor = Color(UIColor.systemMint)
58+
#elseif canImport(AppKit)
59+
titleBarColor = Color(NSColor.systemMint)
60+
#endif
61+
5262

5363
middleView = AnyView(IntMiddleView(node: self))
5464

Sources/Flow/Nodes/StringNode.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
import SwiftUI
99
import Combine
10+
#if canImport(UIKit)
11+
import UIKit
12+
#elseif canImport(AppKit)
13+
import AppKit
14+
#endif
1015

1116
public class StringNode: BaseNode {
1217

@@ -34,7 +39,11 @@ public class StringNode: BaseNode {
3439
Port(name: "Value", type: .output, valueType: String.self, parentNodeId: id)
3540
]
3641

42+
#if canImport(UIKit)
3743
titleBarColor = Color(UIColor.systemTeal)
44+
#elseif canImport(AppKit)
45+
titleBarColor = Color(NSColor.systemTeal)
46+
#endif
3847

3948
middleView = AnyView(StringMiddleView(node: self))
4049

Sources/Flow/Nodes/TriggerButtonNode.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
import SwiftUI
99
import Combine
10+
#if canImport(UIKit)
11+
import UIKit
12+
#elseif canImport(AppKit)
13+
import AppKit
14+
#endif
1015

1116
public class TriggerButtonNode: BaseNode {
1217

@@ -31,7 +36,11 @@ public class TriggerButtonNode: BaseNode {
3136
Port(name: "Trigger", type: .output, valueType: Void.self, parentNodeId: id)
3237
]
3338

39+
#if canImport(UIKit)
3440
titleBarColor = Color(UIColor.systemOrange)
41+
#elseif canImport(AppKit)
42+
titleBarColor = Color(NSColor.systemOrange)
43+
#endif
3544

3645
middleView = AnyView(TriggerMiddleView(node: self))
3746

0 commit comments

Comments
 (0)