From 1ba49d571c24ee5520c5e1c9a47cd5925d9d12d1 Mon Sep 17 00:00:00 2001 From: Knight4Lancelot <320062713@qq.com> Date: Sat, 1 Mar 2025 17:50:01 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E8=A7=A3=E5=86=B3ASNavigation=E7=9A=84titl?= =?UTF-8?q?e=E4=B8=8Emenubar=E9=81=BF=E8=AE=A9=E5=AE=BD=E5=BA=A6=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Knight4Lancelot --- .../interfaces/atomicservicenavigation.js | 14 +++++++++++++- .../source/atomicservicenavigation.ets | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/atomicservicenavigation/interfaces/atomicservicenavigation.js b/atomicservicenavigation/interfaces/atomicservicenavigation.js index 3ded062..c3ad84c 100644 --- a/atomicservicenavigation/interfaces/atomicservicenavigation.js +++ b/atomicservicenavigation/interfaces/atomicservicenavigation.js @@ -405,7 +405,8 @@ export class AtomicServiceNavigation extends ViewPU { Canvas.create(this.context); Canvas.opacity(transparencyMapArray[(gradientBackground.alpha === undefined) ? GradientAlpha.OPACITY_20 : gradientBackground.alpha]); - Canvas.blur(BLUR_CONSTANT); + Canvas.backdropBlur(BLUR_CONSTANT); + Canvas.height(this.navigationHeight); Canvas.backgroundColor(gradientBackground.backgroundTheme === undefined ? backGroundColor[2] : backGroundColor[gradientBackground.backgroundTheme - 1]); Canvas.onReady(() => { @@ -722,6 +723,8 @@ export class AtomicServiceNavigation extends ViewPU { this.observeComponentCreation2((elmtId, isInitialRender) => { SymbolGlyph.create(); SymbolGlyph.attributeModifier.bind(this)(this.sideBarOptions?.sideBarIcon); + SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + SymbolGlyph.size({ width: 36, height: 36 }); }, SymbolGlyph); Button.pop(); }); @@ -813,10 +816,13 @@ export class AtomicServiceNavigation extends ViewPU { top: LengthMetrics.vp(8) }); Button.visibility(this.controlButtonVisible ? Visibility.Visible : Visibility.None); + Button.align(Alignment.Top); }, Button); this.observeComponentCreation2((elmtId, isInitialRender) => { SymbolGlyph.create(); SymbolGlyph.attributeModifier.bind(this)(this.titleOptions?.titleIcon); + SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + SymbolGlyph.size({ width: 36, height: 36 }); }, SymbolGlyph); Button.pop(); }); @@ -917,6 +923,8 @@ export class AtomicServiceNavigation extends ViewPU { this.observeComponentCreation2((elmtId, isInitialRender) => { SymbolGlyph.create(); SymbolGlyph.attributeModifier.bind(this)(this.titleOptions?.titleIcon); + SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + SymbolGlyph.size({ width: 36, height: 36 }); }, SymbolGlyph); Button.pop(); }); @@ -972,6 +980,8 @@ export class AtomicServiceNavigation extends ViewPU { this.observeComponentCreation2((elmtId, isInitialRender) => { SymbolGlyph.create(); SymbolGlyph.attributeModifier.bind(this)(this.titleOptions?.titleIcon); + SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + SymbolGlyph.size({ width: 36, height: 36 }); }, SymbolGlyph); Button.pop(); }); @@ -981,6 +991,7 @@ export class AtomicServiceNavigation extends ViewPU { this.observeComponentCreation2((elmtId, isInitialRender) => { Image.create(this.titleOptions?.titleIcon ?? this.atomicServiceIcon); Image.height(36); + Image.width(36); Image.margin({ start: LengthMetrics.vp(this.marginWindowLeft), end: LengthMetrics.vp(-12), @@ -1030,6 +1041,7 @@ export class AtomicServiceNavigation extends ViewPU { initialRender() { this.observeComponentCreation2((elmtId, isInitialRender) => { Stack.create(); + Stack.align(Alignment.TopStart); Stack.width('100%'); Stack.height('100%'); Stack.onSizeChange((oldValue, newValue) => { diff --git a/atomicservicenavigation/source/atomicservicenavigation.ets b/atomicservicenavigation/source/atomicservicenavigation.ets index 1d2a8bf..f316be1 100644 --- a/atomicservicenavigation/source/atomicservicenavigation.ets +++ b/atomicservicenavigation/source/atomicservicenavigation.ets @@ -167,7 +167,8 @@ export struct AtomicServiceNavigation { Canvas(this.context) .opacity(transparencyMapArray[(gradientBackground.alpha === undefined) ? GradientAlpha.OPACITY_20 : gradientBackground.alpha]) - .blur(BLUR_CONSTANT) + .backdropBlur(BLUR_CONSTANT) + .height(this.navigationHeight) .backgroundColor(gradientBackground.backgroundTheme === undefined ? backGroundColor[2] : backGroundColor[gradientBackground.backgroundTheme - 1]) .onReady(() => { @@ -453,6 +454,8 @@ export struct AtomicServiceNavigation { Button({ type: ButtonType.Circle }) { SymbolGlyph() .attributeModifier(this.sideBarOptions?.sideBarIcon) + .fontSize($r('sys.float.ohos_id_text_size_headline7')) + .size({ width: 36, height: 36 }) } .controlButtonStyle() } else { @@ -472,8 +475,11 @@ export struct AtomicServiceNavigation { Button({ type: ButtonType.Circle }) { SymbolGlyph() .attributeModifier(this.titleOptions?.titleIcon) + .fontSize($r('sys.float.ohos_id_text_size_headline7')) + .size({ width: 36, height: 36 }) } .controlButtonStyle() + .align(Alignment.Top) } else { Image(this.titleOptions?.titleIcon) .controlButtonStyle() @@ -535,6 +541,8 @@ export struct AtomicServiceNavigation { Button({ type: ButtonType.Circle }) { SymbolGlyph() .attributeModifier(this.titleOptions?.titleIcon) + .fontSize($r('sys.float.ohos_id_text_size_headline7')) + .size({ width: 36, height: 36 }) } .roundIconStyle() } else { @@ -546,6 +554,7 @@ export struct AtomicServiceNavigation { @Styles longIconStyles() { .height(36) + .width(36) .margin({ start: LengthMetrics.vp(this.marginWindowLeft), end: LengthMetrics.vp(-12), @@ -565,9 +574,10 @@ export struct AtomicServiceNavigation { Button() { SymbolGlyph() .attributeModifier(this.titleOptions?.titleIcon) + .fontSize($r('sys.float.ohos_id_text_size_headline7')) + .size({ width: 36, height: 36 }) } .backgroundColor($r('sys.color.ohos_id_color_button_normal')) - .width(36) .longIconStyles() } else { Image(this.titleOptions?.titleIcon ?? this.atomicServiceIcon) @@ -689,6 +699,7 @@ export struct AtomicServiceNavigation { .onNavigationModeChange(this.modeChangeCallback) } } + .align(Alignment.TopStart) .width('100%') .height('100%') .onSizeChange((oldValue: SizeOptions, newValue: SizeOptions) => { -- Gitee From 77bd2032503534ae37d4fb83c651dc73a8f954b4 Mon Sep 17 00:00:00 2001 From: Knight4Lancelot <320062713@qq.com> Date: Sat, 1 Mar 2025 17:52:31 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E8=A7=A3=E5=86=B3ASNavigation=E7=9A=84titl?= =?UTF-8?q?e=E4=B8=8Emenubar=E9=81=BF=E8=AE=A9=E5=AE=BD=E5=BA=A6=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Knight4Lancelot --- atomicservicenavigation/interfaces/atomicservicenavigation.js | 1 - atomicservicenavigation/source/atomicservicenavigation.ets | 1 - 2 files changed, 2 deletions(-) diff --git a/atomicservicenavigation/interfaces/atomicservicenavigation.js b/atomicservicenavigation/interfaces/atomicservicenavigation.js index c3ad84c..125ae5c 100644 --- a/atomicservicenavigation/interfaces/atomicservicenavigation.js +++ b/atomicservicenavigation/interfaces/atomicservicenavigation.js @@ -816,7 +816,6 @@ export class AtomicServiceNavigation extends ViewPU { top: LengthMetrics.vp(8) }); Button.visibility(this.controlButtonVisible ? Visibility.Visible : Visibility.None); - Button.align(Alignment.Top); }, Button); this.observeComponentCreation2((elmtId, isInitialRender) => { SymbolGlyph.create(); diff --git a/atomicservicenavigation/source/atomicservicenavigation.ets b/atomicservicenavigation/source/atomicservicenavigation.ets index f316be1..ae59c56 100644 --- a/atomicservicenavigation/source/atomicservicenavigation.ets +++ b/atomicservicenavigation/source/atomicservicenavigation.ets @@ -479,7 +479,6 @@ export struct AtomicServiceNavigation { .size({ width: 36, height: 36 }) } .controlButtonStyle() - .align(Alignment.Top) } else { Image(this.titleOptions?.titleIcon) .controlButtonStyle() -- Gitee From 332e1fda0dccf9aa769837c9768afe38bf32afba Mon Sep 17 00:00:00 2001 From: Knight4Lancelot <320062713@qq.com> Date: Sat, 1 Mar 2025 18:40:42 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E8=A7=A3=E5=86=B3ASNavigation=E7=9A=84titl?= =?UTF-8?q?e=E4=B8=8Emenubar=E9=81=BF=E8=AE=A9=E5=AE=BD=E5=BA=A6=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Knight4Lancelot --- .../interfaces/atomicservicenavigation.js | 47 +++++++++++++++---- .../source/atomicservicenavigation.ets | 21 +++++++-- 2 files changed, 54 insertions(+), 14 deletions(-) diff --git a/atomicservicenavigation/interfaces/atomicservicenavigation.js b/atomicservicenavigation/interfaces/atomicservicenavigation.js index 125ae5c..e894992 100644 --- a/atomicservicenavigation/interfaces/atomicservicenavigation.js +++ b/atomicservicenavigation/interfaces/atomicservicenavigation.js @@ -723,8 +723,14 @@ export class AtomicServiceNavigation extends ViewPU { this.observeComponentCreation2((elmtId, isInitialRender) => { SymbolGlyph.create(); SymbolGlyph.attributeModifier.bind(this)(this.sideBarOptions?.sideBarIcon); - SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); - SymbolGlyph.size({ width: 36, height: 36 }); + SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + SymbolGlyph.size({ + width: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, + height: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } + }); }, SymbolGlyph); Button.pop(); }); @@ -820,8 +826,14 @@ export class AtomicServiceNavigation extends ViewPU { this.observeComponentCreation2((elmtId, isInitialRender) => { SymbolGlyph.create(); SymbolGlyph.attributeModifier.bind(this)(this.titleOptions?.titleIcon); - SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); - SymbolGlyph.size({ width: 36, height: 36 }); + SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + SymbolGlyph.size({ + width: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, + height: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } + }); }, SymbolGlyph); Button.pop(); }); @@ -922,8 +934,14 @@ export class AtomicServiceNavigation extends ViewPU { this.observeComponentCreation2((elmtId, isInitialRender) => { SymbolGlyph.create(); SymbolGlyph.attributeModifier.bind(this)(this.titleOptions?.titleIcon); - SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); - SymbolGlyph.size({ width: 36, height: 36 }); + SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + SymbolGlyph.size({ + width: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, + height: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } + }); }, SymbolGlyph); Button.pop(); }); @@ -961,9 +979,11 @@ export class AtomicServiceNavigation extends ViewPU { this.ifElseBranchUpdateFunction(0, () => { this.observeComponentCreation2((elmtId, isInitialRender) => { Button.createWithChild(); - Button.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); - Button.width(36); + Button.borderRadius(0); + Button.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); Button.height(36); + Button.width(36); Button.margin({ start: LengthMetrics.vp(this.marginWindowLeft), end: LengthMetrics.vp(-12), @@ -975,12 +995,19 @@ export class AtomicServiceNavigation extends ViewPU { start: LengthMetrics.vp(0), top: LengthMetrics.vp(0) }); + Button.type(ButtonType.Normal); }, Button); this.observeComponentCreation2((elmtId, isInitialRender) => { SymbolGlyph.create(); SymbolGlyph.attributeModifier.bind(this)(this.titleOptions?.titleIcon); - SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); - SymbolGlyph.size({ width: 36, height: 36 }); + SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + SymbolGlyph.size({ + width: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, + height: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } + }); }, SymbolGlyph); Button.pop(); }); diff --git a/atomicservicenavigation/source/atomicservicenavigation.ets b/atomicservicenavigation/source/atomicservicenavigation.ets index ae59c56..e010685 100644 --- a/atomicservicenavigation/source/atomicservicenavigation.ets +++ b/atomicservicenavigation/source/atomicservicenavigation.ets @@ -455,7 +455,10 @@ export struct AtomicServiceNavigation { SymbolGlyph() .attributeModifier(this.sideBarOptions?.sideBarIcon) .fontSize($r('sys.float.ohos_id_text_size_headline7')) - .size({ width: 36, height: 36 }) + .size({ + width: $r('sys.float.ohos_id_text_size_headline7'), + height: $r('sys.float.ohos_id_text_size_headline7') + }) } .controlButtonStyle() } else { @@ -476,7 +479,10 @@ export struct AtomicServiceNavigation { SymbolGlyph() .attributeModifier(this.titleOptions?.titleIcon) .fontSize($r('sys.float.ohos_id_text_size_headline7')) - .size({ width: 36, height: 36 }) + .size({ + width: $r('sys.float.ohos_id_text_size_headline7'), + height: $r('sys.float.ohos_id_text_size_headline7') + }) } .controlButtonStyle() } else { @@ -541,7 +547,10 @@ export struct AtomicServiceNavigation { SymbolGlyph() .attributeModifier(this.titleOptions?.titleIcon) .fontSize($r('sys.float.ohos_id_text_size_headline7')) - .size({ width: 36, height: 36 }) + .size({ + width: $r('sys.float.ohos_id_text_size_headline7'), + height: $r('sys.float.ohos_id_text_size_headline7') + }) } .roundIconStyle() } else { @@ -574,10 +583,14 @@ export struct AtomicServiceNavigation { SymbolGlyph() .attributeModifier(this.titleOptions?.titleIcon) .fontSize($r('sys.float.ohos_id_text_size_headline7')) - .size({ width: 36, height: 36 }) + .size({ + width: $r('sys.float.ohos_id_text_size_headline7'), + height: $r('sys.float.ohos_id_text_size_headline7') + }) } .backgroundColor($r('sys.color.ohos_id_color_button_normal')) .longIconStyles() + .type(ButtonType.Normal) } else { Image(this.titleOptions?.titleIcon ?? this.atomicServiceIcon) .longIconStyles() -- Gitee From c6d5cce2211d092f3e630b54012385d665740869 Mon Sep 17 00:00:00 2001 From: Knight4Lancelot <320062713@qq.com> Date: Sat, 1 Mar 2025 18:42:51 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E8=A7=A3=E5=86=B3ASNavigation=E7=9A=84titl?= =?UTF-8?q?e=E4=B8=8Emenubar=E9=81=BF=E8=AE=A9=E5=AE=BD=E5=BA=A6=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Knight4Lancelot --- atomicservicenavigation/interfaces/atomicservicenavigation.js | 1 - 1 file changed, 1 deletion(-) diff --git a/atomicservicenavigation/interfaces/atomicservicenavigation.js b/atomicservicenavigation/interfaces/atomicservicenavigation.js index e894992..f06dfd1 100644 --- a/atomicservicenavigation/interfaces/atomicservicenavigation.js +++ b/atomicservicenavigation/interfaces/atomicservicenavigation.js @@ -979,7 +979,6 @@ export class AtomicServiceNavigation extends ViewPU { this.ifElseBranchUpdateFunction(0, () => { this.observeComponentCreation2((elmtId, isInitialRender) => { Button.createWithChild(); - Button.borderRadius(0); Button.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); Button.height(36); -- Gitee From cf6c050b2b7e525974171d64398821c949e46416 Mon Sep 17 00:00:00 2001 From: Knight4Lancelot <320062713@qq.com> Date: Sat, 1 Mar 2025 19:20:14 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E8=A7=A3=E5=86=B3ASNavigation=E7=9A=84titl?= =?UTF-8?q?e=E4=B8=8Emenubar=E9=81=BF=E8=AE=A9=E5=AE=BD=E5=BA=A6=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Knight4Lancelot --- .../interfaces/atomicservicenavigation.js | 41 +++++++++++-------- .../source/atomicservicenavigation.ets | 6 ++- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/atomicservicenavigation/interfaces/atomicservicenavigation.js b/atomicservicenavigation/interfaces/atomicservicenavigation.js index f06dfd1..5f7fe79 100644 --- a/atomicservicenavigation/interfaces/atomicservicenavigation.js +++ b/atomicservicenavigation/interfaces/atomicservicenavigation.js @@ -879,7 +879,8 @@ export class AtomicServiceNavigation extends ViewPU { top: 0, bottom: 0 }, - color: { 'id': -1, 'type': 10001, params: ['sys.color.comp_divider'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, + color: { "id": -1, "type": 10001, params: ['sys.color.comp_divider'], + "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }, style: { right: BorderStyle.Solid } }); @@ -889,7 +890,9 @@ export class AtomicServiceNavigation extends ViewPU { Row.padding({ top: 56 }); Row.focusable(true); Row.defaultFocus(true); - Row.backgroundColor(this.sideBarOptions?.sideBarBackground ?? { 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_sub_background'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + Row.backgroundColor(this.sideBarOptions?.sideBarBackground ?? { "id": -1, "type": 10001, + params: ['sys.color.ohos_id_color_sub_background'], "bundleName": "__harDefaultBundleName__", + "moduleName": "__harDefaultModuleName__" }); Row.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]); }, Row); this.observeComponentCreation2((elmtId, isInitialRender) => { @@ -914,7 +917,8 @@ export class AtomicServiceNavigation extends ViewPU { this.ifElseBranchUpdateFunction(0, () => { this.observeComponentCreation2((elmtId, isInitialRender) => { Button.createWithChild({ type: ButtonType.Circle }); - Button.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + Button.stateEffect(false); + Button.backgroundColor('rgba(0, 0, 0, 0)'); Button.width(36); Button.height(36); Button.borderRadius(18); @@ -934,13 +938,13 @@ export class AtomicServiceNavigation extends ViewPU { this.observeComponentCreation2((elmtId, isInitialRender) => { SymbolGlyph.create(); SymbolGlyph.attributeModifier.bind(this)(this.titleOptions?.titleIcon); - SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], - 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + SymbolGlyph.fontSize({ "id": -1, "type": 10002, params: ['sys.float.ohos_id_text_size_headline7'], + "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }); SymbolGlyph.size({ - width: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], - 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, - height: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], - 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } + width: { "id": -1, "type": 10002, params: ['sys.float.ohos_id_text_size_headline7'], + "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }, + height: { "id": -1, "type": 10002, params: ['sys.float.ohos_id_text_size_headline7'], + "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" } }); }, SymbolGlyph); Button.pop(); @@ -950,7 +954,7 @@ export class AtomicServiceNavigation extends ViewPU { this.ifElseBranchUpdateFunction(1, () => { this.observeComponentCreation2((elmtId, isInitialRender) => { Image.create(this.titleOptions?.titleIcon ?? this.atomicServiceIcon); - Image.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + Image.backgroundColor('rgba(0, 0, 0, 0)'); Image.width(36); Image.height(36); Image.borderRadius(18); @@ -979,8 +983,6 @@ export class AtomicServiceNavigation extends ViewPU { this.ifElseBranchUpdateFunction(0, () => { this.observeComponentCreation2((elmtId, isInitialRender) => { Button.createWithChild(); - Button.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], - 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); Button.height(36); Button.width(36); Button.margin({ @@ -994,18 +996,20 @@ export class AtomicServiceNavigation extends ViewPU { start: LengthMetrics.vp(0), top: LengthMetrics.vp(0) }); + Button.backgroundColor('rgba(0, 0, 0, 0)'); + Button.stateEffect(false); Button.type(ButtonType.Normal); }, Button); this.observeComponentCreation2((elmtId, isInitialRender) => { SymbolGlyph.create(); SymbolGlyph.attributeModifier.bind(this)(this.titleOptions?.titleIcon); - SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], - 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + SymbolGlyph.fontSize({ "id": -1, "type": 10002, params: ['sys.float.ohos_id_text_size_headline7'], + "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }); SymbolGlyph.size({ - width: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], - 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, - height: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], - 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } + width: { "id": -1, "type": 10002, params: ['sys.float.ohos_id_text_size_headline7'], + "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }, + height: { "id": -1, "type": 10002, params: ['sys.float.ohos_id_text_size_headline7'], + "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" } }); }, SymbolGlyph); Button.pop(); @@ -1028,6 +1032,7 @@ export class AtomicServiceNavigation extends ViewPU { start: LengthMetrics.vp(0), top: LengthMetrics.vp(0) }); + Image.backgroundColor('rgba(0, 0, 0, 0)'); Image.objectFit(ImageFit.Auto); }, Image); }); diff --git a/atomicservicenavigation/source/atomicservicenavigation.ets b/atomicservicenavigation/source/atomicservicenavigation.ets index e010685..9cef445 100644 --- a/atomicservicenavigation/source/atomicservicenavigation.ets +++ b/atomicservicenavigation/source/atomicservicenavigation.ets @@ -522,7 +522,7 @@ export struct AtomicServiceNavigation { @Styles roundIconStyle() { - .backgroundColor($r('sys.color.ohos_id_color_button_normal')) + .backgroundColor('rgba(0, 0, 0, 0)') .width(36) .height(36) .borderRadius(18) @@ -552,6 +552,7 @@ export struct AtomicServiceNavigation { height: $r('sys.float.ohos_id_text_size_headline7') }) } + .stateEffect(false) .roundIconStyle() } else { Image(this.titleOptions?.titleIcon ?? this.atomicServiceIcon) @@ -574,6 +575,7 @@ export struct AtomicServiceNavigation { start: LengthMetrics.vp(0), top: LengthMetrics.vp(0) }) + .backgroundColor('rgba(0, 0, 0, 0)') } @Builder @@ -588,8 +590,8 @@ export struct AtomicServiceNavigation { height: $r('sys.float.ohos_id_text_size_headline7') }) } - .backgroundColor($r('sys.color.ohos_id_color_button_normal')) .longIconStyles() + .stateEffect(false) .type(ButtonType.Normal) } else { Image(this.titleOptions?.titleIcon ?? this.atomicServiceIcon) -- Gitee From 8b4beb6d8eb78529071965de5a7351f2f8cda216 Mon Sep 17 00:00:00 2001 From: Knight4Lancelot <320062713@qq.com> Date: Sat, 1 Mar 2025 19:26:25 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E8=A7=A3=E5=86=B3ASNavigation=E7=9A=84titl?= =?UTF-8?q?e=E4=B8=8Emenubar=E9=81=BF=E8=AE=A9=E5=AE=BD=E5=BA=A6=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Knight4Lancelot --- .../interfaces/atomicservicenavigation.js | 42 ++++++++++++------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/atomicservicenavigation/interfaces/atomicservicenavigation.js b/atomicservicenavigation/interfaces/atomicservicenavigation.js index 5f7fe79..367711f 100644 --- a/atomicservicenavigation/interfaces/atomicservicenavigation.js +++ b/atomicservicenavigation/interfaces/atomicservicenavigation.js @@ -624,7 +624,8 @@ export class AtomicServiceNavigation extends ViewPU { Text.minFontSize(14); Text.maxFontSize(26); Text.height(36); - Text.fontColor({ 'id': -1, 'type': 10001, params: ['sys.color.font_primary'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + Text.fontColor({ 'id': -1, 'type': 10001, params: ['sys.color.font_primary'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); Text.textOverflow({ overflow: TextOverflow.Ellipsis }); Text.fontWeight(FontWeight.Bold); Text.width(0); @@ -647,7 +648,8 @@ export class AtomicServiceNavigation extends ViewPU { this.observeComponentCreation2((elmtId, isInitialRender) => { Column.create(); Column.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]); - Column.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_mask_thin'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + Column.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_mask_thin'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); Column.transition(TransitionEffect.opacity(0).animation({ duration: 500, curve: Curve.Linear })); Column.width('100%'); Column.height('100%'); @@ -669,7 +671,8 @@ export class AtomicServiceNavigation extends ViewPU { this.ifElseBranchUpdateFunction(0, () => { this.observeComponentCreation2((elmtId, isInitialRender) => { Button.createWithChild({ type: ButtonType.Circle }); - Button.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + Button.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); Button.width(36); Button.height(36); Button.borderRadius(18); @@ -689,10 +692,13 @@ export class AtomicServiceNavigation extends ViewPU { Button.visibility(this.controlButtonVisible ? Visibility.Visible : Visibility.None); }, Button); this.observeComponentCreation2((elmtId, isInitialRender) => { - SymbolGlyph.create({ 'id': -1, 'type': 40000, params: ['sys.symbol.open_sidebar'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + SymbolGlyph.create({ 'id': -1, 'type': 40000, params: ['sys.symbol.open_sidebar'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); SymbolGlyph.fontWeight(FontWeight.Normal); - SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); - SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_titlebar_icon'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]); + SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_titlebar_icon'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]); }, SymbolGlyph); Button.pop(); }); @@ -701,7 +707,8 @@ export class AtomicServiceNavigation extends ViewPU { this.ifElseBranchUpdateFunction(1, () => { this.observeComponentCreation2((elmtId, isInitialRender) => { Button.createWithChild({ type: ButtonType.Circle }); - Button.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + Button.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); Button.width(36); Button.height(36); Button.borderRadius(18); @@ -739,7 +746,8 @@ export class AtomicServiceNavigation extends ViewPU { this.ifElseBranchUpdateFunction(2, () => { this.observeComponentCreation2((elmtId, isInitialRender) => { Image.create(this.sideBarOptions?.sideBarIcon); - Image.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + Image.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); Image.width(36); Image.height(36); Image.borderRadius(18); @@ -772,7 +780,8 @@ export class AtomicServiceNavigation extends ViewPU { this.ifElseBranchUpdateFunction(0, () => { this.observeComponentCreation2((elmtId, isInitialRender) => { Button.createWithChild({ type: ButtonType.Circle }); - Button.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + Button.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); Button.width(36); Button.height(36); Button.borderRadius(18); @@ -792,10 +801,13 @@ export class AtomicServiceNavigation extends ViewPU { Button.visibility(this.controlButtonVisible ? Visibility.Visible : Visibility.None); }, Button); this.observeComponentCreation2((elmtId, isInitialRender) => { - SymbolGlyph.create({ 'id': -1, 'type': 40000, params: ['sys.symbol.close_sidebar'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + SymbolGlyph.create({ 'id': -1, 'type': 40000, params: ['sys.symbol.close_sidebar'], 'bundleName': + '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); SymbolGlyph.fontWeight(FontWeight.Normal); - SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); - SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_titlebar_icon'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]); + SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + SymbolGlyph.fontColor([{ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_titlebar_icon'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }]); }, SymbolGlyph); Button.pop(); }); @@ -804,7 +816,8 @@ export class AtomicServiceNavigation extends ViewPU { this.ifElseBranchUpdateFunction(1, () => { this.observeComponentCreation2((elmtId, isInitialRender) => { Button.createWithChild({ type: ButtonType.Circle }); - Button.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + Button.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); Button.width(36); Button.height(36); Button.borderRadius(18); @@ -842,7 +855,8 @@ export class AtomicServiceNavigation extends ViewPU { this.ifElseBranchUpdateFunction(2, () => { this.observeComponentCreation2((elmtId, isInitialRender) => { Image.create(this.titleOptions?.titleIcon); - Image.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); + Image.backgroundColor({ 'id': -1, 'type': 10001, params: ['sys.color.ohos_id_color_button_normal'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); Image.width(36); Image.height(36); Image.borderRadius(18); -- Gitee From bc752e1d7992d88c1913820a44a76cc6290147df Mon Sep 17 00:00:00 2001 From: Knight4Lancelot <320062713@qq.com> Date: Sat, 1 Mar 2025 19:31:43 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=A7=A3=E5=86=B3ASNavigation=E7=9A=84titl?= =?UTF-8?q?e=E4=B8=8Emenubar=E9=81=BF=E8=AE=A9=E5=AE=BD=E5=BA=A6=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Knight4Lancelot --- .../interfaces/atomicservicenavigation.js | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/atomicservicenavigation/interfaces/atomicservicenavigation.js b/atomicservicenavigation/interfaces/atomicservicenavigation.js index 367711f..36e88e4 100644 --- a/atomicservicenavigation/interfaces/atomicservicenavigation.js +++ b/atomicservicenavigation/interfaces/atomicservicenavigation.js @@ -893,8 +893,8 @@ export class AtomicServiceNavigation extends ViewPU { top: 0, bottom: 0 }, - color: { "id": -1, "type": 10001, params: ['sys.color.comp_divider'], - "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }, + color: { 'id': -1, 'type': 10001, params: ['sys.color.comp_divider'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, style: { right: BorderStyle.Solid } }); @@ -904,9 +904,9 @@ export class AtomicServiceNavigation extends ViewPU { Row.padding({ top: 56 }); Row.focusable(true); Row.defaultFocus(true); - Row.backgroundColor(this.sideBarOptions?.sideBarBackground ?? { "id": -1, "type": 10001, - params: ['sys.color.ohos_id_color_sub_background'], "bundleName": "__harDefaultBundleName__", - "moduleName": "__harDefaultModuleName__" }); + Row.backgroundColor(this.sideBarOptions?.sideBarBackground ?? { 'id': -1, 'type': 10001, + params: ['sys.color.ohos_id_color_sub_background'], 'bundleName': '__harDefaultBundleName__', + 'moduleName': '__harDefaultModuleName__' }); Row.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]); }, Row); this.observeComponentCreation2((elmtId, isInitialRender) => { @@ -952,13 +952,13 @@ export class AtomicServiceNavigation extends ViewPU { this.observeComponentCreation2((elmtId, isInitialRender) => { SymbolGlyph.create(); SymbolGlyph.attributeModifier.bind(this)(this.titleOptions?.titleIcon); - SymbolGlyph.fontSize({ "id": -1, "type": 10002, params: ['sys.float.ohos_id_text_size_headline7'], - "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }); + SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); SymbolGlyph.size({ - width: { "id": -1, "type": 10002, params: ['sys.float.ohos_id_text_size_headline7'], - "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }, - height: { "id": -1, "type": 10002, params: ['sys.float.ohos_id_text_size_headline7'], - "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" } + width: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, + height: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } }); }, SymbolGlyph); Button.pop(); @@ -1017,13 +1017,13 @@ export class AtomicServiceNavigation extends ViewPU { this.observeComponentCreation2((elmtId, isInitialRender) => { SymbolGlyph.create(); SymbolGlyph.attributeModifier.bind(this)(this.titleOptions?.titleIcon); - SymbolGlyph.fontSize({ "id": -1, "type": 10002, params: ['sys.float.ohos_id_text_size_headline7'], - "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }); + SymbolGlyph.fontSize({ 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }); SymbolGlyph.size({ - width: { "id": -1, "type": 10002, params: ['sys.float.ohos_id_text_size_headline7'], - "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" }, - height: { "id": -1, "type": 10002, params: ['sys.float.ohos_id_text_size_headline7'], - "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" } + width: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' }, + height: { 'id': -1, 'type': 10002, params: ['sys.float.ohos_id_text_size_headline7'], + 'bundleName': '__harDefaultBundleName__', 'moduleName': '__harDefaultModuleName__' } }); }, SymbolGlyph); Button.pop(); -- Gitee