1-修改主页导航模式
2-删除filemenus,就是tabbars独立标签弹出menus栏目.右文件和子栏菜单代替.
This commit is contained in:
parent
45176b5d7e
commit
34037a0908
@ -36,8 +36,8 @@ function SetWinSize (width:number,height:number){
|
||||
}
|
||||
function SetBackgroundColor(){
|
||||
if(mdwInfo.win){
|
||||
mdwInfo.win.setWindowBackgroundColor('#B3FFFFFF');
|
||||
mdwInfo.win.setWindowContainerColor('#B3FFFFFF', '#FFFFFFFF');
|
||||
mdwInfo.win.setWindowBackgroundColor('#D9FFFFFF');
|
||||
mdwInfo.win.setWindowContainerColor('#D9FFFFFF', '#FFFFFFFF');
|
||||
}
|
||||
}
|
||||
//窗口的事件监听
|
||||
|
||||
@ -70,8 +70,8 @@ struct Index {
|
||||
//OpenCAX主界面整体布局,采用多行布局
|
||||
Column() {
|
||||
//头部导航功能区
|
||||
Blank().height(uiMode.state?mdwInfo.displayHeight*0.07:0)
|
||||
//TitleTab().height(uiMode.state?mdwInfo.displayHeight*0.07:0)
|
||||
//Blank().height(uiMode.state?mdwInfo.displayHeight*0.07:0)
|
||||
TitleTab().height(uiMode.state?mdwInfo.displayHeight*0.075:0)
|
||||
//分割线
|
||||
Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey)
|
||||
//工具栏
|
||||
@ -118,7 +118,7 @@ struct Index {
|
||||
.height(mdwInfo.displayHeight*0.02)
|
||||
.backgroundColor(Color.Transparent)
|
||||
}
|
||||
TitleTab().height(uiMode.state?mdwInfo.displayHeight*0.07:0)
|
||||
//TitleTab().height(uiMode.state?mdwInfo.displayHeight*0.07:0)
|
||||
|
||||
}.width('100%')
|
||||
.height('100%')
|
||||
|
||||
@ -7,12 +7,6 @@ import {
|
||||
|
||||
import { TitleEditBars } from "./TitleEditBars";
|
||||
|
||||
//文件菜单数据初始化
|
||||
export let FileMenu:BaseMenuData= {
|
||||
aMenus: TitleEditBars.mFileModel[0][0].grpBtn,
|
||||
aIndex: 0
|
||||
};
|
||||
|
||||
//图层切换
|
||||
export let SwitchLayout:Array<TitleButton>=[
|
||||
{btnModel:[ModelType.BASE],btnName:"图层设置",btnNamed:"",btnIcon:"layer_settings",btnTips:"图层设置",btnEvent:{uid:'',command:'',page:'',type:EventType.EVENT,args:[]}},
|
||||
|
||||
@ -4,7 +4,6 @@ import { ViewDialog } from "../customcontroller/Dialog"
|
||||
import { mdwInfo } from '../dispwininfo/DispWinInfo'
|
||||
import { SubColumnMenu} from "../customcontroller/Button"
|
||||
import {
|
||||
FileMenu,
|
||||
SwitchLayout,
|
||||
SwitchView,
|
||||
SwitchDisplayMode,
|
||||
@ -12,6 +11,8 @@ import {
|
||||
EditMode,
|
||||
ControlMode
|
||||
} from '../layout/SubColumn'
|
||||
import { TitleEditBars } from "../layout/TitleEditBars";
|
||||
|
||||
@ComponentV2
|
||||
export struct TitleColumnSub {
|
||||
@Local layerArray: Array<TitleButton> = [];
|
||||
@ -37,7 +38,7 @@ export struct TitleColumnSub {
|
||||
build(){
|
||||
Row({space:5}){
|
||||
SubColumnMenu({
|
||||
menus:FileMenu.aMenus as Array<TitleButton>, icon:'base_shortcut_menu',name:'菜单'})
|
||||
menus:TitleEditBars.mFileModel[0][0].grpBtn as Array<TitleButton>, icon:'base_shortcut_menu',name:'菜单'})
|
||||
.margin({ top:0, left: 5, bottom: 0, right: 0 })
|
||||
Text('|')
|
||||
.fontSize(16)
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
import { hilog } from '@kit.PerformanceAnalysisKit';
|
||||
import {TitleModel} from '../interface/ModelInterface'
|
||||
import {TitleEditBars} from '../layout/TitleEditBars'
|
||||
import { FileMenu } from "../layout/SubColumn";
|
||||
import {TitleTabContent} from './TitleTabContent'
|
||||
import { TitleButton } from '../interface/ButtonInterface';
|
||||
import { BaseMenu } from '../customcontroller/Menu';
|
||||
import {
|
||||
LengthMetrics, SegmentButtonV2ItemOptions,
|
||||
SegmentButtonV2Items,
|
||||
TabSegmentButtonV2
|
||||
} from '@kit.ArkUI';
|
||||
|
||||
@Entry
|
||||
@ComponentV2
|
||||
@ -14,52 +16,32 @@ export struct TitleTab {
|
||||
//当前的顶部导航选择页
|
||||
@Local selectedIndex: number = 0; // 当前选中的索引
|
||||
//模块Bar栏
|
||||
@Provider('curtModel') curtModel:Array<TitleModel>|undefined= TitleEditBars.mModels.get(this.selectedIndex)
|
||||
@Provider('curtModel') curtModel?:Array<TitleModel>= TitleEditBars.mModels.get(this.selectedIndex)
|
||||
//current segmentItems Count
|
||||
@Local segmentItemsCount:number=0;
|
||||
|
||||
@Computed
|
||||
get segmentItems(): SegmentButtonV2Items {
|
||||
const options = (this.curtModel as Array<TitleModel>).map(item => {
|
||||
return {text: item.cmName} as SegmentButtonV2ItemOptions;
|
||||
});
|
||||
this.segmentItemsCount=options.length;
|
||||
return new SegmentButtonV2Items(options);
|
||||
}
|
||||
@Builder
|
||||
build() {
|
||||
Flex({ direction: FlexDirection.Column }){
|
||||
Scroll() {
|
||||
Row({space:0}) {
|
||||
Button((FileMenu.aMenus[0] as TitleButton).btnName)
|
||||
.width('7%')
|
||||
.fontSize(16)
|
||||
.fontColor($r('sys.color.font'))
|
||||
.bindMenu(BaseMenu(FileMenu))
|
||||
.type(ButtonType.Normal)
|
||||
.backgroundColor(Color.Transparent)
|
||||
ForEach(this.curtModel, (item: TitleModel, index: number) => {
|
||||
Button(){
|
||||
Column(){
|
||||
Text(item.cmName)
|
||||
.height('95%')
|
||||
.fontSize(index === this.selectedIndex ? 18 : 16)
|
||||
.fontWeight(index === this.selectedIndex ? FontWeight.Bold : FontWeight.Normal)
|
||||
.backgroundColor(Color.Transparent)
|
||||
|
||||
Divider()
|
||||
.height('5%')
|
||||
.vertical(false)
|
||||
.strokeWidth(2)
|
||||
.lineCap(LineCapStyle.Round)
|
||||
.color(Color.Grey)
|
||||
.align(Alignment.Top)
|
||||
.visibility(index === this.selectedIndex?Visibility.Visible:Visibility.Hidden)
|
||||
}.width('100%')
|
||||
.height('100%')
|
||||
}
|
||||
.width('7%')
|
||||
.backgroundColor(index === this.selectedIndex ? $r('sys.color.container_modal_button_normal_baseboard') : Color.Transparent)
|
||||
.type(ButtonType.Normal)
|
||||
.onClick(() => {
|
||||
this.titleBarTabs.changeIndex(index);
|
||||
this.selectedIndex = index;
|
||||
})
|
||||
})
|
||||
TabSegmentButtonV2({
|
||||
items: this.segmentItems,
|
||||
selectedIndex: this.selectedIndex!!,
|
||||
itemSelectedFontSize:LengthMetrics.fp(16)
|
||||
}).width((8*this.segmentItemsCount)<100?`${8 * this.segmentItemsCount}%` : '100%')
|
||||
Blank().layoutWeight(1)
|
||||
}
|
||||
}
|
||||
.height('25%')
|
||||
.height('30%')
|
||||
.align(Alignment.Start)
|
||||
.scrollable(ScrollDirection.Horizontal)
|
||||
.scrollBar(BarState.Off)
|
||||
@ -79,7 +61,7 @@ export struct TitleTab {
|
||||
}
|
||||
})
|
||||
}
|
||||
.height('75%')
|
||||
.height('70%')
|
||||
.scrollable(true)
|
||||
.barHeight(0)
|
||||
.barMode(BarMode.Fixed)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user