diff --git a/customappbar/interfaces/custom_app_bar_forpc.js b/customappbar/interfaces/custom_app_bar_forpc.js index 235e53c167e8e0d5e9a94a5e6f02952f6b988e13..a67370caed313836ba3161b8f2c116f7e43171bd 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 bab47c49108ce28edce1bf341455695de20af963..43c94555cd2e3ee6c8322574a8b0d92ee151582f 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); } }