解耦事件,把事件类型分为Page和Event.

Page主要针对Arkui侧的子窗口事件
Event主要针对Native侧的事件.

后续考虑解耦为如下:
Arkui_Page(主要针对子窗口归一化调用)
Arkui_Event(主要针对arkui侧的归一化动态组件操作)
Native_Page(主要针对Native侧对Arkui侧的页面数据更新和回调)
Native_Event(主要针对单一从Aarkui侧调用Native指令)

本次更新后btnEvent中增加了page地址和args.可以在预置功能中预置命令和参数.
This commit is contained in:
JackLee 2026-04-15 16:14:15 +08:00
parent ba448cd637
commit deb0edcc0d
8 changed files with 76 additions and 72 deletions

View File

@ -48,6 +48,7 @@ export default class EntryAbility extends UIAbility {
//InitFont->Copy Res/resfile/font to sandbox
InitGlobalDisplayWindowInfo(windowStage);
//Get Main Window
windowStage.getMainWindow((err, data) => {
if (err.code) {
@ -76,7 +77,6 @@ export default class EntryAbility extends UIAbility {
ChangeData.height);
});
});
//Load page
windowStage.loadContent('pages/Index', (err) => {
if (err.code) {

View File

@ -34,7 +34,7 @@ export async function CreateAndShowSubWindow(winInfo:WinInfo) {
await mwsInfo.winStage.createSubWindowWithOptions('subWindow', options).then((data) => {
subWindow = data;
//子窗口创建成功后,设置子窗口的位置、大小及相关属性等。
subWindow.moveWindowTo(25, 25)
subWindow.moveWindowTo(50, 50)
//子窗口重置大小
console.info("页面路径:", winInfo.page);
subWindow.resize(winInfo.width,winInfo.height);

View File

@ -1,5 +1,5 @@
import { hilog } from '@kit.PerformanceAnalysisKit';
import { edgeColors, display, AppStorageV2 } from '@kit.ArkUI';
import { OverlayManager } from '@kit.ArkUI';
import { TitleTab } from './TitleLayout/TitleTab'
import { LeftSideTab } from './LeftSideLayout/LeftSideTab'
import { RightSideTab } from './RightSideLayout/RightSideTab'
@ -16,6 +16,10 @@ struct Index {
@Local isDragging:boolean=false;
@Provider('LeftSideWidth') leftSideWidth:number=mwInfo.width * 0.1;
@Provider('RightSideWidth') rightSideWidth:number=mwInfo.width * 0.1;
private uiContext: UIContext = this.getUIContext();
private overlayManager: OverlayManager = this.uiContext.getOverlayManager();
private componentContent: ComponentContent | null = null;
build() {
//OpenCAX主界面整体布局,采用多行布局
Column() {

View File

@ -69,6 +69,5 @@ export struct LeftSideTab {
}.barHeight(0)
}.width(this.isExpanded?this.leftSideWidth:0)
}.width('auto')
.backgroundColor($r('sys.color.background_secondary'))
}
}

View File

@ -61,10 +61,8 @@ export struct ModelViewTab {
.height('auto')
.barMode(BarMode.Fixed)
.barPosition(BarPosition.Start)
.backgroundBlurStyle(BlurStyle.COMPONENT_THIN)
.fadingEdge(true)
.barMode(BarMode.Scrollable)
.backgroundColor($r('sys.color.comp_background_secondary'))
.divider({ strokeWidth: '1px', color: $r('sys.color.comp_divider') })
}else{
Image($r('app.media.base_background'))

View File

@ -36,8 +36,6 @@ export struct RightSideTab {
}).margin({ top: 2,left:1,bottom:0,right:2})
Blank().layoutWeight(1)
}.borderWidth(1)
.borderColor(Color.Grey)
}.width('auto')
.backgroundColor($r('sys.color.background_secondary'))
}
}

View File

@ -64,5 +64,7 @@ export struct TitleColumnSub {
SubColumnMenu({menus:DisplayMode})
}.width('100%')
.height('100%')
.backgroundBlurStyle(BlurStyle.Thin,
{ colorMode: ThemeColorMode.LIGHT, adaptiveColor: AdaptiveColor.DEFAULT, scale: 1.0 })
}
}

View File

@ -87,6 +87,9 @@ export struct TitleTab {
.barHeight(0)
.barMode(BarMode.Fixed)
}.margin({ top:0, left: 0, bottom: 0, right: 0 })
.backgroundColor($r('sys.color.background_secondary'))
//.backgroundColor($r('sys.color.background_secondary'))
.borderRadius(15)
.backgroundBlurStyle(BlurStyle.Thin,
{ colorMode: ThemeColorMode.LIGHT, adaptiveColor: AdaptiveColor.DEFAULT, scale: 1.0 })
}
}