From 076d258c3299aa55b4612da931a32464d0bc6d9e Mon Sep 17 00:00:00 2001 From: hucong Date: Thu, 20 Feb 2025 03:55:56 +0000 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=A0=8F=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E8=89=B2=E6=A8=AA=E7=AB=96=E5=B1=8F=E5=88=B7=E6=96=B0=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E4=B8=8A=E6=96=B9=E7=99=BD=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hucong --- .../interfaces/atomicservicenavigation.js | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/atomicservicenavigation/interfaces/atomicservicenavigation.js b/atomicservicenavigation/interfaces/atomicservicenavigation.js index b129314..a81f85e 100644 --- a/atomicservicenavigation/interfaces/atomicservicenavigation.js +++ b/atomicservicenavigation/interfaces/atomicservicenavigation.js @@ -149,8 +149,8 @@ export class AtomicServiceNavigation extends ViewPU { this.modeChangeCallback = undefined; this.settings = new RenderingContextSettings(true); this.context = new CanvasRenderingContext2D(this.settings); - this.navigationWidth = 0; - this.navigationHeight = 0; + this.__navigationWidth = new ObservedPropertySimplePU(0, this, "navigationWidth"); + this.__navigationHeight = new ObservedPropertySimplePU(0, this, "navigationHeight"); this.mainWindow = undefined; this.onWindowSizeChangeCallback = undefined; this.onAvoidSafeAreaChangeCallback = undefined; @@ -258,6 +258,8 @@ export class AtomicServiceNavigation extends ViewPU { this.__currentBreakPoint.purgeDependencyOnElmtId(rmElmtId); this.__sideBarAttribute.purgeDependencyOnElmtId(rmElmtId); this.__controlButtonVisible.purgeDependencyOnElmtId(rmElmtId); + this.__navigationWidth.purgeDependencyOnElmtId(rmElmtId); + this.__navigationHeight.purgeDependencyOnElmtId(rmElmtId); } aboutToBeDeleted() { @@ -276,6 +278,8 @@ export class AtomicServiceNavigation extends ViewPU { this.__currentBreakPoint.aboutToBeDeleted(); this.__sideBarAttribute.aboutToBeDeleted(); this.__controlButtonVisible.aboutToBeDeleted(); + this.__navigationWidth.aboutToBeDeleted(); + this.__navigationHeight.aboutToBeDeleted(); SubscriberManager.Get().delete(this.id__()); this.aboutToBeDeletedInternal(); } @@ -399,7 +403,18 @@ export class AtomicServiceNavigation extends ViewPU { set controlButtonVisible(newValue) { this.__controlButtonVisible.set(newValue); } - + get navigationWidth() { + return this.__navigationWidth.get(); + } + set navigationWidth(newValue) { + this.__navigationWidth.set(newValue); + } + get navigationHeight() { + return this.__navigationHeight.get(); + } + set navigationHeight(newValue) { + this.__navigationHeight.set(newValue); + } defaultNavDestinationBuilder(name, param, parent = null) { } @@ -1119,7 +1134,7 @@ export class AtomicServiceNavigation extends ViewPU { Stack.create(); Stack.width('100%'); Stack.height('100%'); - Stack.background(this.gradientBackground === undefined ? undefined : { + Stack.background(this.gradientBackground === undefined || (this.navigationWidth === -1 && this.navigationHeight === -1) ? undefined : { builder: () => { this.BackgroundBuilder.call(this, makeBuilderParameterProxy('BackgroundBuilder', { primaryColor: () => this.gradientBackground.primaryColor, @@ -1129,7 +1144,7 @@ export class AtomicServiceNavigation extends ViewPU { alpha: () => this.gradientBackground.alpha })); } - }); + } , { align: Alignment.Top }); Stack.onSizeChange((oldValue, newValue) => { this.navigationWidth = newValue.width; this.navigationHeight = newValue.height; -- Gitee