mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 13:51:27 +08:00
feat: boolean to disable systemAppearanceChanged (theme)
This commit is contained in:
@ -148,9 +148,9 @@ export function orientationChanged(rootView: View, newOrientation: 'portrait' |
|
|||||||
applyCssClass(rootModalView, ORIENTATION_CSS_CLASSES, newOrientationCssClass);
|
applyCssClass(rootModalView, ORIENTATION_CSS_CLASSES, newOrientationCssClass);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
export let autoSystemAppearanceChanged = true;
|
||||||
export function systemAppearanceChanged(rootView: View, newSystemAppearance: 'dark' | 'light'): void {
|
export function systemAppearanceChanged(rootView: View, newSystemAppearance: 'dark' | 'light'): void {
|
||||||
if (!rootView) {
|
if (!rootView || !autoSystemAppearanceChanged) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
packages/core/application/index.d.ts
vendored
4
packages/core/application/index.d.ts
vendored
@ -54,6 +54,10 @@ export const orientationChangedEvent: string;
|
|||||||
*/
|
*/
|
||||||
export const systemAppearanceChangedEvent: string;
|
export const systemAppearanceChangedEvent: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Boolean to enable/disable systemAppearanceChanged
|
||||||
|
*/
|
||||||
|
export let autoSystemAppearanceChanged = true;
|
||||||
/**
|
/**
|
||||||
* Updates root view classes including those of modals
|
* Updates root view classes including those of modals
|
||||||
* @param rootView the root view
|
* @param rootView the root view
|
||||||
|
Reference in New Issue
Block a user