更改一些样式

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 //Set Main Window Size
const mainWindowWidth: number = screenWidth-100; const mainWindowWidth: number = screenWidth-100;
const mainWindowHeight: number = screenHeight-200; const mainWindowHeight: number = screenHeight-200;
console.error(`main window Width: mainWindowWidth, Height: mainWindowHeight`);
//Init&&Save AppStorageV2 //Init&&Save AppStorageV2
const mainDisplayInfo = AppStorageV2.connect<MainScreenDisplayInfo>(MainScreenDisplayInfo, () => new MainScreenDisplayInfo( const mainDisplayInfo = AppStorageV2.connect<MainScreenDisplayInfo>(MainScreenDisplayInfo, () => new MainScreenDisplayInfo(
screenDisplayId,screenWidth,screenHeight screenDisplayId,screenWidth,screenHeight

View File

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

View File

@ -67,6 +67,8 @@ struct Index {
Column() { Column() {
Text('状态栏') Text('状态栏')
}.width('100%') }.width('100%')
.align(Alignment.End)
.alignItems(HorizontalAlign.Start)
.height(this.mwInfo.mainWindowHeight * 0.05) .height(this.mwInfo.mainWindowHeight * 0.05)
}.backgroundColor('#f3f3f0') }.backgroundColor('#f3f3f0')
.width('100%') .width('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')) .backgroundImage(this.isExpanded ? $r('app.media.base_expand_on'):$r('app.media.base_expand_off'))
.type(ButtonType.Normal) .type(ButtonType.Normal)
.width(50) .width(this.mwInfo.mainWindowWidth*0.013)
.height(50) .height(this.mwInfo.mainWindowWidth*0.013)
.onClick(()=>{ .onClick(()=>{
this.isExpanded = !this.isExpanded; this.isExpanded = !this.isExpanded;
if(this.isExpanded){ if(this.isExpanded){
@ -52,8 +52,8 @@ export struct LeftSideTab {
}) })
.backgroundImage($r('app.media.'+item.eIcon)) .backgroundImage($r('app.media.'+item.eIcon))
.fontWeight(index === this.leftSideBarFocusIndex ? FontWeight.Bold : FontWeight.Normal) .fontWeight(index === this.leftSideBarFocusIndex ? FontWeight.Bold : FontWeight.Normal)
.height(50) .width(this.mwInfo.mainWindowWidth*0.013)
.width(50) .height(this.mwInfo.mainWindowWidth*0.013)
.type(ButtonType.Normal) .type(ButtonType.Normal)
.onClick(() => { .onClick(() => {
this.leftSideBarTabs.changeIndex(index); this.leftSideBarTabs.changeIndex(index);
@ -67,7 +67,8 @@ export struct LeftSideTab {
.align(Alignment.Start) .align(Alignment.Start)
.scrollable(ScrollDirection.Vertical) .scrollable(ScrollDirection.Vertical)
.scrollBar(BarState.Off) .scrollBar(BarState.Off)
.width(50) .width(this.mwInfo.mainWindowWidth*0.013)
.height(this.mwInfo.mainWindowWidth*0.013)
.height('100%') .height('100%')
}.borderWidth(1) }.borderWidth(1)
.borderColor(Color.Grey) .borderColor(Color.Grey)

View File

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

View File

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