更改一些样式

This commit is contained in:
JackLee 2026-03-20 16:13:48 +08:00
parent 322156acde
commit 51f1e2e76f
9 changed files with 39 additions and 26 deletions

View File

@ -31,6 +31,7 @@ export default class EntryAbility extends UIAbility {
//Set Main Window Size
const mainWindowWidth: number = screenWidth-100;
const mainWindowHeight: number = screenHeight-200;
console.error(`main window Width: mainWindowWidth, Height: mainWindowHeight`);
//Init&&Save AppStorageV2
const mainDisplayInfo = AppStorageV2.connect<MainScreenDisplayInfo>(MainScreenDisplayInfo, () => new MainScreenDisplayInfo(
screenDisplayId,screenWidth,screenHeight

View File

@ -21,7 +21,7 @@ export struct EventBtn {
.height(this.mwInfo.mainWindowWidth*0.02)
.backgroundImage($r('app.media.' + this.eventBtn.eIcon))
.backgroundImagePosition({ x: '5%', y: '5%' })
.backgroundColor('#F8F9FA')
.backgroundColor(Color.Transparent)
.backgroundImageSize({
width: '90%', // 图片宽度占满按钮
height: '90%' // 图片高度占满按钮

View File

@ -60,14 +60,16 @@ struct Index {
}.layoutWeight(1)
.align(Alignment.Center)
}.width('100%')
.height(this.mwInfo.mainWindowHeight * 0.36)
.height(this.mwInfo.mainWindowHeight * 0.36)
//分割线
Divider().vertical(false).strokeWidth(1).lineCap(LineCapStyle.Round).width('100%').backgroundColor(Color.Grey)
///状态栏
Column() {
Text('状态栏')
}.width('100%')
.height(this.mwInfo.mainWindowHeight * 0.05)
.align(Alignment.End)
.alignItems(HorizontalAlign.Start)
.height(this.mwInfo.mainWindowHeight * 0.05)
}.backgroundColor('#f3f3f0')
.width('100%')
.height('100%')

View File

@ -26,8 +26,8 @@ export struct LeftSideTab {
})
.backgroundImage(this.isExpanded ? $r('app.media.base_expand_on'):$r('app.media.base_expand_off'))
.type(ButtonType.Normal)
.width(50)
.height(50)
.width(this.mwInfo.mainWindowWidth*0.013)
.height(this.mwInfo.mainWindowWidth*0.013)
.onClick(()=>{
this.isExpanded = !this.isExpanded;
if(this.isExpanded){
@ -52,8 +52,8 @@ export struct LeftSideTab {
})
.backgroundImage($r('app.media.'+item.eIcon))
.fontWeight(index === this.leftSideBarFocusIndex ? FontWeight.Bold : FontWeight.Normal)
.height(50)
.width(50)
.width(this.mwInfo.mainWindowWidth*0.013)
.height(this.mwInfo.mainWindowWidth*0.013)
.type(ButtonType.Normal)
.onClick(() => {
this.leftSideBarTabs.changeIndex(index);
@ -67,7 +67,8 @@ export struct LeftSideTab {
.align(Alignment.Start)
.scrollable(ScrollDirection.Vertical)
.scrollBar(BarState.Off)
.width(50)
.width(this.mwInfo.mainWindowWidth*0.013)
.height(this.mwInfo.mainWindowWidth*0.013)
.height('100%')
}.borderWidth(1)
.borderColor(Color.Grey)

View File

@ -7,10 +7,13 @@ import {DisplayMode} from "../LayoutInterface/Layout/DisplayMode"
import { MenuBtn } from "../CustomStyle/Menu";
import { LayoutOption } from "../LayoutInterface/Layout/LayoutOption";
import { TitleData } from "../LayoutInterface/Layout/TabContent";
import { MainWindowInfo } from "../AppStorageV2Class";
import { AppStorageV2 } from "@kit.ArkUI";
@ComponentV2
export struct TitleColumnSub {
//Title下的子行的功能
@Local mwInfo: MainWindowInfo = AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo())!;
@Local layerArray: Array<TitleButton> = [];
@Local dX:number=0;
@Local dY:number=0;
@ -34,8 +37,8 @@ export struct TitleColumnSub {
private ViewDialog(): CustomDialogController {
return new CustomDialogController({
builder: ViewDialog(), // 确保 ViewDialog 组件已正确定义
width: '130vp',
height: '118vp',
width: this.mwInfo.mainWindowWidth*0.04,
height: this.mwInfo.mainWindowWidth*0.04,
borderWidth: 1,
cornerRadius: 5,
isModal: true,
@ -47,30 +50,34 @@ export struct TitleColumnSub {
build(){
Row({space:5}){
Button()
.height(25)
.width(25)
.padding(1)
.width(this.mwInfo.mainWindowWidth*0.013)
.height(this.mwInfo.mainWindowWidth*0.013)
.backgroundColor(Color.Transparent)
.backgroundImage($r('app.media.base_shortcut_menu'))
.backgroundImagePosition({ x: '10%', y: '10%' })
.backgroundImagePosition({ x: '5%', y: '5%' })
.backgroundImageSize({
width: '80%', // 图片宽度占满按钮
height: '80%' // 图片高度占满按钮
width: '90%', // 图片宽度占满按钮
height: '90%' // 图片高度占满按钮
})
.bindMenu(this.DisplayModeMenu(TitleData.mFileModel.cmEvents as Array<TitleButton>))
.type(ButtonType.Normal)
Text('菜单').bindMenu(this.DisplayModeMenu(TitleData.mFileModel.cmEvents as Array<TitleButton>))
Text('菜单')
.fontSize(14)
.bindMenu(this.DisplayModeMenu(TitleData.mFileModel.cmEvents as Array<TitleButton>))
Text('|')
Text('拾取类型:')
.fontSize(14)
TextComboBox({menu:SelectionMode})
.width('100vp')
.borderWidth(1)
.borderColor(Color.Grey)
.borderRadius(5)
Text('图层:')
.fontSize(14)
TextInputComboBox({menu:this.layerArray}).width('10%')
Button()
.height(35)
.width(35)
.width(this.mwInfo.mainWindowWidth*0.013)
.height(this.mwInfo.mainWindowWidth*0.013)
.padding(1)
.backgroundImage($r('app.media.'+LayoutOption[0].eIcon))
.backgroundImageSize({ width: '100%', height: '100%' })
@ -83,8 +90,8 @@ export struct TitleColumnSub {
this.viewDialog=this.ViewDialog();
}
this.viewDialog.open();
}).width('35vp')
.height('35vp')
}).width(this.mwInfo.mainWindowWidth*0.013)
.height(this.mwInfo.mainWindowWidth*0.013)
.backgroundImage($r('app.media.' + SwitchView[0].eIcon))
.backgroundImageSize({
width: '100%', // 图片宽度占满按钮
@ -92,8 +99,8 @@ export struct TitleColumnSub {
})
Button()
.height(35)
.width(35)
.width(this.mwInfo.mainWindowWidth*0.013)
.height(this.mwInfo.mainWindowWidth*0.013)
.padding(1)
.backgroundImage($r('app.media.'+DisplayMode[0].eIcon))
.backgroundImageSize({ width: '100%', height: '100%' })

View File

@ -15,10 +15,12 @@
"name": "EntryAbility",
"srcEntry": "./ets/entryability/EntryAbility.ets",
"description": "$string:EntryAbility_desc",
"icon": "$media:layered_image",
"icon": "$media:base_opencax_logo",
"label": "$string:EntryAbility_label",
"startWindowIcon": "$media:startIcon",
"startWindowIcon": "$media:base_start_background",
"startWindowBackground": "$color:start_window_background",
"minWindowWidth": 1200, // 设置最小宽度
"minWindowHeight": 800, // 设置最小高度
"exported": true,
"skills": [
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB