File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public extension RichTextViewComponent {
19
19
#if macOS
20
20
let range = NSRange ( location: selectedRange. location - 1 , length: 1 )
21
21
let safeRange = safeRange ( for: range)
22
- return richTextAttributes ( at: safeRange)
22
+ return richTextAttributes ( at: safeRange )
23
23
#else
24
24
return typingAttributes
25
25
#endif
Original file line number Diff line number Diff line change @@ -91,18 +91,23 @@ public extension RichTextStyleButton {
91
91
*/
92
92
struct Style {
93
93
94
+ #if macOS
95
+ private let systemSpecificTextColor : Color ? = Color ( NSColor . textColor)
96
+ #else
97
+ private let systemSpecificTextColor : Color ? = nil
98
+ #endif
94
99
/**
95
100
Create a rich text style button style.
96
-
101
+
97
102
- Parameters:
98
- - inactiveColor: The color to apply when the button is inactive, by default `.primary`.
99
- - activeColor: The color to apply when the button is active, by default `.blue`.
103
+ - inactiveColor: The color to apply when the button is inactive, by default `.primary`.
104
+ - activeColor: The color to apply when the button is active, by default `.blue`.
100
105
*/
101
106
public init (
102
107
inactiveColor: Color ? = nil ,
103
108
activeColor: Color = . blue
104
109
) {
105
- self . inactiveColor = inactiveColor
110
+ self . inactiveColor = inactiveColor ?? systemSpecificTextColor
106
111
self . activeColor = activeColor
107
112
}
108
113
You can’t perform that action at this time.
0 commit comments