增加部分建模功能图标.

增加按钮组下拉指示器
增加下拉指示器和按钮自适应按钮事件
This commit is contained in:
JackLee 2026-03-14 20:10:15 +08:00
parent 39770392e6
commit ad17e41ed5
33 changed files with 58 additions and 34 deletions

View File

@ -28,11 +28,16 @@ export struct EventBtn {
OCCTLoadModel(undefined,undefined)
}
})
Text()
.width('50vp')
.height('7vp')
.backgroundColor(Color.Transparent)
Text(this.eventBtn.eName)
.fontSize('10fp')
.width('45vp')
.fontSize('8fp')
.width('50vp')
.height('10vp')
.textAlign(TextAlign.Center)
.backgroundColor(Color.Transparent)
}
}
.height('50vp')

View File

@ -55,7 +55,7 @@ export struct GroupTextEventMenu {
export struct MenuBtn {
@Param menuBtn: Array<TitleButton> | undefined = undefined;
@Param iconState: boolean = false;
@Local curtIndex:number=0;
@Builder
EventMenu() {
Menu() {
@ -68,6 +68,9 @@ export struct MenuBtn {
bottom: 0,
right: 0
})
.onClick(()=>{
this.curtIndex=index;
})
})
}
}
@ -79,18 +82,26 @@ export struct MenuBtn {
.bindMenu(this.EventMenu)
.width('35vp')
.height('35vp')
.backgroundImage($r('app.media.' + this.menuBtn[0].eIcon))
.backgroundImage($r('app.media.' + this.menuBtn[this.curtIndex].eIcon))
.backgroundImagePosition({ x: '10%', y: '10%' })
.backgroundColor(Color.Transparent)
.backgroundImageSize({
width: '80%', // 图片宽度占满按钮
height: '80%' // 图片高度占满按钮
})
Text(this.menuBtn[0].eName)
.fontSize('10fp')
.width('45vp')
Button()
.bindMenu(this.EventMenu)
.width('50vp')
.height('7vp')
.backgroundImage($r('app.media.base_chevron_down'))
.backgroundImagePosition({ x: '35%', y: '-50%' })
.backgroundColor(Color.Transparent)
Text(this.menuBtn[this.curtIndex].eName)
.fontSize('8fp')
.width('50vp')
.height('10vp')
.textAlign(TextAlign.Center)
}
}
.height('50vp')

View File

@ -12,45 +12,45 @@ export let TitleCAD:Array<TitleModel>=[
[
//数组成员区别是GroupEvent还是BtnEvent
[{grpName:'构建',grpBtn:[
{eModel:[ModelType.BASE],eName:"草图",eNamed:"",eIcon:"base_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"草图",eNamed:"",eIcon:"sketch",eTips:"",eEvent:""},
[
{eModel:[ModelType.BASE],eName:"基准平面",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"基准轴",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"基准坐标系",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"基准平面栅格",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"调整基准坐标系大小",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"打印坐标系",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"基准平面",eNamed:"",eIcon:"standard_datumplane",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"基准轴",eNamed:"",eIcon:"standard_datumaxis",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"基准坐标系",eNamed:"",eIcon:"standard_datumcsys",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"基准平面栅格",eNamed:"",eIcon:"standard_datum_plane_grid_nonwkpt",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"调整基准坐标系大小",eNamed:"",eIcon:"standard_resize_datum_plane",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"打印坐标系",eNamed:"",eIcon:"standard_print_csys",eTips:"",eEvent:""},
],
[
{eModel:[ModelType.BASE],eName:"点",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"直线",eNamed:"",eIcon:"base_close_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"圆弧/圆",eNamed:"",eIcon:"base_import_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"样条",eNamed:"",eIcon:"base_export_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"艺术样条",eNamed:"",eIcon:"base_export_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"文本",eNamed:"",eIcon:"base_export_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"点集",eNamed:"",eIcon:"base_export_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"参考点云",eNamed:"",eIcon:"base_export_file",eTips:"",eEvent:""}
{eModel:[ModelType.BASE],eName:"点",eNamed:"",eIcon:"sketch_point",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"直线",eNamed:"",eIcon:"sketch_line",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"圆弧/圆",eNamed:"",eIcon:"sketch_arc",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"样条",eNamed:"",eIcon:"sketch_spline",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"艺术样条",eNamed:"",eIcon:"sketch_spline",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"文本",eNamed:"",eIcon:"sketch_styler_label",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"点集",eNamed:"",eIcon:"sketch_point_set",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"参考点云",eNamed:"",eIcon:"sketch_reference_point_cloud",eTips:"",eEvent:""}
]
],grpMenu:GroupOption}] as Array<TitleGroup>,
[{grpName:'基本',grpBtn:[
[
{eModel:[ModelType.BASE],eName:"拉伸",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"旋转",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"拉伸",eNamed:"",eIcon:"modeling_extrude",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"旋转",eNamed:"",eIcon:"modeling_revolution",eTips:"",eEvent:""},
],
[
{eModel:[ModelType.BASE],eName:"合并",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"减去",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"求交",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"合并",eNamed:"",eIcon:"modeling_booleanunite",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"减去",eNamed:"",eIcon:"modeling_booleansubtract",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"求交",eNamed:"",eIcon:"modeling_booleanintersect",eTips:"",eEvent:""},
],
[
{eModel:[ModelType.BASE],eName:"凸起",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"凸起体",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"凸起",eNamed:"",eIcon:"modeling_emboss",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"凸起体",eNamed:"",eIcon:"modeling_emboss_body",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"组合",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"缝合",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"补片",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"缝合",eNamed:"",eIcon:"modeling_sew",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"补片",eNamed:"",eIcon:"modeling_patch",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"拼合",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"偏置凸起",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"装配切割",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"装配切割",eNamed:"",eIcon:"modeling_assembly_cut",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"取消缝合",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"连接面",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"构造实体",eNamed:"",eIcon:"base_open_file",eTips:"",eEvent:""},

View File

@ -19,6 +19,14 @@ export struct TitleTab {
@Local titleBarDefaultFocusIndex: number = 0;
//模块Bar栏
@Provider('curtModel') curtModel:Array<TitleModel>|undefined= TitleData.mModels.get(this.titleBarFocusIndex)
@Local indicatorColor: Color = Color.Blue;
@Local indicatorWidth: number = 40;
@Local indicatorHeight: number = 5;
@Local indicatorBorderRadius: number = 5;
@Local indicatorSpace: number = 10;
@Local subTabBorderRadius: number = 20;
@Local selectedMode: SelectedMode = SelectedMode.INDICATOR;
@Builder
FileMenu(menus: Array<TitleButton>) {
Menu() {
@ -52,7 +60,7 @@ export struct TitleTab {
.width(60)
.padding(5)
.type(ButtonType.Normal)
.backgroundColor(Color.Brown)
.backgroundColor(index === this.titleBarFocusIndex ? Color.Blue : Color.Brown)
.onClick(() => {
this.titleBarTabs.changeIndex(index);
this.titleBarFocusIndex = index;
@ -75,7 +83,7 @@ export struct TitleTab {
.margin({ top: 0,left:0,bottom:0,right:0})
})
}.scrollable(false)
.barHeight(0)
.barHeight(0)
.margin({ top: 0,left:0,bottom:0,right:0})
.height('auto')
.barMode(BarMode.Fixed)

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB