From 322156acde1b0e034db214a47a93741f59245aa7 Mon Sep 17 00:00:00 2001 From: JackLee <809262979@qq.com> Date: Thu, 19 Mar 2026 23:32:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B4=E4=BD=93=E8=BD=AF?= =?UTF-8?q?=E4=BB=B6=E7=95=8C=E9=9D=A2=E8=83=8C=E6=99=AF=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/ets/pages/CustomStyle/Button.ets | 1 - entry/src/main/ets/pages/Index.ets | 11 +++++---- .../LayoutInterface/Layout/FileModel.ets | 2 +- .../pages/LayoutInterface/Layout/MainPage.ets | 4 +++- .../ets/pages/LeftSideLayout/LeftSideTab.ets | 1 + .../ets/pages/TitleLayout/TitleColumnSub.ets | 9 ------- .../main/ets/pages/TitleLayout/TitleTab.ets | 24 ++++++++++++------- .../ets/pages/TitleLayout/TitleTabContent.ets | 4 ++-- entry/src/main/ets/pages/modelView.ets | 2 +- entry/src/main/ets/pages/modelViewTab.ets | 2 ++ 10 files changed, 32 insertions(+), 28 deletions(-) diff --git a/entry/src/main/ets/pages/CustomStyle/Button.ets b/entry/src/main/ets/pages/CustomStyle/Button.ets index 4263e671..53a71019 100644 --- a/entry/src/main/ets/pages/CustomStyle/Button.ets +++ b/entry/src/main/ets/pages/CustomStyle/Button.ets @@ -44,7 +44,6 @@ export struct EventBtn { } } - //仅仅用于模块切换 @ComponentV2 export struct SwitchModelBtn { diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 75bc0702..b71205bd 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -23,7 +23,7 @@ struct Index { .height(this.mwInfo.mainWindowHeight * 0.1) .borderRadius(5) //分割线 - Divider().vertical(false).strokeWidth(2).color(0x000000).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Gray) + Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey) //工具栏 Row() { TitleColumnSub(); @@ -32,12 +32,12 @@ struct Index { .height(this.mwInfo.mainWindowHeight * 0.03) .align(Alignment.Start) //分割线 - Divider().vertical(false).strokeWidth(2).color(0x000000).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Gray) + Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey) Row() { //左侧边导航区 LeftSideTab() // 拖拽手柄 - Divider().vertical(true).strokeWidth(3).color(0x000000).lineCap(LineCapStyle.Round).height('100%').backgroundColor(Color.Gray) + Divider().vertical(true).strokeWidth(3).lineCap(LineCapStyle.Round).height('100%').backgroundColor(Color.Grey) .onMouse((event) => { if(event.button==MouseButton.Left&&event.action==MouseAction.Press){ this.startX = event.screenX; // 记录起始坐标 @@ -62,13 +62,14 @@ struct Index { }.width('100%') .height(this.mwInfo.mainWindowHeight * 0.36) //分割线 - Divider().vertical(false).strokeWidth(2).color(0x000000).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Gray) + Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey) ///状态栏 Column() { Text('状态栏') }.width('100%') .height(this.mwInfo.mainWindowHeight * 0.05) - }.width('100%') + }.backgroundColor('#f3f3f0') + .width('100%') .height('100%') } } diff --git a/entry/src/main/ets/pages/LayoutInterface/Layout/FileModel.ets b/entry/src/main/ets/pages/LayoutInterface/Layout/FileModel.ets index 09f4678e..d03bfda9 100644 --- a/entry/src/main/ets/pages/LayoutInterface/Layout/FileModel.ets +++ b/entry/src/main/ets/pages/LayoutInterface/Layout/FileModel.ets @@ -13,4 +13,4 @@ export let FileModel:TitleModel={cmName:"文件",cmPage:"",cmTips:"",cmEvents:[ {eModel:[ModelType.BASE],eName:"工具",eNamed:"",ePage:'',eIcon:"base_tools",eTips:"",eEvent:""}, {eModel:[ModelType.BASE],eName:"帮助",eNamed:"",ePage:'',eIcon:"base_help_file",eTips:"",eEvent:""}, {eModel:[ModelType.BASE],eName:"退出",eNamed:"",ePage:'',eIcon:"base_exit_icon",eTips:"",eEvent:""}, -]} \ No newline at end of file +]} diff --git a/entry/src/main/ets/pages/LayoutInterface/Layout/MainPage.ets b/entry/src/main/ets/pages/LayoutInterface/Layout/MainPage.ets index 9ef4358f..975f1b4b 100644 --- a/entry/src/main/ets/pages/LayoutInterface/Layout/MainPage.ets +++ b/entry/src/main/ets/pages/LayoutInterface/Layout/MainPage.ets @@ -4,10 +4,12 @@ import { DevModel, MatrixModel } from "./MatrixModel"; import { ModelType } from "./ModelType"; import { GroupOption } from "./GroupOption"; import { TitleModel } from "./TabContent"; +import { FileModel } from "./FileModel"; //主页栏目布局数据 export let TitleMainPage:Array= - [{cmName:'主页',cmPage:'',cmTips:'',cmEvents: [[[{grpName:'文件功能组',grpBtn:[ + [ + {cmName:'主页',cmPage:'',cmTips:'',cmEvents: [[[{grpName:'文件功能组',grpBtn:[ {eModel:[ModelType.BASE],eName:"新建",eNamed:"",ePage:'',eIcon:"base_new_file",eTips:"",eEvent:""}, {eModel:[ModelType.BASE],eName:"打开",eNamed:"",ePage:'',eIcon:"base_open_file",eTips:"",eEvent:""}, [ diff --git a/entry/src/main/ets/pages/LeftSideLayout/LeftSideTab.ets b/entry/src/main/ets/pages/LeftSideLayout/LeftSideTab.ets index 5e1f74bb..8547753f 100644 --- a/entry/src/main/ets/pages/LeftSideLayout/LeftSideTab.ets +++ b/entry/src/main/ets/pages/LeftSideLayout/LeftSideTab.ets @@ -85,5 +85,6 @@ export struct LeftSideTab { } }.width(this.panelWidth) }.width('auto') + .backgroundColor('#f3f3f0') } } diff --git a/entry/src/main/ets/pages/TitleLayout/TitleColumnSub.ets b/entry/src/main/ets/pages/TitleLayout/TitleColumnSub.ets index e2a702af..121e238f 100644 --- a/entry/src/main/ets/pages/TitleLayout/TitleColumnSub.ets +++ b/entry/src/main/ets/pages/TitleLayout/TitleColumnSub.ets @@ -50,7 +50,6 @@ export struct TitleColumnSub { .height(25) .width(25) .padding(1) - .backgroundColor(Color.Transparent) .backgroundImage($r('app.media.base_shortcut_menu')) .backgroundImagePosition({ x: '10%', y: '10%' }) .backgroundImageSize({ @@ -99,14 +98,6 @@ export struct TitleColumnSub { .backgroundImage($r('app.media.'+DisplayMode[0].eIcon)) .backgroundImageSize({ width: '100%', height: '100%' }) .bindMenu(this.DisplayModeMenu(DisplayMode)) - // Button('创建并显示子窗口') - // .onClick(() => { - // this.createAndShowSubWindow(); - // }) - // Button('关闭子窗口') - // .onClick(() => { - // this.closeSubWindow(); - // }) }.margin({ top: 1, left: 1, bottom: 1, right: 1 }) } diff --git a/entry/src/main/ets/pages/TitleLayout/TitleTab.ets b/entry/src/main/ets/pages/TitleLayout/TitleTab.ets index b4421831..b497b250 100644 --- a/entry/src/main/ets/pages/TitleLayout/TitleTab.ets +++ b/entry/src/main/ets/pages/TitleLayout/TitleTab.ets @@ -9,7 +9,7 @@ import { TitleButton } from '../LayoutInterface/Interface/ButtonInterface' import { TitleGroup } from '../LayoutInterface/Interface/GroupInterface' import {TitleTabContent} from './TitleTabContent' import { MainWindowInfo } from '../AppStorageV2Class'; -import { AppStorageV2 } from '@kit.ArkUI'; +import { AppStorageV2, CommonModifier, TabTitleBar } from '@kit.ArkUI'; @Entry @ComponentV2 @@ -34,29 +34,32 @@ export struct TitleTab { }) } } + build() { Flex({ direction: FlexDirection.Column }){ Scroll() { Row({space:0}) { Button(TitleData.mFileModel.cmName) .fontSize(16) + .fontColor(Color.Black) .height(this.mwInfo.mainWindowHeight*0.025) .width(this.mwInfo.mainWindowWidth*0.035) .bindMenu(this.FileMenu(TitleData.mFileModel.cmEvents as Array)) .type(ButtonType.Normal) - .backgroundColor(Color.Brown) + .backgroundColor('#f3f3f0') + ForEach(this.curtModel, (item: TitleModel, index: number) => { Button(item.cmName) .fontSize(16) + .fontColor(Color.Black) .fontWeight(index === this.titleBarFocusIndex ? FontWeight.Bold : FontWeight.Normal) .height(this.mwInfo.mainWindowHeight*0.025) .width(this.mwInfo.mainWindowWidth*0.035) .type(ButtonType.Normal) - .backgroundColor(index === this.titleBarFocusIndex ? Color.Blue : Color.Brown) + .backgroundColor('#f3f3f0') .onClick(() => { this.titleBarTabs.changeIndex(index); this.titleBarFocusIndex = index; - //this.currentModel=TitleData.mModels.get(index); }) .onAxisEvent((event?: AxisEvent) => { if (event?.hasAxis(AxisType.VERTICAL_AXIS)) { @@ -73,7 +76,13 @@ export struct TitleTab { .margin({ top: 2,left:2,bottom:0,right:2}) .width('100%') //分割线 - Divider().vertical(false).strokeWidth(2).color(0x000000).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Gray) + Divider() + .vertical(false) + .strokeWidth(1) + .lineCap(LineCapStyle.Round) + .width('100%') + .backgroundColor(Color.Grey) + Tabs({barPosition: BarPosition.Start, index: this.titleBarDefaultFocusIndex,controller: this.titleBarTabs}){ ForEach(this.curtModel,(item:TitleModel, index: number)=>{ TabContent() { @@ -81,9 +90,8 @@ export struct TitleTab { }.align(Alignment.Start) }) }.scrollable(true) - .barHeight(0) - .barMode(BarMode.Fixed) + .barHeight(0) + .barMode(BarMode.Fixed) }.width(this.mwInfo.mainWindowWidth) - .backgroundColor('#F8F9FA') } } diff --git a/entry/src/main/ets/pages/TitleLayout/TitleTabContent.ets b/entry/src/main/ets/pages/TitleLayout/TitleTabContent.ets index d362bfe4..97a485e9 100644 --- a/entry/src/main/ets/pages/TitleLayout/TitleTabContent.ets +++ b/entry/src/main/ets/pages/TitleLayout/TitleTabContent.ets @@ -48,7 +48,7 @@ export struct TitleTabContent { //功能组名 GroupTextEventMenu({grpEvent:group_item}) }.height(this.mwInfo.mainWindowHeight*0.073) - Divider().vertical(true).strokeWidth(2).color(0x000000).lineCap(LineCapStyle.Round).height('100%').backgroundColor(Color.Gray) + Divider().vertical(true).strokeWidth(1).lineCap(LineCapStyle.Round).height('95%').backgroundColor(Color.Gray) }) }else{ //菜单按钮 @@ -65,6 +65,6 @@ export struct TitleTabContent { .align(Alignment.BottomEnd) .borderColor(Color.Gray) }) - }.margin({ top: 1,left:1,bottom:1,right:1}) + }.margin({ top: 5,left:1,bottom:1,right:1}) } } \ No newline at end of file diff --git a/entry/src/main/ets/pages/modelView.ets b/entry/src/main/ets/pages/modelView.ets index 03d92551..5a571e72 100644 --- a/entry/src/main/ets/pages/modelView.ets +++ b/entry/src/main/ets/pages/modelView.ets @@ -59,7 +59,7 @@ export struct ModelView { Row(){ ContentSlot(this.nodeContent); }.layoutWeight(1) - } + }.backgroundColor('#f3f3f0') .width('100%') .height('100%'); } diff --git a/entry/src/main/ets/pages/modelViewTab.ets b/entry/src/main/ets/pages/modelViewTab.ets index f9d1d205..d73da5c7 100644 --- a/entry/src/main/ets/pages/modelViewTab.ets +++ b/entry/src/main/ets/pages/modelViewTab.ets @@ -64,6 +64,8 @@ export struct ModelViewTab { .height('auto') .barMode(BarMode.Fixed) }.borderWidth('1') + .borderColor(Color.Grey) .height('auto') + .backgroundColor('#f3f3f0') } }