react-native-windows 0.80.0 → 0.80.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Microsoft.ReactNative/Fabric/Composition/TextDrawing.cpp +5 -37
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.cpp +0 -17
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.h +0 -3
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/package.json +1 -1
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
#include "TextDrawing.h"
|
|
8
8
|
|
|
9
9
|
#include <AutoDraw.h>
|
|
10
|
-
#include <Fabric/platform/react/renderer/graphics/PlatformColorUtils.h>
|
|
11
10
|
#include <Utils/ValueUtils.h>
|
|
12
11
|
#include <unicode.h>
|
|
13
12
|
#include <windows.ui.composition.interop.h>
|
|
@@ -36,27 +35,11 @@ void RenderText(
|
|
|
36
35
|
// to cache and reuse a brush across all text elements instead, taking care to recreate
|
|
37
36
|
// it in the event of device removed.
|
|
38
37
|
winrt::com_ptr<ID2D1SolidColorBrush> brush;
|
|
39
|
-
|
|
40
|
-
// Check if we should use theme-aware default color instead of hardcoded black
|
|
41
|
-
bool useDefaultColor = false;
|
|
42
38
|
if (textAttributes.foregroundColor) {
|
|
43
|
-
auto &color = *textAttributes.foregroundColor;
|
|
44
|
-
// If it's black (or very dark) without explicit PlatformColor, use theme-aware color
|
|
45
|
-
if (color.m_platformColor.empty() && color.m_color.R <= 10 && color.m_color.G <= 10 && color.m_color.B <= 10) {
|
|
46
|
-
useDefaultColor = true;
|
|
47
|
-
}
|
|
48
|
-
} else {
|
|
49
|
-
useDefaultColor = true;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (useDefaultColor) {
|
|
53
|
-
// Use theme-aware TextFillColorPrimary which adapts to light/dark mode
|
|
54
|
-
auto d2dColor = theme.D2DPlatformColor("TextFillColorPrimary");
|
|
55
|
-
winrt::check_hresult(deviceContext.CreateSolidColorBrush(d2dColor, brush.put()));
|
|
56
|
-
} else {
|
|
57
|
-
// User set explicit color or PlatformColor - use it
|
|
58
39
|
auto color = theme.D2DColor(*textAttributes.foregroundColor);
|
|
59
40
|
winrt::check_hresult(deviceContext.CreateSolidColorBrush(color, brush.put()));
|
|
41
|
+
} else {
|
|
42
|
+
winrt::check_hresult(deviceContext.CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::Black, 1.0f), brush.put()));
|
|
60
43
|
}
|
|
61
44
|
|
|
62
45
|
if (textAttributes.textDecorationLineType) {
|
|
@@ -89,27 +72,12 @@ void RenderText(
|
|
|
89
72
|
(fragment.textAttributes.foregroundColor != textAttributes.foregroundColor) ||
|
|
90
73
|
!isnan(fragment.textAttributes.opacity)) {
|
|
91
74
|
winrt::com_ptr<ID2D1SolidColorBrush> fragmentBrush;
|
|
92
|
-
|
|
93
|
-
// Check if we should use theme-aware default color for this fragment
|
|
94
|
-
bool useFragmentDefaultColor = false;
|
|
95
75
|
if (fragment.textAttributes.foregroundColor) {
|
|
96
|
-
auto &color = *fragment.textAttributes.foregroundColor;
|
|
97
|
-
// If it's black (or very dark) without explicit PlatformColor, use theme-aware color
|
|
98
|
-
if (color.m_platformColor.empty() && color.m_color.R <= 10 && color.m_color.G <= 10 && color.m_color.B <= 10) {
|
|
99
|
-
useFragmentDefaultColor = true;
|
|
100
|
-
}
|
|
101
|
-
} else {
|
|
102
|
-
useFragmentDefaultColor = true;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (useFragmentDefaultColor) {
|
|
106
|
-
// Use theme-aware TextFillColorPrimary which adapts to light/dark mode
|
|
107
|
-
auto d2dColor = theme.D2DPlatformColor("TextFillColorPrimary");
|
|
108
|
-
winrt::check_hresult(deviceContext.CreateSolidColorBrush(d2dColor, fragmentBrush.put()));
|
|
109
|
-
} else {
|
|
110
|
-
// User set explicit color or PlatformColor - use it
|
|
111
76
|
auto color = theme.D2DColor(*fragment.textAttributes.foregroundColor);
|
|
112
77
|
winrt::check_hresult(deviceContext.CreateSolidColorBrush(color, fragmentBrush.put()));
|
|
78
|
+
} else {
|
|
79
|
+
winrt::check_hresult(
|
|
80
|
+
deviceContext.CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::Black, 1.0f), fragmentBrush.put()));
|
|
113
81
|
}
|
|
114
82
|
|
|
115
83
|
if (fragment.textAttributes.textDecorationLineType) {
|
package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.cpp
CHANGED
|
@@ -189,21 +189,4 @@ SharedColor GetTextInputPlaceholderColor(bool isFocused, const winrt::Windows::U
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
SharedColor GetDefaultTextColor() {
|
|
193
|
-
// In high contrast mode, always use system WindowText for accessibility
|
|
194
|
-
auto accessibilitySettings{winrt::Windows::UI::ViewManagement::AccessibilitySettings()};
|
|
195
|
-
if (accessibilitySettings.HighContrast()) {
|
|
196
|
-
auto uiSettings{winrt::Windows::UI::ViewManagement::UISettings()};
|
|
197
|
-
auto windowText = uiSettings.UIElementColor(winrt::Windows::UI::ViewManagement::UIElementType::WindowText);
|
|
198
|
-
return hostPlatformColorFromRGBA(windowText.R, windowText.G, windowText.B, windowText.A);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// Use Windows 11 design system semantic color TextFillColorPrimary
|
|
202
|
-
// This automatically adapts to light/dark mode themes:
|
|
203
|
-
// - Light mode: rgba(0, 0, 0, 0.894) - nearly black for good contrast
|
|
204
|
-
// - Dark mode: rgba(255, 255, 255, 1.0) - white for readability
|
|
205
|
-
auto color = ResolvePlatformColor({"TextFillColorPrimary"});
|
|
206
|
-
return hostPlatformColorFromRGBA(color.R, color.G, color.B, color.A);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
192
|
} // namespace facebook::react
|
|
@@ -17,7 +17,4 @@ winrt::Windows::UI::Color ResolvePlatformColor(const std::vector<std::string> &s
|
|
|
17
17
|
// Get appropriate placeholder text color for TextInput based on focus state and background
|
|
18
18
|
SharedColor GetTextInputPlaceholderColor(bool isFocused, const winrt::Windows::UI::Color &backgroundColor = {});
|
|
19
19
|
|
|
20
|
-
// Get default text foreground color for Text component (theme-aware)
|
|
21
|
-
SharedColor GetDefaultTextColor();
|
|
22
|
-
|
|
23
20
|
} // namespace facebook::react
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.80.
|
|
13
|
+
<ReactNativeWindowsVersion>0.80.1</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>80</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>1</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>220e035c393ea33ba5ddbbf668a576f4334b8928</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|