1-修复分层图标背景色错误问题
2-右侧边栏默认关闭 3-修复边栏状态问题 4-软件下一次push将改名为INCAX(该次改名为最终名字(前提商标不被注册))
This commit is contained in:
parent
24f3e64f61
commit
e74cb4ee1c
@ -5,7 +5,7 @@ import { RightSideTab } from './rightside/RightSideTab'
|
||||
import { View } from './view/View'
|
||||
import { TitleColumnSub } from './titletabs/TitleColumnSub'
|
||||
import { mdwInfo } from './dispwininfo/DispWinInfo'
|
||||
import { uiMode } from './eventhub/EventBase'
|
||||
import { sideState } from './eventhub/EventBase'
|
||||
const DOMAIN = 0x0000;
|
||||
|
||||
//分割线类型,分左和右
|
||||
@ -71,7 +71,7 @@ struct Index {
|
||||
Column() {
|
||||
//头部导航功能区
|
||||
//Blank().height(uiMode.state?mdwInfo.displayHeight*0.07:0)
|
||||
TitleTab().height(uiMode.state?mdwInfo.displayHeight*0.075:0)
|
||||
TitleTab().height(sideState.headSide?mdwInfo.displayHeight*0.075:0)
|
||||
//分割线
|
||||
Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey)
|
||||
//工具栏
|
||||
@ -83,7 +83,7 @@ struct Index {
|
||||
Divider().vertical(false).strokeWidth(2).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey)
|
||||
Row() {
|
||||
//左侧边导航区
|
||||
LeftSideTab().width(uiMode.state?this.leftSideWidth:'0%')
|
||||
LeftSideTab().width(sideState.leftSide?this.leftSideWidth:mdwInfo.winWidth*0.013)
|
||||
// 左拖拽手柄
|
||||
Divider().vertical(true).strokeWidth(3).lineCap(LineCapStyle.Round).height('100%').backgroundColor(Color.Grey)
|
||||
.onMouse((event) => {
|
||||
@ -106,7 +106,7 @@ struct Index {
|
||||
this.dividerChangeSize(event,DividerType.RightSide)
|
||||
})
|
||||
//右侧边导航区
|
||||
RightSideTab().width(uiMode.state?this.rightSideWidth:'0%')
|
||||
RightSideTab().width(sideState.rightSide?this.rightSideWidth:mdwInfo.winWidth*0.013)
|
||||
}.layoutWeight(1)
|
||||
//分割线
|
||||
Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey)
|
||||
|
||||
@ -35,17 +35,21 @@ export class SubWinInfo{
|
||||
}
|
||||
|
||||
@ObservedV2
|
||||
export class UIMode{
|
||||
@Trace public state?:boolean;
|
||||
constructor(_uiModeState?:boolean,)
|
||||
export class SideState{
|
||||
@Trace public headSide:boolean=true;
|
||||
@Trace public leftSide:boolean=true;
|
||||
@Trace public rightSide:boolean=false;
|
||||
constructor(_headSide:boolean,_leftSide:boolean,_rightSide:boolean)
|
||||
{
|
||||
this.state = _uiModeState;
|
||||
this.headSide=_headSide;
|
||||
this.leftSide = _leftSide;
|
||||
this.rightSide = _rightSide;
|
||||
}
|
||||
}
|
||||
|
||||
//窗体保存容器
|
||||
export let subWins:Map<string,SubWinInfo>=new Map<string,SubWinInfo>;
|
||||
export let uiMode:UIMode=new UIMode(true);
|
||||
export let sideState:SideState=new SideState(true,true,false);
|
||||
//随机ID
|
||||
export function RndId(): string {
|
||||
// 获取当前时间戳(毫秒)
|
||||
@ -127,9 +131,13 @@ export function EventExecute(event:TitleButton){
|
||||
}
|
||||
|
||||
if(event?.btnEvent.command=='MODE_PREVIEW'){
|
||||
uiMode.state=false;
|
||||
sideState.headSide=false;
|
||||
sideState.leftSide=false;
|
||||
sideState.rightSide=false;
|
||||
}else if(event?.btnEvent.command=='MODE_EDIT'){
|
||||
uiMode.state=true;
|
||||
sideState.headSide=true;
|
||||
sideState.leftSide=true;
|
||||
sideState.rightSide=true;
|
||||
}
|
||||
if(event?.btnEvent.command=='MODE_MOUSE'){
|
||||
|
||||
|
||||
@ -2,11 +2,12 @@ import { TitleButton } from '../interface/Interface';
|
||||
import {LeftSideBars} from '../layout/LeftSideBar'
|
||||
import { mdwInfo } from '../dispwininfo/DispWinInfo'
|
||||
import {LeftSideComponent} from './LeftSideComponent'
|
||||
import { sideState } from '../eventhub/EventBase';
|
||||
|
||||
@ComponentV2
|
||||
export struct LeftSideTab {
|
||||
private leftSideBarTabs: TabsController = new TabsController();
|
||||
@Local leftSideBarFocusIndex: number = 0;
|
||||
@Local isExpanded:boolean=true;
|
||||
@Consumer('LeftSideWidth') leftSideWidth:number=mdwInfo.winWidth * 0.087;
|
||||
|
||||
build() {
|
||||
@ -19,13 +20,13 @@ export struct LeftSideTab {
|
||||
width: '90%', // 图片宽度占满按钮
|
||||
height: '90%' // 图片高度占满按钮
|
||||
})
|
||||
.backgroundImage(this.isExpanded ? $r('app.media.base_expand_on'):$r('app.media.base_expand_off'))
|
||||
.backgroundImage(sideState.leftSide ? $r('app.media.base_expand_on'):$r('app.media.base_expand_off'))
|
||||
.type(ButtonType.Normal)
|
||||
.width(mdwInfo.winWidth*0.013)
|
||||
.height(mdwInfo.winWidth*0.013)
|
||||
.onClick(()=>{
|
||||
this.isExpanded = !this.isExpanded;
|
||||
this.leftSideWidth=this.isExpanded?mdwInfo.winWidth * 0.087:mdwInfo.winWidth*0.013
|
||||
sideState.leftSide = !sideState.leftSide;
|
||||
this.leftSideWidth=sideState.leftSide?mdwInfo.winWidth * 0.087:mdwInfo.winWidth*0.013
|
||||
}).margin({ top: 2,left:1,bottom:0,right:2})
|
||||
Scroll() {
|
||||
Flex({ direction: FlexDirection.Column}) {
|
||||
@ -67,7 +68,7 @@ export struct LeftSideTab {
|
||||
}
|
||||
})
|
||||
}.barHeight(0)
|
||||
}.width(this.isExpanded?mdwInfo.winWidth * 0.087:0)
|
||||
}.width(sideState.leftSide?mdwInfo.winWidth * 0.087:0)
|
||||
}.width('auto')
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import { TitleButton } from '../interface/Interface';
|
||||
import {LeftSideBars} from '../layout/LeftSideBar'
|
||||
import { mdwInfo } from '../dispwininfo/DispWinInfo'
|
||||
import { sideState } from '../eventhub/EventBase';
|
||||
|
||||
@ComponentV2
|
||||
export struct RightSideTab {
|
||||
private leftSideBarTabs: TabsController = new TabsController();
|
||||
@Local leftSideBarFocusIndex: number = 0;
|
||||
@Local isExpanded:boolean=true;
|
||||
@Consumer('RightSideWidth') rightSideWidth:number=mdwInfo.winWidth * 0.087;
|
||||
|
||||
build() {
|
||||
@ -17,7 +17,7 @@ export struct RightSideTab {
|
||||
}
|
||||
|
||||
}.barHeight(0)
|
||||
}.width(this.isExpanded?this.rightSideWidth-mdwInfo.winWidth*0.013:'0%')
|
||||
}.width(sideState.rightSide?this.rightSideWidth-mdwInfo.winWidth*0.013:'0%')
|
||||
//右边按钮列
|
||||
Column({space:1}){
|
||||
Button()
|
||||
@ -27,13 +27,13 @@ export struct RightSideTab {
|
||||
width: '90%', // 图片宽度占满按钮
|
||||
height: '90%' // 图片高度占满按钮
|
||||
})
|
||||
.backgroundImage(this.isExpanded ? $r('app.media.base_expand_on'):$r('app.media.base_expand_off'))
|
||||
.backgroundImage(sideState.rightSide ? $r('app.media.base_expand_on'):$r('app.media.base_expand_off'))
|
||||
.type(ButtonType.Normal)
|
||||
.width(mdwInfo.winWidth*0.013)
|
||||
.height(mdwInfo.winWidth*0.013)
|
||||
.onClick(()=>{
|
||||
this.isExpanded = !this.isExpanded;
|
||||
this.rightSideWidth=this.isExpanded?mdwInfo.winWidth * 0.087:mdwInfo.winWidth*0.013;
|
||||
sideState.rightSide = !sideState.rightSide;
|
||||
this.rightSideWidth=sideState.rightSide?mdwInfo.winWidth * 0.087:mdwInfo.winWidth*0.013;
|
||||
}).margin({ top: 2,left:1,bottom:0,right:2})
|
||||
Blank().layoutWeight(1)
|
||||
}.borderWidth(1)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user