解耦事件,把事件类型分为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:
parent
ba448cd637
commit
deb0edcc0d
@ -48,6 +48,7 @@ export default class EntryAbility extends UIAbility {
|
|||||||
//InitFont->Copy Res/resfile/font to sandbox
|
//InitFont->Copy Res/resfile/font to sandbox
|
||||||
|
|
||||||
InitGlobalDisplayWindowInfo(windowStage);
|
InitGlobalDisplayWindowInfo(windowStage);
|
||||||
|
|
||||||
//Get Main Window
|
//Get Main Window
|
||||||
windowStage.getMainWindow((err, data) => {
|
windowStage.getMainWindow((err, data) => {
|
||||||
if (err.code) {
|
if (err.code) {
|
||||||
@ -76,7 +77,6 @@ export default class EntryAbility extends UIAbility {
|
|||||||
ChangeData.height);
|
ChangeData.height);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//Load page
|
//Load page
|
||||||
windowStage.loadContent('pages/Index', (err) => {
|
windowStage.loadContent('pages/Index', (err) => {
|
||||||
if (err.code) {
|
if (err.code) {
|
||||||
|
|||||||
@ -34,7 +34,7 @@ export async function CreateAndShowSubWindow(winInfo:WinInfo) {
|
|||||||
await mwsInfo.winStage.createSubWindowWithOptions('subWindow', options).then((data) => {
|
await mwsInfo.winStage.createSubWindowWithOptions('subWindow', options).then((data) => {
|
||||||
subWindow = data;
|
subWindow = data;
|
||||||
//子窗口创建成功后,设置子窗口的位置、大小及相关属性等。
|
//子窗口创建成功后,设置子窗口的位置、大小及相关属性等。
|
||||||
subWindow.moveWindowTo(25, 25)
|
subWindow.moveWindowTo(50, 50)
|
||||||
//子窗口重置大小
|
//子窗口重置大小
|
||||||
console.info("页面路径:", winInfo.page);
|
console.info("页面路径:", winInfo.page);
|
||||||
subWindow.resize(winInfo.width,winInfo.height);
|
subWindow.resize(winInfo.width,winInfo.height);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { hilog } from '@kit.PerformanceAnalysisKit';
|
import { hilog } from '@kit.PerformanceAnalysisKit';
|
||||||
import { edgeColors, display, AppStorageV2 } from '@kit.ArkUI';
|
import { OverlayManager } from '@kit.ArkUI';
|
||||||
import { TitleTab } from './TitleLayout/TitleTab'
|
import { TitleTab } from './TitleLayout/TitleTab'
|
||||||
import { LeftSideTab } from './LeftSideLayout/LeftSideTab'
|
import { LeftSideTab } from './LeftSideLayout/LeftSideTab'
|
||||||
import { RightSideTab } from './RightSideLayout/RightSideTab'
|
import { RightSideTab } from './RightSideLayout/RightSideTab'
|
||||||
@ -16,6 +16,10 @@ struct Index {
|
|||||||
@Local isDragging:boolean=false;
|
@Local isDragging:boolean=false;
|
||||||
@Provider('LeftSideWidth') leftSideWidth:number=mwInfo.width * 0.1;
|
@Provider('LeftSideWidth') leftSideWidth:number=mwInfo.width * 0.1;
|
||||||
@Provider('RightSideWidth') rightSideWidth: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() {
|
build() {
|
||||||
//OpenCAX主界面整体布局,采用多行布局
|
//OpenCAX主界面整体布局,采用多行布局
|
||||||
Column() {
|
Column() {
|
||||||
|
|||||||
@ -69,6 +69,5 @@ export struct LeftSideTab {
|
|||||||
}.barHeight(0)
|
}.barHeight(0)
|
||||||
}.width(this.isExpanded?this.leftSideWidth:0)
|
}.width(this.isExpanded?this.leftSideWidth:0)
|
||||||
}.width('auto')
|
}.width('auto')
|
||||||
.backgroundColor($r('sys.color.background_secondary'))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,10 +61,8 @@ export struct ModelViewTab {
|
|||||||
.height('auto')
|
.height('auto')
|
||||||
.barMode(BarMode.Fixed)
|
.barMode(BarMode.Fixed)
|
||||||
.barPosition(BarPosition.Start)
|
.barPosition(BarPosition.Start)
|
||||||
.backgroundBlurStyle(BlurStyle.COMPONENT_THIN)
|
|
||||||
.fadingEdge(true)
|
.fadingEdge(true)
|
||||||
.barMode(BarMode.Scrollable)
|
.barMode(BarMode.Scrollable)
|
||||||
.backgroundColor($r('sys.color.comp_background_secondary'))
|
|
||||||
.divider({ strokeWidth: '1px', color: $r('sys.color.comp_divider') })
|
.divider({ strokeWidth: '1px', color: $r('sys.color.comp_divider') })
|
||||||
}else{
|
}else{
|
||||||
Image($r('app.media.base_background'))
|
Image($r('app.media.base_background'))
|
||||||
|
|||||||
@ -36,8 +36,6 @@ export struct RightSideTab {
|
|||||||
}).margin({ top: 2,left:1,bottom:0,right:2})
|
}).margin({ top: 2,left:1,bottom:0,right:2})
|
||||||
Blank().layoutWeight(1)
|
Blank().layoutWeight(1)
|
||||||
}.borderWidth(1)
|
}.borderWidth(1)
|
||||||
.borderColor(Color.Grey)
|
|
||||||
}.width('auto')
|
}.width('auto')
|
||||||
.backgroundColor($r('sys.color.background_secondary'))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,5 +64,7 @@ export struct TitleColumnSub {
|
|||||||
SubColumnMenu({menus:DisplayMode})
|
SubColumnMenu({menus:DisplayMode})
|
||||||
}.width('100%')
|
}.width('100%')
|
||||||
.height('100%')
|
.height('100%')
|
||||||
|
.backgroundBlurStyle(BlurStyle.Thin,
|
||||||
|
{ colorMode: ThemeColorMode.LIGHT, adaptiveColor: AdaptiveColor.DEFAULT, scale: 1.0 })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -87,6 +87,9 @@ export struct TitleTab {
|
|||||||
.barHeight(0)
|
.barHeight(0)
|
||||||
.barMode(BarMode.Fixed)
|
.barMode(BarMode.Fixed)
|
||||||
}.margin({ top:0, left: 0, bottom: 0, right: 0 })
|
}.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 })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user