From 3153a0f43f22cf852b90f3df803ef197bb830b8f Mon Sep 17 00:00:00 2001 From: JackLee <809262979@qq.com> Date: Sat, 28 Mar 2026 16:23:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E5=85=A8=E5=B1=80=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E5=B0=BA=E5=AF=B8=E5=8F=98=E9=87=8F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/cpp/NativeEGLOCCT/NativeManager.cpp | 19 ++++++++++-- .../main/ets/entryability/EntryAbility.ets | 23 ++++++++------- .../src/main/ets/pages/AppStorageV2Class.ets | 29 ++++++++++--------- .../src/main/ets/pages/CustomStyle/Button.ets | 12 ++++---- .../main/ets/pages/CustomStyle/ComboBox.ets | 12 ++++---- .../src/main/ets/pages/CustomStyle/Dialog.ets | 4 +-- entry/src/main/ets/pages/CustomStyle/Menu.ets | 8 ++--- .../pages/EventSubWindow/ExecuteCommand.ets | 8 +++-- .../main/ets/pages/EventSubWindow/SWBase.ets | 8 ++--- entry/src/main/ets/pages/Index.ets | 10 +++---- .../ets/pages/LeftSideLayout/LeftSideTab.ets | 16 +++++----- .../ets/pages/TitleLayout/TitleColumnSub.ets | 8 ++--- .../main/ets/pages/TitleLayout/TitleTab.ets | 10 +++---- entry/src/main/ets/pages/modelViewTab.ets | 10 +++---- entry/src/main/module.json5 | 1 + 15 files changed, 97 insertions(+), 81 deletions(-) diff --git a/entry/src/main/cpp/NativeEGLOCCT/NativeManager.cpp b/entry/src/main/cpp/NativeEGLOCCT/NativeManager.cpp index 2f00e44c..f8669667 100644 --- a/entry/src/main/cpp/NativeEGLOCCT/NativeManager.cpp +++ b/entry/src/main/cpp/NativeEGLOCCT/NativeManager.cpp @@ -229,9 +229,22 @@ void NativeManager::OnMouseEvent(OH_NativeXComponent *comp, void *win) { } auto renderThread = it->second; float curtX,curtY; - //HILOG_WARN(NATIVE_TAG, "ALLButton:%{public}d",mouseEvent.button); - //HILOG_WARN(NATIVE_TAG, "ALLAction:%{public}d",mouseEvent.action); - //HILOG_WARN(NATIVE_TAG, "ALLTimestamp:%{public}d",mouseEvent.timestamp); + //开发测试模拟器输出鼠标按钮和时间类型,时间戳 + bool _log=true; + if(_log){ + HILOG_INFO(NATIVE_TAG, "ALLButton:%{public}d",mouseEvent.button); + HILOG_INFO(NATIVE_TAG, "ALLAction:%{public}d",mouseEvent.action); + HILOG_INFO(NATIVE_TAG, "ALLTimestamp:%{public}d",mouseEvent.timestamp); + } + + //以下代码为采用按住鼠标右键不放进行Move改变Carmera的旋转视角 + //旋转视角分为三种模式: + //自由模式.基于世界坐标系0,0,0 + //模型中心.通过边界盒计算模型的中心点,进行旋转 + //基于鼠标按下右键点进行旋转 + + //按住Ctrl不放同时按住鼠标左键不放进行Carmera的移动 + //移动模式:均为鼠标点按下后记录坐标增量移动 //鼠标按下并且事件为鼠标中键 diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 31a38af7..84a7b46f 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -34,17 +34,17 @@ export default class EntryAbility extends UIAbility { const mainWindowHeight: number = screenHeight - 200; console.error(`main window Width: mainWindowWidth, Height: mainWindowHeight`); //Init&&Save AppStorageV2 - const mainDisplayInfo = + const mDispInfo = AppStorageV2.connect(MainScreenDisplayInfo, () => new MainScreenDisplayInfo())!; - const mainWinInfo = AppStorageV2.connect(MainWindowInfo, () => new MainWindowInfo())!; - const mainWinStage = + const mWinInfo = AppStorageV2.connect(MainWindowInfo, () => new MainWindowInfo())!; + const mWinStage = AppStorageV2.connect(MainWindowStageInfo, () => new MainWindowStageInfo())!; - mainDisplayInfo.mainScreenDisplayId = screenDisplayId; - mainDisplayInfo.mainScreenWidth = screenWidth; - mainDisplayInfo.mainScreenHeight = screenHeight; - mainWinInfo.mainWindowWidth = mainWindowWidth; - mainWinInfo.mainWindowHeight = mainWindowHeight; - mainWinStage.ws = windowStage; + mDispInfo.mSDispId = screenDisplayId; + mDispInfo.mSDispWidth = screenWidth; + mDispInfo.mSDispHeight = screenHeight; + mWinInfo.mWinWidth = mainWindowWidth; + mWinInfo.mWinHeight = mainWindowHeight; + mWinStage.mWinStage = windowStage; //Get Main Window windowStage.getMainWindow((err, data) => { @@ -53,6 +53,7 @@ export default class EntryAbility extends UIAbility { return; } this.mainWindow = data; + mWinInfo.mWinId = this.mainWindow.getWindowProperties().id; //moveWindowTo this.mainWindow.moveWindowTo(50, 50) //resize mainWindow Size @@ -67,8 +68,8 @@ export default class EntryAbility extends UIAbility { // windowSizeChangeListener to Change mainWindowWidth&&mainWindowHeight in AppStorage this.mainWindow.on('windowSizeChange', (ListenerData) => { // if Size Change save to AppStorage - mainWinInfo.mainWindowWidth = ListenerData.width; - mainWinInfo.mainWindowHeight = ListenerData.height; + mWinInfo.mWinWidth = ListenerData.width; + mWinInfo.mWinHeight = ListenerData.height; console.info('Succeeded in enabling the listener for window size changes. Data:' + ListenerData.width, ListenerData.height); }); diff --git a/entry/src/main/ets/pages/AppStorageV2Class.ets b/entry/src/main/ets/pages/AppStorageV2Class.ets index 75dcca3f..e9e5c75b 100644 --- a/entry/src/main/ets/pages/AppStorageV2Class.ets +++ b/entry/src/main/ets/pages/AppStorageV2Class.ets @@ -4,34 +4,37 @@ import { AppStorageV2, window} from '@kit.ArkUI'; //底部有全局信息变量,已导出,其他page只需要import该文件即可调用let变量 @ObservedV2 export class MainScreenDisplayInfo { - @Trace public mainScreenDisplayId: number; - @Trace public mainScreenWidth: number; - @Trace public mainScreenHeight: number; + @Trace public mSDispId: number; + @Trace public mSDispWidth: number; + @Trace public mSDispHeight: number; constructor(_id?: number, _width?: number,_height?: number) { - this.mainScreenDisplayId = _id ?? 0; - this.mainScreenWidth = _width ?? 0; - this.mainScreenHeight = _height ?? 0; + this.mSDispId = _id ?? 0; + this.mSDispWidth = _width ?? 0; + this.mSDispHeight = _height ?? 0; } } @ObservedV2 export class MainWindowInfo { - @Trace public mainWindowWidth: number; - @Trace public mainWindowHeight: number; + @Trace public mWinId: number; + @Trace public mWinWidth: number; + @Trace public mWinHeight: number; - constructor(_width?: number, _height?: number) { - this.mainWindowWidth = _width ?? 0; - this.mainWindowHeight = _height ?? 0; + + constructor(_id?:number,_width?: number, _height?: number) { + this.mWinWidth = _width ?? 0; + this.mWinHeight = _height ?? 0; + this.mWinId=_id?? 0; } } @ObservedV2 export class MainWindowStageInfo { - @Trace public ws: window.WindowStage| undefined; + @Trace public mWinStage: window.WindowStage| undefined; constructor(_ws?: window.WindowStage) { - this.ws = _ws ?? undefined; + this.mWinStage = _ws ?? undefined; } } //全局保存主窗口信息,屏幕信息.窗口管理器信息 diff --git a/entry/src/main/ets/pages/CustomStyle/Button.ets b/entry/src/main/ets/pages/CustomStyle/Button.ets index 56e25511..54233bba 100644 --- a/entry/src/main/ets/pages/CustomStyle/Button.ets +++ b/entry/src/main/ets/pages/CustomStyle/Button.ets @@ -6,10 +6,10 @@ import { TitleTabData } from '../LayoutInterface/Layout/TitleTabData'; import { mwInfo } from '../AppStorageV2Class'; //按钮统一尺寸,该按钮为正方形,所以以主窗口宽为基准,长=高->正方形 -let ebWidth=mwInfo.mainWindowWidth*0.02; -let ebHeigth=mwInfo.mainWindowWidth*0.02; +let ebWidth=mwInfo.mWinWidth*0.02; +let ebHeigth=mwInfo.mWinWidth*0.02; //占位符的高度 -let edHeigth=mwInfo.mainWindowWidth*0.005 +let edHeigth=mwInfo.mWinWidth*0.005 //单一功能按钮 @@ -180,15 +180,15 @@ export struct SubColumnMenu { Button(){ Row(){ Image($r('app.media.'+(this.icon!=undefined ? this.icon:(this.menus[this.curtIndex]as TitleButton).eIcon))) - .height(mwInfo.mainWindowWidth*0.01) + .height(mwInfo.mWinWidth*0.01) if(this.name!=undefined){ Text(this.name).fontSize(16) } } - }.height(mwInfo.mainWindowWidth*0.01) + }.height(mwInfo.mWinWidth*0.01) .backgroundColor(Color.Transparent) .bindMenu(this.BaseMenu) .type(ButtonType.Normal) - }.width(this.name!=undefined ?mwInfo.mainWindowWidth*0.02:mwInfo.mainWindowWidth*0.01) + }.width(this.name!=undefined ?mwInfo.mWinWidth*0.02:mwInfo.mWinWidth*0.01) } } \ No newline at end of file diff --git a/entry/src/main/ets/pages/CustomStyle/ComboBox.ets b/entry/src/main/ets/pages/CustomStyle/ComboBox.ets index bfd87df5..fec6b1b5 100644 --- a/entry/src/main/ets/pages/CustomStyle/ComboBox.ets +++ b/entry/src/main/ets/pages/CustomStyle/ComboBox.ets @@ -2,10 +2,10 @@ import { mwInfo } from "../AppStorageV2Class"; import { TitleButton } from "../LayoutInterface/Interface/ButtonInterface"; //按钮统一尺寸,该按钮为正方形,所以以主窗口宽为基准,长=高->正方形 -let ebWidth=mwInfo.mainWindowWidth*0.075; -let ebHeigth=mwInfo.mainWindowHeight*0.03; +let ebWidth=mwInfo.mWinWidth*0.075; +let ebHeigth=mwInfo.mWinHeight*0.03; //占位符的高度 -let edHeigth=mwInfo.mainWindowWidth*0.005 +let edHeigth=mwInfo.mWinWidth*0.005 @ComponentV2 export struct TextComboBox { @@ -34,10 +34,10 @@ export struct TextComboBox { .width('50%') .fontSize(16) .backgroundColor('#ffe6e6e3') - .height(mwInfo.mainWindowHeight*0.02) + .height(mwInfo.mWinHeight*0.02) .margin({ top:0, left: 5, bottom: 0, right: 0 }) }.width(ebWidth) - .height(mwInfo.mainWindowWidth*0.01) + .height(mwInfo.mWinWidth*0.01) } } @ComponentV2 @@ -61,6 +61,6 @@ export struct TextInputComboBox { TextInput({placeholder:this.selectIndex.toString()}) .bindMenu(this.EventMenu) .type(InputType.Number) - }.height(mwInfo.mainWindowWidth*0.01) + }.height(mwInfo.mWinWidth*0.01) } } diff --git a/entry/src/main/ets/pages/CustomStyle/Dialog.ets b/entry/src/main/ets/pages/CustomStyle/Dialog.ets index 3d44c8f5..d6a027a7 100644 --- a/entry/src/main/ets/pages/CustomStyle/Dialog.ets +++ b/entry/src/main/ets/pages/CustomStyle/Dialog.ets @@ -4,8 +4,8 @@ import { TitleButton } from "../LayoutInterface/Interface/ButtonInterface"; import {SwitchView} from "../LayoutInterface/Layout/SwitchView" //按钮统一尺寸,该按钮为正方形,所以以主窗口宽为基准,长=高->正方形 -let ebWidth=mwInfo.mainWindowWidth*0.02; -let ebHeigth=mwInfo.mainWindowWidth*0.02; +let ebWidth=mwInfo.mWinWidth*0.02; +let ebHeigth=mwInfo.mWinWidth*0.02; //视图切换弹窗 @CustomDialog export struct ViewDialog { diff --git a/entry/src/main/ets/pages/CustomStyle/Menu.ets b/entry/src/main/ets/pages/CustomStyle/Menu.ets index ae40047f..d73587b1 100644 --- a/entry/src/main/ets/pages/CustomStyle/Menu.ets +++ b/entry/src/main/ets/pages/CustomStyle/Menu.ets @@ -6,8 +6,8 @@ import { BaseMenuData } from "../LayoutInterface/Interface/MenuInterface"; //按钮统一尺寸,该按钮为正方形,所以以主窗口宽为基准,长=高->正方形 -let ebWidth=mwInfo.mainWindowWidth*0.02; -let ebHeigth=mwInfo.mainWindowWidth*0.02; +let ebWidth=mwInfo.mWinWidth*0.02; +let ebHeigth=mwInfo.mWinWidth*0.02; @Builder export function BaseMenu(indexMenu:BaseMenuData) { @@ -66,8 +66,8 @@ export struct GroupTextEventMenu { .fontColor(Color.Gray) Blank().width('auto') Button() - .height(mwInfo.mainWindowWidth*0.005) - .width(mwInfo.mainWindowWidth*0.005) + .height(mwInfo.mWinWidth*0.005) + .width(mwInfo.mWinWidth*0.005) .padding(1) .backgroundImage($r('app.media.base_seetings')) .backgroundImagePosition({ x: '5%', y: '5%' }) diff --git a/entry/src/main/ets/pages/EventSubWindow/ExecuteCommand.ets b/entry/src/main/ets/pages/EventSubWindow/ExecuteCommand.ets index e901f4d0..c8514a1e 100644 --- a/entry/src/main/ets/pages/EventSubWindow/ExecuteCommand.ets +++ b/entry/src/main/ets/pages/EventSubWindow/ExecuteCommand.ets @@ -5,18 +5,20 @@ import NativeOpenCAX from 'libopencax.so'; import { mwInfo } from '../AppStorageV2Class'; export function ExecuteCommand(event:TitleButton){ + //事件处理 if(event?.eEvent=='Execute_LoadModel'){ OCCTLoadModel(undefined,undefined) } //窗体打开 if(event?.eEvent=='Execute_CreateSubWindow'){ - const winInfo:WinInfo=new WinInfo(event.eName,event.ePage,mwInfo.mainWindowWidth*0.3,mwInfo.mainWindowHeight*0.9); - CreateAndShowSubWindow(winInfo); + const winInfo:WinInfo=new WinInfo(event.eName,event.ePage,mwInfo.mWinWidth*0.3,mwInfo.mWinHeight*0.9); + //CreateAndShowSubWindow(winInfo); + }else if(event?.eEvent=='Execute_ExitSubWindow'){ CloseSubWindow(); } else if(event?.eEvent=='Execute_CreateSubWindow_Options'){ - const winInfo:WinInfo=new WinInfo(event.eName,event.ePage,mwInfo.mainWindowWidth*0.6,mwInfo.mainWindowHeight*0.9); + const winInfo:WinInfo=new WinInfo(event.eName,event.ePage,mwInfo.mWinWidth*0.6,mwInfo.mWinHeight*0.9); CreateAndShowSubWindow(winInfo); }else if(event?.eEvent=='Execute_ExitSubWindow_Options'){ CloseSubWindow(); diff --git a/entry/src/main/ets/pages/EventSubWindow/SWBase.ets b/entry/src/main/ets/pages/EventSubWindow/SWBase.ets index e2605caf..bbd3f174 100644 --- a/entry/src/main/ets/pages/EventSubWindow/SWBase.ets +++ b/entry/src/main/ets/pages/EventSubWindow/SWBase.ets @@ -19,7 +19,7 @@ export class WinInfo{ export async function CreateAndShowSubWindow(winInfo:WinInfo) { try { - if(mwsInfo.ws==null){ + if(mwsInfo.mWinStage==null){ console.error('Failed to create the subwindow. Cause: windowStage is null'); return; } @@ -28,15 +28,11 @@ export async function CreateAndShowSubWindow(winInfo:WinInfo) { decorEnabled: true, isModal: false, maximizeSupported: false, - zLevel:-1, outlineEnabled:true, }; - await mwsInfo.ws.createSubWindowWithOptions('subWindow', options).then((data) => { + await mwsInfo.mWinStage.createSubWindowWithOptions('subWindow', options).then((data) => { subWindow = data; - subWindow.setResizeByDragEnabled(true, (err: BusinessError) => { - console.log("设置拖拽缩放", `报错信息:${err.code}, ${err.message}`) - }) //子窗口创建成功后,设置子窗口的位置、大小及相关属性等。 subWindow.moveWindowTo(25, 25) //子窗口重置大小 diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 812dedee..0816367e 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -24,7 +24,7 @@ let Fonts: Array = [ struct Index { @Local startX:number=0; @Local isDragging:boolean=false; - @Provider('panelWidth') panelWidth:number=mwInfo.mainWindowWidth * 0.15; + @Provider('panelWidth') panelWidth:number=mwInfo.mWinWidth * 0.15; //列出资源管理器指定目录下的所有问题件 HilogToDirFile(){ @@ -108,7 +108,7 @@ struct Index { Column({ space: 0 }) { //头部导航功能区 TitleTab() - .height(mwInfo.mainWindowHeight * 0.08) + .height(mwInfo.mWinHeight * 0.08) //分割线 Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey) //工具栏 @@ -116,7 +116,7 @@ struct Index { TitleColumnSub(); } .width('100%') - .height(mwInfo.mainWindowHeight * 0.02) + .height(mwInfo.mWinHeight * 0.02) .align(Alignment.Start) //分割线 Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey) @@ -147,7 +147,7 @@ struct Index { }.layoutWeight(1) .align(Alignment.Center) }.width('100%') - .height(mwInfo.mainWindowHeight * 0.39) + .height(mwInfo.mWinHeight * 0.39) //分割线 Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey) ///状态栏 @@ -156,7 +156,7 @@ struct Index { }.width('100%') .align(Alignment.End) .alignItems(HorizontalAlign.Start) - .height(mwInfo.mainWindowHeight * 0.01) + .height(mwInfo.mWinHeight * 0.01) }.backgroundColor('#f3f3f0') .width('100%') .height('100%') diff --git a/entry/src/main/ets/pages/LeftSideLayout/LeftSideTab.ets b/entry/src/main/ets/pages/LeftSideLayout/LeftSideTab.ets index 1a61653d..f6f0ba5b 100644 --- a/entry/src/main/ets/pages/LeftSideLayout/LeftSideTab.ets +++ b/entry/src/main/ets/pages/LeftSideLayout/LeftSideTab.ets @@ -7,7 +7,7 @@ export struct LeftSideTab { private leftSideBarTabs: TabsController = new TabsController(); @Local leftSideBarFocusIndex: number = 0; @Local isExpanded:boolean=true; - @Consumer('panelWidth') panelWidth:number=mwInfo.mainWindowWidth * 0.1; + @Consumer('panelWidth') panelWidth:number=mwInfo.mWinWidth * 0.1; build() { Row() { @@ -24,12 +24,12 @@ export struct LeftSideTab { }) .backgroundImage(this.isExpanded ? $r('app.media.base_expand_on'):$r('app.media.base_expand_off')) .type(ButtonType.Normal) - .width(mwInfo.mainWindowWidth*0.013) - .height(mwInfo.mainWindowWidth*0.013) + .width(mwInfo.mWinWidth*0.013) + .height(mwInfo.mWinWidth*0.013) .onClick(()=>{ this.isExpanded = !this.isExpanded; if(this.isExpanded){ - this.panelWidth=mwInfo.mainWindowWidth * 0.1; + this.panelWidth=mwInfo.mWinWidth * 0.1; }else{ this.panelWidth=0; } @@ -50,8 +50,8 @@ export struct LeftSideTab { }) .backgroundImage($r('app.media.'+item.eIcon)) .fontWeight(index === this.leftSideBarFocusIndex ? FontWeight.Bold : FontWeight.Normal) - .width(mwInfo.mainWindowWidth*0.013) - .height(mwInfo.mainWindowWidth*0.013) + .width(mwInfo.mWinWidth*0.013) + .height(mwInfo.mWinWidth*0.013) .type(ButtonType.Normal) .onClick(() => { this.leftSideBarTabs.changeIndex(index); @@ -64,8 +64,8 @@ export struct LeftSideTab { .align(Alignment.Start) .scrollable(ScrollDirection.Vertical) .scrollBar(BarState.Off) - .width(mwInfo.mainWindowWidth*0.013) - .height(mwInfo.mainWindowWidth*0.013) + .width(mwInfo.mWinWidth*0.013) + .height(mwInfo.mWinWidth*0.013) .height('100%') }.borderWidth(1) .borderColor(Color.Grey) diff --git a/entry/src/main/ets/pages/TitleLayout/TitleColumnSub.ets b/entry/src/main/ets/pages/TitleLayout/TitleColumnSub.ets index 8722ee1c..a418848e 100644 --- a/entry/src/main/ets/pages/TitleLayout/TitleColumnSub.ets +++ b/entry/src/main/ets/pages/TitleLayout/TitleColumnSub.ets @@ -22,8 +22,8 @@ export struct TitleColumnSub { private ViewDialog(): CustomDialogController { return new CustomDialogController({ builder: ViewDialog(), // 确保 ViewDialog 组件已正确定义 - width: mwInfo.mainWindowWidth*0.06, - height: mwInfo.mainWindowWidth*0.052, + width: mwInfo.mWinWidth*0.06, + height: mwInfo.mWinWidth*0.052, borderWidth: 1, cornerRadius: 5, isModal: true, @@ -52,8 +52,8 @@ export struct TitleColumnSub { this.viewDialog=this.ViewDialog(); } this.viewDialog.open(); - }).width(mwInfo.mainWindowWidth*0.01) - .height(mwInfo.mainWindowWidth*0.01) + }).width(mwInfo.mWinWidth*0.01) + .height(mwInfo.mWinWidth*0.01) .backgroundColor(Color.Transparent) .backgroundImage($r('app.media.' + SwitchView[0].eIcon)) .backgroundImageSize({ diff --git a/entry/src/main/ets/pages/TitleLayout/TitleTab.ets b/entry/src/main/ets/pages/TitleLayout/TitleTab.ets index 96c6ce19..41a3a162 100644 --- a/entry/src/main/ets/pages/TitleLayout/TitleTab.ets +++ b/entry/src/main/ets/pages/TitleLayout/TitleTab.ets @@ -25,8 +25,8 @@ export struct TitleTab { Button((FileMenuData.aMenus[0] as TitleButton).eName) .fontSize(16) .fontColor(Color.Black) - .height(mwInfo.mainWindowHeight*0.025) - .width(mwInfo.mainWindowWidth*0.035) + .height(mwInfo.mWinHeight*0.025) + .width(mwInfo.mWinWidth*0.035) .bindMenu(BaseMenu(FileMenuData)) .type(ButtonType.Normal) .backgroundColor('#f3f3f0') @@ -36,8 +36,8 @@ export struct TitleTab { .fontSize(16) .fontColor(Color.Black) .fontWeight(index === this.titleBarFocusIndex ? FontWeight.Bold : FontWeight.Normal) - .height(mwInfo.mainWindowHeight*0.025) - .width(mwInfo.mainWindowWidth*0.035) + .height(mwInfo.mWinHeight*0.025) + .width(mwInfo.mWinWidth*0.035) .type(ButtonType.Normal) .backgroundColor('#f3f3f0') .onClick(() => { @@ -69,6 +69,6 @@ export struct TitleTab { }.scrollable(true) .barHeight(0) .barMode(BarMode.Fixed) - }.width(mwInfo.mainWindowWidth) + }.width(mwInfo.mWinWidth) } } diff --git a/entry/src/main/ets/pages/modelViewTab.ets b/entry/src/main/ets/pages/modelViewTab.ets index d73da5c7..287866d3 100644 --- a/entry/src/main/ets/pages/modelViewTab.ets +++ b/entry/src/main/ets/pages/modelViewTab.ets @@ -28,18 +28,18 @@ export struct ModelViewTab { ForEach(dTab, (item: TaskTab, index: number) => { Row({ space: 0 }) { Image($r('app.media.startIcon')) - .width(this.mwInfo.mainWindowWidth*0.012) - .height(this.mwInfo.mainWindowWidth*0.012) + .width(this.mwInfo.mWinWidth*0.012) + .height(this.mwInfo.mWinWidth*0.012) .objectFit(ImageFit.Contain) Button(item.str) .fontWeight(index === this.modelViewBarFocusIndex ? FontWeight.Bold : FontWeight.Normal) .width('auto') - .height(this.mwInfo.mainWindowWidth*0.012) + .height(this.mwInfo.mWinWidth*0.012) .type(ButtonType.Normal) Button('X') .fontSize(12) - .width(this.mwInfo.mainWindowWidth*0.012) - .height(this.mwInfo.mainWindowWidth*0.012) + .width(this.mwInfo.mWinWidth*0.012) + .height(this.mwInfo.mWinWidth*0.012) .type(ButtonType.Normal) .align(Alignment.Center) }.onClick(() => { diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 index f42cd37d..97d8a3dd 100644 --- a/entry/src/main/module.json5 +++ b/entry/src/main/module.json5 @@ -27,6 +27,7 @@ "minWindowWidth": 1200, // 设置最小宽度 "minWindowHeight": 800, // 设置最小高度 "exported": true, + "launchType":"multiton", "skills": [ { "entities": [