Compare commits

...

3 Commits

Author SHA1 Message Date
1f696d8a87 版本化素材 2026-03-20 17:51:19 +08:00
cdb8ad38f9 修改按钮素材为透明背景 2026-03-20 17:49:16 +08:00
51f1e2e76f 更改一些样式 2026-03-20 16:13:48 +08:00
356 changed files with 74 additions and 70 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

@ -9,15 +9,12 @@ export struct TextComboBox {
Menu() {
ForEach(this.menu, (item: TitleButton, index: number) => {
MenuItem({ content: item.eName })
.labelFont({ size: 20})
.width('auto')
.margin({
top: 0,
left: 0,
bottom: 0,
right: 0
}).onClick(()=>{
.onClick(()=>{
this.selectIndex=index;
})
})
.backgroundColor('#f3f3f0')
})
}
}
@ -37,15 +34,12 @@ export struct TextInputComboBox {
Menu() {
ForEach(this.menu, (item: TitleButton, index: number) => {
MenuItem({ content: item.eName })
.labelFont({ size: 20})
.width('auto')
.margin({
top: 0,
left: 0,
bottom: 0,
right: 0
}).onClick(()=>{
.onClick(()=>{
this.selectIndex=index;
})
})
.backgroundColor('#f3f3f0')
})
}
}

View File

@ -18,13 +18,8 @@ export struct GroupTextEventMenu {
GroupMenu(menus: Array<TitleMenu>) {
ForEach(menus, (item: TitleMenu, index: number) => {
MenuItem({ startIcon: $r('app.media.' + item.mIcon), content: item.mName })
.labelFont({ size: 20})
.width('auto')
.margin({
top: 0,
left: 0,
bottom: 0,
right: 0
})
})
}
@ -48,7 +43,7 @@ export struct GroupTextEventMenu {
height: '90%' // 图片高度占满按钮
})
.bindMenu(this.GroupMenu(this.grpEvent.grpMenu))
.backgroundColor('#F8F9FA')
.backgroundColor(Color.Transparent)
}
}.align(Alignment.BottomEnd)
}
@ -67,12 +62,7 @@ export struct MenuBtn {
Menu() {
ForEach(this.menuBtn, (item: TitleButton, index: number) => {
MenuItem({ startIcon: $r('app.media.' + item.eIcon), content: item.eName })
.margin({
top: 0,
left: 0,
bottom: 0,
right: 0
})
.labelFont({ size: 20})
.onClick(()=>{
this.curtIndex=index;
ExecuteCommand(item as TitleButton);
@ -90,7 +80,7 @@ export struct MenuBtn {
.height(this.mwInfo.mainWindowWidth*0.02)
.backgroundImage($r('app.media.' + this.menuBtn[this.curtIndex].eIcon))
.backgroundImagePosition({ x: '5%', y: '5%' })
.backgroundColor('#F8F9FA')
.backgroundColor(Color.Transparent)
.backgroundImageSize({
width: '90%', // 图片宽度占满按钮
height: '90%' // 图片高度占满按钮
@ -101,8 +91,8 @@ export struct MenuBtn {
.width(this.mwInfo.mainWindowWidth*0.02)
.height(this.mwInfo.mainWindowWidth*0.005)
.backgroundImage($r('app.media.base_chevron_down'))
.backgroundImagePosition({ x: '35%', y: '0%' })
.backgroundColor('#F8F9FA')
.backgroundImagePosition({ x: '40%', y: '0%' })
.backgroundColor(Color.Transparent)
Text(this.menuBtn[this.curtIndex].eName)
.fontSize(16)
@ -110,7 +100,8 @@ export struct MenuBtn {
.height(this.mwInfo.mainWindowWidth*0.005)
.textAlign(TextAlign.Center)
}
}.padding(1)
}
.padding(1)
}
}

View File

@ -1,11 +1,14 @@
import { BusinessError } from '@kit.BasicServicesKit';
import { window,UIContext} from '@kit.ArkUI';
import { window,UIContext, AppStorageV2} from '@kit.ArkUI';
import { MainWindowInfo, MainWindowStageInfo } from '../AppStorageV2Class';
let subWindow: window.Window | undefined = undefined;
export async function CreateAndShowSubWindow(name:string,pages:string) {
try {
const windowStage = AppStorage.get('windowStage') as window.WindowStage;
const appws=AppStorageV2.connect<MainWindowStageInfo>(MainWindowStageInfo, () => new MainWindowStageInfo())!;
const mwInfo = AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo())!;
const windowStage = appws.ws;
if(windowStage==null){
console.error('Failed to create the subwindow. Cause: windowStage is null');
return;
@ -25,9 +28,9 @@ export async function CreateAndShowSubWindow(name:string,pages:string) {
console.log("设置拖拽缩放", `报错信息:${err.code}, ${err.message}`)
})
//子窗口创建成功后,设置子窗口的位置、大小及相关属性等。
subWindow.moveWindowTo(150, 15)
subWindow.moveWindowTo(25, 25)
//子窗口重置大小
subWindow.resize(800, 1200);
subWindow.resize(mwInfo.mainWindowWidth*0.3, mwInfo.mainWindowHeight*0.9);
subWindow.setUIContent(pages, (err: BusinessError) => {
if (err.code) {
console.error("加载页面失败:", err);

View File

@ -1,8 +1,11 @@
import { MainWindowInfo } from '../AppStorageV2Class';
import { Expandable } from '../CustomStyle/Expandable';
import { AppStorageV2 } from '@kit.ArkUI';
@Entry
@ComponentV2
struct SWExtrude {
@Local mwInfo: MainWindowInfo = AppStorageV2.connect<MainWindowInfo>(MainWindowInfo, () => new MainWindowInfo())!;
// 控制内容区域显示与隐藏的状态
@Provider('isSubExpanded') isExpanded:boolean=true;
build() {
@ -12,10 +15,10 @@ struct SWExtrude {
Row(){
// 内容区域,使用条件渲染来控制显示与隐藏
if (this.isExpanded) {
Text('*选择曲线(0)').width(px2vp(35)).height(px2vp(35))
Text('*选择曲线(0)')
Blank().width('30%')
Button('绘制曲线').width(px2vp(35)).height(px2vp(35))
Button('选择曲线').width(px2vp(35)).height(px2vp(35))
Button('绘制曲线')
Button('选择曲线')
}
}.justifyContent(FlexAlign.Start)
}

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, font, Font } 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;
@ -22,20 +25,15 @@ export struct TitleColumnSub {
ForEach(menus, (item: TitleButton, index: number) => {
MenuItem({ startIcon: $r('app.media.'+item.eIcon), content: item.eName })
.width('150')
.margin({
top: 0,
left: 0,
bottom: 0,
right: 0
})
.labelFont({size: 20})
})
}
}
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,31 +45,37 @@ 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>))
.margin({ top:0, left: 5, bottom: 0, right: 0 })
Text('菜单')
.fontSize(20)
.bindMenu(this.DisplayModeMenu(TitleData.mFileModel.cmEvents as Array<TitleButton>))
Text('|')
Text('拾取类型:')
.fontSize(20)
TextComboBox({menu:SelectionMode})
.width('100vp')
.borderWidth(1)
.borderColor(Color.Grey)
.borderRadius(5)
Text('图层:')
.fontSize(20)
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)
.backgroundColor(Color.Transparent)
.backgroundImage($r('app.media.'+LayoutOption[0].eIcon))
.backgroundImageSize({ width: '100%', height: '100%' })
.bindMenu(this.DisplayModeMenu(LayoutOption))
@ -83,8 +87,9 @@ 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)
.backgroundColor(Color.Transparent)
.backgroundImage($r('app.media.' + SwitchView[0].eIcon))
.backgroundImageSize({
width: '100%', // 图片宽度占满按钮
@ -92,9 +97,10 @@ export struct TitleColumnSub {
})
Button()
.height(35)
.width(35)
.width(this.mwInfo.mainWindowWidth*0.013)
.height(this.mwInfo.mainWindowWidth*0.013)
.padding(1)
.backgroundColor(Color.Transparent)
.backgroundImage($r('app.media.'+DisplayMode[0].eIcon))
.backgroundImageSize({ width: '100%', height: '100%' })
.bindMenu(this.DisplayModeMenu(DisplayMode))

View File

@ -31,6 +31,7 @@ export struct TitleTab {
MenuItem({ startIcon: $r('app.media.'+item.eIcon), content: item.eName })
.width('auto')
.height('auto')
.labelFont({size: 20})
})
}
}

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.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 887 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 967 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Some files were not shown because too many files have changed in this diff Show More