修改按钮素材为透明背景
@ -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')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ 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";
|
||||
import { AppStorageV2, font, Font } from "@kit.ArkUI";
|
||||
|
||||
@ComponentV2
|
||||
export struct TitleColumnSub {
|
||||
@ -25,12 +25,7 @@ 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})
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -62,23 +57,25 @@ export struct TitleColumnSub {
|
||||
})
|
||||
.bindMenu(this.DisplayModeMenu(TitleData.mFileModel.cmEvents as Array<TitleButton>))
|
||||
.type(ButtonType.Normal)
|
||||
.margin({ top:0, left: 5, bottom: 0, right: 0 })
|
||||
Text('菜单')
|
||||
.fontSize(14)
|
||||
.fontSize(20)
|
||||
.bindMenu(this.DisplayModeMenu(TitleData.mFileModel.cmEvents as Array<TitleButton>))
|
||||
Text('|')
|
||||
Text('拾取类型:')
|
||||
.fontSize(14)
|
||||
.fontSize(20)
|
||||
TextComboBox({menu:SelectionMode})
|
||||
.borderWidth(1)
|
||||
.borderColor(Color.Grey)
|
||||
.borderRadius(5)
|
||||
Text('图层:')
|
||||
.fontSize(14)
|
||||
.fontSize(20)
|
||||
TextInputComboBox({menu:this.layerArray}).width('10%')
|
||||
Button()
|
||||
.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))
|
||||
@ -92,6 +89,7 @@ export struct TitleColumnSub {
|
||||
this.viewDialog.open();
|
||||
}).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%', // 图片宽度占满按钮
|
||||
@ -102,6 +100,7 @@ export struct TitleColumnSub {
|
||||
.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))
|
||||
|
||||
@ -31,6 +31,7 @@ export struct TitleTab {
|
||||
MenuItem({ startIcon: $r('app.media.'+item.eIcon), content: item.eName })
|
||||
.width('auto')
|
||||
.height('auto')
|
||||
.labelFont({size: 20})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 64 KiB |