diff --git a/apps/toolbox/package.json b/apps/toolbox/package.json index 331ac9ac73..45a7effdd7 100644 --- a/apps/toolbox/package.json +++ b/apps/toolbox/package.json @@ -17,6 +17,7 @@ "@nativescript/visionos": "~9.0.0", "@nativescript/vite": "file:../../dist/packages/vite", "@nativescript/webpack": "file:../../dist/packages/webpack5", + "@nativescript/windows": "0.1.0-alpha.122", "typescript": "~5.8.0" } } diff --git a/apps/toolbox/src/_app-platform.windows.css b/apps/toolbox/src/_app-platform.windows.css new file mode 100644 index 0000000000..2a82ae04f6 --- /dev/null +++ b/apps/toolbox/src/_app-platform.windows.css @@ -0,0 +1,53 @@ +/* Import theme rules for Windows and include additional core rules so Windows gets the same + look as other platforms without modifying the NativeScript runtime. */ +@import '../../../node_modules/nativescript-theme-core/css/core.light.windows.css'; + +/* Only include the Windows-specific theme file here. Importing iOS/Android theme + files in the Windows platform CSS can introduce conflicting rules and + unexpected colors; platform-specific CSS should be kept separate. */ + +/* Fallbacks / platform-specific tweaks for Windows host environments */ + +/* Ensure pages default to white background like the theme */ +.page, Page { + background-color: #fff; +} + +/* Visibility helper used across the theme */ +.invisible { + visibility: collapse; +} + +/* Simple shadow/gradient fallbacks — some Windows hosts may not fully support composition */ +.shadow { + box-shadow: 0 2 6 rgba(0,0,0,0.2); + border-radius: 4; +} +.gradient { + background: linear-gradient(to bottom, #f12711, #f5af19); +} + +/* Make list items readable on Windows hosts */ +.list-group .list-group-item { + padding: 16; + color: #212121; +} + +/* TabView / SegmentedBar defaults */ +.tab-view { + selected-color: #30bcff; + tabs-background-color: #fff; +} +.tab-view .tab-view-item { + background-color: #fff; +} + +/* Ensure ScrollView / ListView backgrounds don't hide content */ +ScrollView, ListView, Repeater { + background-color: transparent; +} + +/* Make sure controls have a sensible default enabled/disabled appearance */ +Button[isEnabled=false], TextField[isEnabled=false], TextView[isEnabled=false] { + opacity: 0.6; +} diff --git a/apps/toolbox/src/pages/a11y.ts b/apps/toolbox/src/pages/a11y.ts index 6c82fb442f..f265c833b0 100644 --- a/apps/toolbox/src/pages/a11y.ts +++ b/apps/toolbox/src/pages/a11y.ts @@ -17,7 +17,7 @@ export class AccessibilityModel extends Observable { accessibilityLiveRegions = AccessibilityLiveRegion; accessibilityRole = AccessibilityRole; accessibilityState = AccessibilityState; - largeImageSrc = 'https://i.picsum.photos/id/669/5000/5000.jpg?hmac=VlpchW0ODhflKm0SKOYQrc8qysLWbqKmDS1MGT9apAc'; + largeImageSrc = 'https://picsum.photos/seed/VlpchW0ODhflKm0SKOYQrc8qysLWbqKmDS1MGT9apAc/5000/5000'; constructor() { super(); @@ -30,8 +30,8 @@ export class AccessibilityModel extends Observable { // prettier-ignore this.notifyPropertyChange('largeImageSrc', checked ? - 'https://i.picsum.photos/id/669/5000/5000.jpg?hmac=VlpchW0ODhflKm0SKOYQrc8qysLWbqKmDS1MGT9apAc' : - 'https://i.picsum.photos/id/684/5000/5000.jpg?hmac=loiXO_OQ-y86XY_hc7p3qJdY39fSd9CuDM0iA_--P4Q'); + 'https://picsum.photos/seed/VlpchW0ODhflKm0SKOYQrc8qysLWbqKmDS1MGT9apAc/5000/5000' : + 'https://picsum.photos/seed/loiXO_OQ-y86XY_hc7p3qJdY39fSd9CuDM0iA_--P4Q/5000/5000'); } openModal() { diff --git a/apps/toolbox/src/pages/css-playground.ts b/apps/toolbox/src/pages/css-playground.ts index c2d99fdf4b..a336474873 100644 --- a/apps/toolbox/src/pages/css-playground.ts +++ b/apps/toolbox/src/pages/css-playground.ts @@ -36,7 +36,7 @@ export class CssPlaygroundModel extends Observable { applyCSS(args) { this.resetCSS(); - addTaggedAdditionalCSS(`#play { ${this.currentCSS}`, CSSTag); + addTaggedAdditionalCSS(`#play { ${this.currentCSS} }`, CSSTag); playLabel._onCssStateChange(); playLabel.requestLayout(); } diff --git a/apps/toolbox/src/pages/list-page-model-sticky.ts b/apps/toolbox/src/pages/list-page-model-sticky.ts index cf8b3cb9c1..0ed74e3787 100644 --- a/apps/toolbox/src/pages/list-page-model-sticky.ts +++ b/apps/toolbox/src/pages/list-page-model-sticky.ts @@ -1392,7 +1392,18 @@ export class ListPageModelSticky extends Observable { } itemLoading(args: EventData): void { - (args.object as View).backgroundColor = 'transparent'; + const view = (args as any).view as View; + try { + const idx = (args as any).index; + const section = (args as any).section; + const argsBC = (args as any).bindingContext; + const obj = (args as any).object; + const viewCtor = view && (view as any).constructor ? (view as any).constructor.name : 'unknown'; + const viewBC = view && (view as any).bindingContext; + try { console.log('[ListPageSticky] itemLoading index=', idx, 'section=', section, 'args.bindingContextType=', typeof argsBC, 'args.object=', obj ? (obj.constructor?.name || 'object') : 'null', 'viewType=', viewCtor, 'view.bindingContextType=', typeof viewBC); } catch (_e) {} + try { if (viewBC && typeof viewBC === 'object' && (viewBC as any).name) console.log('[ListPageSticky] item name=', (viewBC as any).name); } catch (_e) {} + } catch (_e) {} + try { view.backgroundColor = 'transparent'; } catch (_e) {} } onSearchTextChange(evt: SearchEventData): void { diff --git a/apps/toolbox/src/pages/list-page.xml b/apps/toolbox/src/pages/list-page.xml index cce6c49c71..e5e61dc874 100644 --- a/apps/toolbox/src/pages/list-page.xml +++ b/apps/toolbox/src/pages/list-page.xml @@ -23,6 +23,9 @@