修改按钮素材为透明背景

This commit is contained in:
JackLee 2026-03-20 17:49:16 +08:00
parent 51f1e2e76f
commit cdb8ad38f9
179 changed files with 39 additions and 48 deletions

View File

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

View File

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

View File

@ -1,11 +1,14 @@
import { BusinessError } from '@kit.BasicServicesKit'; 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; let subWindow: window.Window | undefined = undefined;
export async function CreateAndShowSubWindow(name:string,pages:string) { export async function CreateAndShowSubWindow(name:string,pages:string) {
try { 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){ if(windowStage==null){
console.error('Failed to create the subwindow. Cause: windowStage is null'); console.error('Failed to create the subwindow. Cause: windowStage is null');
return; return;
@ -25,9 +28,9 @@ export async function CreateAndShowSubWindow(name:string,pages:string) {
console.log("设置拖拽缩放", `报错信息:${err.code}, ${err.message}`) 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) => { subWindow.setUIContent(pages, (err: BusinessError) => {
if (err.code) { if (err.code) {
console.error("加载页面失败:", err); console.error("加载页面失败:", err);

View File

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

View File

@ -8,7 +8,7 @@ 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 { MainWindowInfo } from "../AppStorageV2Class";
import { AppStorageV2 } from "@kit.ArkUI"; import { AppStorageV2, font, Font } from "@kit.ArkUI";
@ComponentV2 @ComponentV2
export struct TitleColumnSub { export struct TitleColumnSub {
@ -25,12 +25,7 @@ export struct TitleColumnSub {
ForEach(menus, (item: TitleButton, index: number) => { ForEach(menus, (item: TitleButton, index: number) => {
MenuItem({ startIcon: $r('app.media.'+item.eIcon), content: item.eName }) MenuItem({ startIcon: $r('app.media.'+item.eIcon), content: item.eName })
.width('150') .width('150')
.margin({ .labelFont({size: 20})
top: 0,
left: 0,
bottom: 0,
right: 0
})
}) })
} }
} }
@ -62,23 +57,25 @@ export struct TitleColumnSub {
}) })
.bindMenu(this.DisplayModeMenu(TitleData.mFileModel.cmEvents as Array<TitleButton>)) .bindMenu(this.DisplayModeMenu(TitleData.mFileModel.cmEvents as Array<TitleButton>))
.type(ButtonType.Normal) .type(ButtonType.Normal)
.margin({ top:0, left: 5, bottom: 0, right: 0 })
Text('菜单') Text('菜单')
.fontSize(14) .fontSize(20)
.bindMenu(this.DisplayModeMenu(TitleData.mFileModel.cmEvents as Array<TitleButton>)) .bindMenu(this.DisplayModeMenu(TitleData.mFileModel.cmEvents as Array<TitleButton>))
Text('|') Text('|')
Text('拾取类型:') Text('拾取类型:')
.fontSize(14) .fontSize(20)
TextComboBox({menu:SelectionMode}) TextComboBox({menu:SelectionMode})
.borderWidth(1) .borderWidth(1)
.borderColor(Color.Grey) .borderColor(Color.Grey)
.borderRadius(5) .borderRadius(5)
Text('图层:') Text('图层:')
.fontSize(14) .fontSize(20)
TextInputComboBox({menu:this.layerArray}).width('10%') TextInputComboBox({menu:this.layerArray}).width('10%')
Button() Button()
.width(this.mwInfo.mainWindowWidth*0.013) .width(this.mwInfo.mainWindowWidth*0.013)
.height(this.mwInfo.mainWindowWidth*0.013) .height(this.mwInfo.mainWindowWidth*0.013)
.padding(1) .padding(1)
.backgroundColor(Color.Transparent)
.backgroundImage($r('app.media.'+LayoutOption[0].eIcon)) .backgroundImage($r('app.media.'+LayoutOption[0].eIcon))
.backgroundImageSize({ width: '100%', height: '100%' }) .backgroundImageSize({ width: '100%', height: '100%' })
.bindMenu(this.DisplayModeMenu(LayoutOption)) .bindMenu(this.DisplayModeMenu(LayoutOption))
@ -92,6 +89,7 @@ export struct TitleColumnSub {
this.viewDialog.open(); this.viewDialog.open();
}).width(this.mwInfo.mainWindowWidth*0.013) }).width(this.mwInfo.mainWindowWidth*0.013)
.height(this.mwInfo.mainWindowWidth*0.013) .height(this.mwInfo.mainWindowWidth*0.013)
.backgroundColor(Color.Transparent)
.backgroundImage($r('app.media.' + SwitchView[0].eIcon)) .backgroundImage($r('app.media.' + SwitchView[0].eIcon))
.backgroundImageSize({ .backgroundImageSize({
width: '100%', // 图片宽度占满按钮 width: '100%', // 图片宽度占满按钮
@ -102,6 +100,7 @@ export struct TitleColumnSub {
.width(this.mwInfo.mainWindowWidth*0.013) .width(this.mwInfo.mainWindowWidth*0.013)
.height(this.mwInfo.mainWindowWidth*0.013) .height(this.mwInfo.mainWindowWidth*0.013)
.padding(1) .padding(1)
.backgroundColor(Color.Transparent)
.backgroundImage($r('app.media.'+DisplayMode[0].eIcon)) .backgroundImage($r('app.media.'+DisplayMode[0].eIcon))
.backgroundImageSize({ width: '100%', height: '100%' }) .backgroundImageSize({ width: '100%', height: '100%' })
.bindMenu(this.DisplayModeMenu(DisplayMode)) .bindMenu(this.DisplayModeMenu(DisplayMode))

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

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.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

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