diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index de770185..54d737ef 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -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, () => new MainScreenDisplayInfo( screenDisplayId,screenWidth,screenHeight diff --git a/entry/src/main/ets/pages/CustomStyle/Button.ets b/entry/src/main/ets/pages/CustomStyle/Button.ets index 53a71019..cb8e745c 100644 --- a/entry/src/main/ets/pages/CustomStyle/Button.ets +++ b/entry/src/main/ets/pages/CustomStyle/Button.ets @@ -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%' // 图片高度占满按钮 diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index b71205bd..e42371c5 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -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%') diff --git a/entry/src/main/ets/pages/LeftSideLayout/LeftSideTab.ets b/entry/src/main/ets/pages/LeftSideLayout/LeftSideTab.ets index 8547753f..2608c714 100644 --- a/entry/src/main/ets/pages/LeftSideLayout/LeftSideTab.ets +++ b/entry/src/main/ets/pages/LeftSideLayout/LeftSideTab.ets @@ -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) diff --git a/entry/src/main/ets/pages/TitleLayout/TitleColumnSub.ets b/entry/src/main/ets/pages/TitleLayout/TitleColumnSub.ets index 121e238f..8186371b 100644 --- a/entry/src/main/ets/pages/TitleLayout/TitleColumnSub.ets +++ b/entry/src/main/ets/pages/TitleLayout/TitleColumnSub.ets @@ -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, () => new MainWindowInfo())!; + @Local layerArray: Array = []; @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)) .type(ButtonType.Normal) - Text('菜单').bindMenu(this.DisplayModeMenu(TitleData.mFileModel.cmEvents as Array)) + Text('菜单') + .fontSize(14) + .bindMenu(this.DisplayModeMenu(TitleData.mFileModel.cmEvents as Array)) 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%' }) diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 index 5fdc2237..ccea7ace 100644 --- a/entry/src/main/module.json5 +++ b/entry/src/main/module.json5 @@ -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": [ { diff --git a/entry/src/main/resources/base/media/base_background.png b/entry/src/main/resources/base/media/base_background.png new file mode 100644 index 00000000..c4554bb9 Binary files /dev/null and b/entry/src/main/resources/base/media/base_background.png differ diff --git a/entry/src/main/resources/base/media/base_opencax_logo.png b/entry/src/main/resources/base/media/base_opencax_logo.png new file mode 100644 index 00000000..1eb45db2 Binary files /dev/null and b/entry/src/main/resources/base/media/base_opencax_logo.png differ diff --git a/entry/src/main/resources/base/media/base_start_background.png b/entry/src/main/resources/base/media/base_start_background.png new file mode 100644 index 00000000..696cdefb Binary files /dev/null and b/entry/src/main/resources/base/media/base_start_background.png differ