Skip to content

Commit a7f6090

Browse files
committed
chore: polish windows support
1 parent 03d56f1 commit a7f6090

80 files changed

Lines changed: 4662 additions & 644 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/toolbox/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@nativescript/visionos": "~9.0.0",
1818
"@nativescript/vite": "file:../../dist/packages/vite",
1919
"@nativescript/webpack": "file:../../dist/packages/webpack5",
20-
"@nativescript/windows": "0.1.0-alpha.38",
20+
"@nativescript/windows": "0.1.0-alpha.102",
2121
"typescript": "~5.8.0"
2222
}
2323
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/* Import theme rules for Windows and include additional core rules so Windows gets the same
2+
look as other platforms without modifying the NativeScript runtime. */
3+
@import '../../../node_modules/nativescript-theme-core/css/core.light.windows.css';
4+
5+
/* Only include the Windows-specific theme file here. Importing iOS/Android theme
6+
files in the Windows platform CSS can introduce conflicting rules and
7+
unexpected colors; platform-specific CSS should be kept separate. */
8+
9+
/* Fallbacks / platform-specific tweaks for Windows host environments */
10+
11+
/* Ensure pages default to white background like the theme */
12+
.page, Page {
13+
background-color: #fff;
14+
}
15+
16+
/* Visibility helper used across the theme */
17+
.invisible {
18+
visibility: collapse;
19+
}
20+
21+
/* Simple shadow/gradient fallbacks — some Windows hosts may not fully support composition */
22+
.shadow {
23+
box-shadow: 0 2 6 rgba(0,0,0,0.2);
24+
border-radius: 4;
25+
}
26+
.gradient {
27+
background: linear-gradient(to bottom, #f12711, #f5af19);
28+
}
29+
30+
/* Make list items readable on Windows hosts */
31+
.list-group .list-group-item {
32+
padding: 16;
33+
color: #212121;
34+
}
35+
36+
/* TabView / SegmentedBar defaults */
37+
.tab-view {
38+
selected-color: #30bcff;
39+
tabs-background-color: #fff;
40+
}
41+
.tab-view .tab-view-item {
42+
background-color: #fff;
43+
}
44+
45+
/* Ensure ScrollView / ListView backgrounds don't hide content */
46+
ScrollView, ListView, Repeater {
47+
background-color: transparent;
48+
}
49+
50+
/* Make sure controls have a sensible default enabled/disabled appearance */
51+
Button[isEnabled=false], TextField[isEnabled=false], TextView[isEnabled=false] {
52+
opacity: 0.6;
53+
}

apps/toolbox/src/pages/a11y.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class AccessibilityModel extends Observable {
1717
accessibilityLiveRegions = AccessibilityLiveRegion;
1818
accessibilityRole = AccessibilityRole;
1919
accessibilityState = AccessibilityState;
20-
largeImageSrc = 'https://i.picsum.photos/id/669/5000/5000.jpg?hmac=VlpchW0ODhflKm0SKOYQrc8qysLWbqKmDS1MGT9apAc';
20+
largeImageSrc = 'https://picsum.photos/seed/VlpchW0ODhflKm0SKOYQrc8qysLWbqKmDS1MGT9apAc/5000/5000';
2121

2222
constructor() {
2323
super();
@@ -30,8 +30,8 @@ export class AccessibilityModel extends Observable {
3030

3131
// prettier-ignore
3232
this.notifyPropertyChange('largeImageSrc', checked ?
33-
'https://i.picsum.photos/id/669/5000/5000.jpg?hmac=VlpchW0ODhflKm0SKOYQrc8qysLWbqKmDS1MGT9apAc' :
34-
'https://i.picsum.photos/id/684/5000/5000.jpg?hmac=loiXO_OQ-y86XY_hc7p3qJdY39fSd9CuDM0iA_--P4Q');
33+
'https://picsum.photos/seed/VlpchW0ODhflKm0SKOYQrc8qysLWbqKmDS1MGT9apAc/5000/5000' :
34+
'https://picsum.photos/seed/loiXO_OQ-y86XY_hc7p3qJdY39fSd9CuDM0iA_--P4Q/5000/5000');
3535
}
3636

3737
openModal() {

apps/ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@nativescript/ios": "~9.0.0",
1616
"@nativescript/visionos": "~9.0.0",
1717
"@nativescript/webpack": "file:../../dist/packages/webpack5",
18+
"@nativescript/windows": "^0.1.0-alpha.98",
1819
"typescript": "~5.8.0"
1920
},
2021
"gitHead": "8ab7726d1ee9991706069c1359c552e67ee0d1a4",

packages/core/color/index.windows.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ export class Color extends ColorBase implements IColor {
66

77
get windows(): Windows.UI.Color {
88
if (!this._windows) {
9-
this._windows = Windows.UI.ColorHelper.FromArgb(Math.round(this.a * 255), Math.round(this.r * 255), Math.round(this.g * 255), Math.round(this.b * 255));
9+
this._windows = Windows.UI.ColorHelper.FromArgb(Math.round(this.a), Math.round(this.r), Math.round(this.g), Math.round(this.b));
1010
}
1111

1212
return this._windows;
1313
}
1414

1515
get windowsArgb(): number {
16-
return ((this.windows.A & 0xff) << 24) | ((this.windows.R & 0xff) << 16) | ((this.windows.G & 0xff) << 8) | (this.windows.B & 0xff) >>> 0;
16+
return ((((this.windows.A & 0xff) << 24) | ((this.windows.R & 0xff) << 16) | ((this.windows.G & 0xff) << 8) | (this.windows.B & 0xff)) >>> 0);
1717
}
1818

1919
public static fromWindowsColor(value: Windows.UI.Color): Color {
20-
return new Color(Math.round(value.A / 255), Math.round(value.R / 255), Math.round(value.G / 255), Math.round(value.B / 255));
20+
return new Color(Math.round(value.A), Math.round(value.R), Math.round(value.G), Math.round(value.B));
2121
}
2222
}

0 commit comments

Comments
 (0)