修改整体软件界面背景颜色

This commit is contained in:
JackLee 2026-03-19 23:32:26 +08:00
parent e0d893216f
commit 322156acde
10 changed files with 32 additions and 28 deletions

View File

@ -44,7 +44,6 @@ export struct EventBtn {
} }
} }
//仅仅用于模块切换 //仅仅用于模块切换
@ComponentV2 @ComponentV2
export struct SwitchModelBtn { export struct SwitchModelBtn {

View File

@ -23,7 +23,7 @@ struct Index {
.height(this.mwInfo.mainWindowHeight * 0.1) .height(this.mwInfo.mainWindowHeight * 0.1)
.borderRadius(5) .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() { Row() {
TitleColumnSub(); TitleColumnSub();
@ -32,12 +32,12 @@ struct Index {
.height(this.mwInfo.mainWindowHeight * 0.03) .height(this.mwInfo.mainWindowHeight * 0.03)
.align(Alignment.Start) .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() { Row() {
//左侧边导航区 //左侧边导航区
LeftSideTab() 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) => { .onMouse((event) => {
if(event.button==MouseButton.Left&&event.action==MouseAction.Press){ if(event.button==MouseButton.Left&&event.action==MouseAction.Press){
this.startX = event.screenX; // 记录起始坐标 this.startX = event.screenX; // 记录起始坐标
@ -62,13 +62,14 @@ struct Index {
}.width('100%') }.width('100%')
.height(this.mwInfo.mainWindowHeight * 0.36) .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() { Column() {
Text('状态栏') Text('状态栏')
}.width('100%') }.width('100%')
.height(this.mwInfo.mainWindowHeight * 0.05) .height(this.mwInfo.mainWindowHeight * 0.05)
}.width('100%') }.backgroundColor('#f3f3f0')
.width('100%')
.height('100%') .height('100%')
} }
} }

View File

@ -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_tools",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"帮助",eNamed:"",ePage:'',eIcon:"base_help_file",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:""}, {eModel:[ModelType.BASE],eName:"退出",eNamed:"",ePage:'',eIcon:"base_exit_icon",eTips:"",eEvent:""},
]} ]}

View File

@ -4,10 +4,12 @@ import { DevModel, MatrixModel } from "./MatrixModel";
import { ModelType } from "./ModelType"; import { ModelType } from "./ModelType";
import { GroupOption } from "./GroupOption"; import { GroupOption } from "./GroupOption";
import { TitleModel } from "./TabContent"; import { TitleModel } from "./TabContent";
import { FileModel } from "./FileModel";
//主页栏目布局数据 //主页栏目布局数据
export let TitleMainPage:Array<TitleModel>= export let TitleMainPage:Array<TitleModel>=
[{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_new_file",eTips:"",eEvent:""},
{eModel:[ModelType.BASE],eName:"打开",eNamed:"",ePage:'',eIcon:"base_open_file",eTips:"",eEvent:""}, {eModel:[ModelType.BASE],eName:"打开",eNamed:"",ePage:'',eIcon:"base_open_file",eTips:"",eEvent:""},
[ [

View File

@ -85,5 +85,6 @@ export struct LeftSideTab {
} }
}.width(this.panelWidth) }.width(this.panelWidth)
}.width('auto') }.width('auto')
.backgroundColor('#f3f3f0')
} }
} }

View File

@ -50,7 +50,6 @@ export struct TitleColumnSub {
.height(25) .height(25)
.width(25) .width(25)
.padding(1) .padding(1)
.backgroundColor(Color.Transparent)
.backgroundImage($r('app.media.base_shortcut_menu')) .backgroundImage($r('app.media.base_shortcut_menu'))
.backgroundImagePosition({ x: '10%', y: '10%' }) .backgroundImagePosition({ x: '10%', y: '10%' })
.backgroundImageSize({ .backgroundImageSize({
@ -99,14 +98,6 @@ export struct TitleColumnSub {
.backgroundImage($r('app.media.'+DisplayMode[0].eIcon)) .backgroundImage($r('app.media.'+DisplayMode[0].eIcon))
.backgroundImageSize({ width: '100%', height: '100%' }) .backgroundImageSize({ width: '100%', height: '100%' })
.bindMenu(this.DisplayModeMenu(DisplayMode)) .bindMenu(this.DisplayModeMenu(DisplayMode))
// Button('创建并显示子窗口')
// .onClick(() => {
// this.createAndShowSubWindow();
// })
// Button('关闭子窗口')
// .onClick(() => {
// this.closeSubWindow();
// })
}.margin({ top: 1, left: 1, bottom: 1, right: 1 }) }.margin({ top: 1, left: 1, bottom: 1, right: 1 })
} }

View File

@ -9,7 +9,7 @@ import { TitleButton } from '../LayoutInterface/Interface/ButtonInterface'
import { TitleGroup } from '../LayoutInterface/Interface/GroupInterface' import { TitleGroup } from '../LayoutInterface/Interface/GroupInterface'
import {TitleTabContent} from './TitleTabContent' import {TitleTabContent} from './TitleTabContent'
import { MainWindowInfo } from '../AppStorageV2Class'; import { MainWindowInfo } from '../AppStorageV2Class';
import { AppStorageV2 } from '@kit.ArkUI'; import { AppStorageV2, CommonModifier, TabTitleBar } from '@kit.ArkUI';
@Entry @Entry
@ComponentV2 @ComponentV2
@ -34,29 +34,32 @@ export struct TitleTab {
}) })
} }
} }
build() { build() {
Flex({ direction: FlexDirection.Column }){ Flex({ direction: FlexDirection.Column }){
Scroll() { Scroll() {
Row({space:0}) { Row({space:0}) {
Button(TitleData.mFileModel.cmName) Button(TitleData.mFileModel.cmName)
.fontSize(16) .fontSize(16)
.fontColor(Color.Black)
.height(this.mwInfo.mainWindowHeight*0.025) .height(this.mwInfo.mainWindowHeight*0.025)
.width(this.mwInfo.mainWindowWidth*0.035) .width(this.mwInfo.mainWindowWidth*0.035)
.bindMenu(this.FileMenu(TitleData.mFileModel.cmEvents as Array<TitleButton>)) .bindMenu(this.FileMenu(TitleData.mFileModel.cmEvents as Array<TitleButton>))
.type(ButtonType.Normal) .type(ButtonType.Normal)
.backgroundColor(Color.Brown) .backgroundColor('#f3f3f0')
ForEach(this.curtModel, (item: TitleModel, index: number) => { ForEach(this.curtModel, (item: TitleModel, index: number) => {
Button(item.cmName) Button(item.cmName)
.fontSize(16) .fontSize(16)
.fontColor(Color.Black)
.fontWeight(index === this.titleBarFocusIndex ? FontWeight.Bold : FontWeight.Normal) .fontWeight(index === this.titleBarFocusIndex ? FontWeight.Bold : FontWeight.Normal)
.height(this.mwInfo.mainWindowHeight*0.025) .height(this.mwInfo.mainWindowHeight*0.025)
.width(this.mwInfo.mainWindowWidth*0.035) .width(this.mwInfo.mainWindowWidth*0.035)
.type(ButtonType.Normal) .type(ButtonType.Normal)
.backgroundColor(index === this.titleBarFocusIndex ? Color.Blue : Color.Brown) .backgroundColor('#f3f3f0')
.onClick(() => { .onClick(() => {
this.titleBarTabs.changeIndex(index); this.titleBarTabs.changeIndex(index);
this.titleBarFocusIndex = index; this.titleBarFocusIndex = index;
//this.currentModel=TitleData.mModels.get(index);
}) })
.onAxisEvent((event?: AxisEvent) => { .onAxisEvent((event?: AxisEvent) => {
if (event?.hasAxis(AxisType.VERTICAL_AXIS)) { if (event?.hasAxis(AxisType.VERTICAL_AXIS)) {
@ -73,7 +76,13 @@ export struct TitleTab {
.margin({ top: 2,left:2,bottom:0,right:2}) .margin({ top: 2,left:2,bottom:0,right:2})
.width('100%') .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}){ Tabs({barPosition: BarPosition.Start, index: this.titleBarDefaultFocusIndex,controller: this.titleBarTabs}){
ForEach(this.curtModel,(item:TitleModel, index: number)=>{ ForEach(this.curtModel,(item:TitleModel, index: number)=>{
TabContent() { TabContent() {
@ -81,9 +90,8 @@ export struct TitleTab {
}.align(Alignment.Start) }.align(Alignment.Start)
}) })
}.scrollable(true) }.scrollable(true)
.barHeight(0) .barHeight(0)
.barMode(BarMode.Fixed) .barMode(BarMode.Fixed)
}.width(this.mwInfo.mainWindowWidth) }.width(this.mwInfo.mainWindowWidth)
.backgroundColor('#F8F9FA')
} }
} }

View File

@ -48,7 +48,7 @@ export struct TitleTabContent {
//功能组名 //功能组名
GroupTextEventMenu({grpEvent:group_item}) GroupTextEventMenu({grpEvent:group_item})
}.height(this.mwInfo.mainWindowHeight*0.073) }.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{ }else{
//菜单按钮 //菜单按钮
@ -65,6 +65,6 @@ export struct TitleTabContent {
.align(Alignment.BottomEnd) .align(Alignment.BottomEnd)
.borderColor(Color.Gray) .borderColor(Color.Gray)
}) })
}.margin({ top: 1,left:1,bottom:1,right:1}) }.margin({ top: 5,left:1,bottom:1,right:1})
} }
} }

View File

@ -59,7 +59,7 @@ export struct ModelView {
Row(){ Row(){
ContentSlot(this.nodeContent); ContentSlot(this.nodeContent);
}.layoutWeight(1) }.layoutWeight(1)
} }.backgroundColor('#f3f3f0')
.width('100%') .width('100%')
.height('100%'); .height('100%');
} }

View File

@ -64,6 +64,8 @@ export struct ModelViewTab {
.height('auto') .height('auto')
.barMode(BarMode.Fixed) .barMode(BarMode.Fixed)
}.borderWidth('1') }.borderWidth('1')
.borderColor(Color.Grey)
.height('auto') .height('auto')
.backgroundColor('#f3f3f0')
} }
} }