From 0ecde948f974aa399e682bc25ae55bab057c0908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BF=9E=E6=BC=AA?= Date: Thu, 6 Mar 2025 17:25:41 +0800 Subject: [PATCH] =?UTF-8?q?pcmenubar=E9=80=82=E9=85=8D=E6=B2=89=E6=B5=B8?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E5=85=BC=E5=AE=B9=E6=A8=A1=E5=BC=8F=E4=B8=8D?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=8F=8C=E5=87=BB=E6=A0=87=E9=A2=98=E6=A0=8F?= =?UTF-8?q?=E6=94=BE=E5=A4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 连漪 --- customappbar/interfaces/custom_app_bar_forpc.js | 10 ++++------ customappbar/source/custom_app_bar_forpc.ets | 9 ++++----- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/customappbar/interfaces/custom_app_bar_forpc.js b/customappbar/interfaces/custom_app_bar_forpc.js index 235e53c..a67370c 100644 --- a/customappbar/interfaces/custom_app_bar_forpc.js +++ b/customappbar/interfaces/custom_app_bar_forpc.js @@ -297,6 +297,9 @@ export class CustomAppBarForPC extends ViewPU { console.info('windowStatusChange windowStatusType: ' + JSON.stringify(windowStatusType)); this.updateMaximizeResource(windowStatusType); }); + if (!this.isAdaptPC) { + this.windowClass?.setWindowTitleMoveEnabled(false); + } }).catch((err) => { if (err.code) { console.error(`Failed to obtain the main window. Cause code: ${err.code}, message: ${err.message}`); @@ -344,6 +347,7 @@ export class CustomAppBarForPC extends ViewPU { if (splitArray.length < 4) { return; } + this.statusBarHeight = Number(splitArray[0]); this.contentMarginTop = splitArray[0]; this.contentMarginLeft = splitArray[1]; this.contentMarginRight = splitArray[2]; @@ -352,12 +356,6 @@ export class CustomAppBarForPC extends ViewPU { else if (eventName === ARKUI_APP_BG_COLOR) { this.contentBgColor = param; } - else if (eventName === ARKUI_APP_BAR_MENU_SAFE_AREA) { - if (this.statusBarHeight === px2vp(Number(param))) { - return; - } - this.statusBarHeight = Number(param); - } } /** * menu按钮点击 diff --git a/customappbar/source/custom_app_bar_forpc.ets b/customappbar/source/custom_app_bar_forpc.ets index bab47c4..43c9455 100644 --- a/customappbar/source/custom_app_bar_forpc.ets +++ b/customappbar/source/custom_app_bar_forpc.ets @@ -126,6 +126,9 @@ export struct CustomAppBarForPC { console.info('windowStatusChange windowStatusType: ' + JSON.stringify(windowStatusType)); this.updateMaximizeResource(windowStatusType); }); + if (!this.isAdaptPC) { + this.windowClass?.setWindowTitleMoveEnabled(false); + } } ).catch((err: BusinessError) => { if (err.code) { @@ -178,17 +181,13 @@ export struct CustomAppBarForPC { if (splitArray.length < 4) { return; } + this.statusBarHeight = Number(splitArray[0]); this.contentMarginTop = splitArray[0]; this.contentMarginLeft = splitArray[1]; this.contentMarginRight = splitArray[2]; this.contentMarginBottom = splitArray[3]; } else if (eventName === ARKUI_APP_BG_COLOR) { this.contentBgColor = param; - } else if (eventName === ARKUI_APP_BAR_MENU_SAFE_AREA) { - if (this.statusBarHeight === px2vp(Number(param))) { - return; - } - this.statusBarHeight = Number(param); } } -- Gitee