From 045c7976a9db863960be7ab076adf89b248daa24 Mon Sep 17 00:00:00 2001 From: qiin <414382190@qq.com> Date: Sat, 25 Jul 2026 20:18:49 +0800 Subject: [PATCH 1/2] style(stream-menu): restore glass translucency --- .../src/main/ets/common/OverlayConstants.ets | 2 ++ .../ets/components/dialogs/GameMenuDialog.ets | 26 +++++++++---------- .../main/resources/base/element/color.json | 16 +++++++++--- .../main/resources/dark/element/color.json | 14 +++++++--- 4 files changed, 37 insertions(+), 21 deletions(-) diff --git a/entry/src/main/ets/common/OverlayConstants.ets b/entry/src/main/ets/common/OverlayConstants.ets index c69bb08..3de5f10 100644 --- a/entry/src/main/ets/common/OverlayConstants.ets +++ b/entry/src/main/ets/common/OverlayConstants.ets @@ -52,6 +52,8 @@ export class StreamMenuColors { static readonly TextFaint = $r('app.color.stream_menu_text_faint'); static readonly AccentBlue = $r('app.color.stream_menu_accent_blue'); static readonly AccentPink = $r('app.color.stream_menu_accent_pink'); + static readonly AccentBlueText = $r('app.color.stream_menu_accent_blue_text'); + static readonly AccentPinkText = $r('app.color.stream_menu_accent_pink_text'); static readonly AccentGold = $r('app.color.stream_menu_accent_gold'); static readonly BlueSurface = $r('app.color.stream_menu_blue_surface'); static readonly BlueBorder = $r('app.color.stream_menu_blue_border'); diff --git a/entry/src/main/ets/components/dialogs/GameMenuDialog.ets b/entry/src/main/ets/components/dialogs/GameMenuDialog.ets index d61aff3..7cd595d 100644 --- a/entry/src/main/ets/components/dialogs/GameMenuDialog.ets +++ b/entry/src/main/ets/components/dialogs/GameMenuDialog.ets @@ -921,9 +921,7 @@ export struct GameMenuDialog { .width(OV_CARD_WIDTH) .height(36) .padding({ left: 14, right: 14 }) - .borderRadius(OV_CARD_RADIUS) - .backgroundColor(StreamMenuColors.Surface) - .border({ width: 1, color: StreamMenuColors.Border }) + .cardStyle() .alignItems(VerticalAlign.Center) .onClick(() => { animateTo({ duration: 200, curve: Curve.EaseInOut }, () => { @@ -1001,7 +999,7 @@ export struct GameMenuDialog { Text('编辑布局') .fontSize(12) .fontWeight(FontWeight.Medium) - .fontColor(StreamMenuColors.AccentPink) + .fontColor(StreamMenuColors.AccentPinkText) .padding({ left: 14, right: 14, top: 7, bottom: 7 }) .borderRadius(14) .backgroundColor(StreamMenuColors.PinkSurface) @@ -1013,7 +1011,7 @@ export struct GameMenuDialog { Text('导出') .fontSize(12) .fontWeight(FontWeight.Medium) - .fontColor(StreamMenuColors.AccentBlue) + .fontColor(StreamMenuColors.AccentBlueText) .padding({ left: 14, right: 14, top: 7, bottom: 7 }) .borderRadius(14) .backgroundColor(StreamMenuColors.BlueSurface) @@ -1025,7 +1023,7 @@ export struct GameMenuDialog { Text('导入') .fontSize(12) .fontWeight(FontWeight.Medium) - .fontColor(StreamMenuColors.AccentBlue) + .fontColor(StreamMenuColors.AccentBlueText) .padding({ left: 14, right: 14, top: 7, bottom: 7 }) .borderRadius(14) .backgroundColor(StreamMenuColors.BlueSurface) @@ -1052,7 +1050,7 @@ export struct GameMenuDialog { if (this.isPanZoomActive) { Text('重置') .fontSize(11) - .fontColor(StreamMenuColors.AccentBlue) + .fontColor(StreamMenuColors.AccentBlueText) .fontWeight(FontWeight.Medium) .padding({ left: 10, right: 10, top: 4, bottom: 4 }) .borderRadius(10) @@ -1154,7 +1152,7 @@ export struct GameMenuDialog { Blank() Text(`${Math.round(this.controllerOpacityLocal * 100)}%`) .fontSize(OV_FONT_MD) - .fontColor(StreamMenuColors.AccentBlue) + .fontColor(StreamMenuColors.AccentBlueText) .fontWeight(FontWeight.Medium) } .width('100%') @@ -1199,7 +1197,7 @@ export struct GameMenuDialog { Blank() Text(`${Math.round(this.controllerScaleLocal * 100)}%`) .fontSize(OV_FONT_MD) - .fontColor(StreamMenuColors.AccentBlue) + .fontColor(StreamMenuColors.AccentBlueText) .fontWeight(FontWeight.Medium) } .width('100%') @@ -1306,7 +1304,7 @@ export struct GameMenuDialog { Blank() Text(`${this.audioVibrationStrength}%`) .fontSize(OV_FONT_MD) - .fontColor(StreamMenuColors.AccentPink) + .fontColor(StreamMenuColors.AccentPinkText) .fontWeight(FontWeight.Medium) } .width('100%') @@ -1399,7 +1397,7 @@ export struct GameMenuDialog { Blank() Text(this.formatBitrate(this.currentBitrate)) .fontSize(12) - .fontColor(StreamMenuColors.AccentPink) + .fontColor(StreamMenuColors.AccentPinkText) .fontWeight(FontWeight.Medium) } .width('100%') @@ -1470,7 +1468,7 @@ export struct GameMenuDialog { Blank() Text(this.isAdjustingBitrate ? '调整中...' : this.formatBitrate(this.sliderValueToBitrate(this.bitrateSliderValue))) .fontSize(OV_FONT_MD) - .fontColor(this.isAdjustingBitrate ? StreamMenuColors.TextDim : StreamMenuColors.AccentPink) + .fontColor(this.isAdjustingBitrate ? StreamMenuColors.TextDim : StreamMenuColors.AccentPinkText) .fontWeight(FontWeight.Bold) Blank() Text('200').fontSize(OV_FONT_SM).fontColor(StreamMenuColors.TextDim) @@ -1517,7 +1515,7 @@ export struct GameMenuDialog { Text(this.hasGyroscope ? '陀螺仪 → 右摇杆映射' : '⚠ 设备无陀螺仪') .fontSize(OV_FONT_SM) - .fontColor(this.hasGyroscope ? StreamMenuColors.TextFaint : StreamMenuColors.AccentPink) + .fontColor(this.hasGyroscope ? StreamMenuColors.TextFaint : StreamMenuColors.AccentPinkText) .width('100%') .padding({ left: 16, right: 16, bottom: this.gyroEnabled ? 8 : 14 }) @@ -1530,7 +1528,7 @@ export struct GameMenuDialog { Blank() Text(`${this.gyroSensitivity.toFixed(1)}x`) .fontSize(OV_FONT_MD) - .fontColor(StreamMenuColors.AccentBlue) + .fontColor(StreamMenuColors.AccentBlueText) .fontWeight(FontWeight.Medium) } .width('100%') diff --git a/entry/src/main/resources/base/element/color.json b/entry/src/main/resources/base/element/color.json index 66771b0..269d4f3 100644 --- a/entry/src/main/resources/base/element/color.json +++ b/entry/src/main/resources/base/element/color.json @@ -118,7 +118,7 @@ }, { "name": "stream_menu_surface", - "value": "#EAF7F9FC" + "value": "#C0F7F9FC" }, { "name": "stream_menu_control", @@ -146,15 +146,15 @@ }, { "name": "stream_menu_text_medium", - "value": "#E03B4852" + "value": "#F52E3A44" }, { "name": "stream_menu_text_dim", - "value": "#ED48545E" + "value": "#F535424C" }, { "name": "stream_menu_text_faint", - "value": "#E044505A" + "value": "#E02E3A44" }, { "name": "stream_menu_accent_blue", @@ -164,6 +164,14 @@ "name": "stream_menu_accent_pink", "value": "#9C294B" }, + { + "name": "stream_menu_accent_blue_text", + "value": "#0E436C" + }, + { + "name": "stream_menu_accent_pink_text", + "value": "#741A34" + }, { "name": "stream_menu_accent_gold", "value": "#8A5700" diff --git a/entry/src/main/resources/dark/element/color.json b/entry/src/main/resources/dark/element/color.json index 042cec2..02462d2 100644 --- a/entry/src/main/resources/dark/element/color.json +++ b/entry/src/main/resources/dark/element/color.json @@ -118,7 +118,7 @@ }, { "name": "stream_menu_surface", - "value": "#B31A1E24" + "value": "#A61A1E24" }, { "name": "stream_menu_control", @@ -150,11 +150,11 @@ }, { "name": "stream_menu_text_dim", - "value": "#C8FFFFFF" + "value": "#D0FFFFFF" }, { "name": "stream_menu_text_faint", - "value": "#C0FFFFFF" + "value": "#C8FFFFFF" }, { "name": "stream_menu_accent_blue", @@ -164,6 +164,14 @@ "name": "stream_menu_accent_pink", "value": "#FFD0D9" }, + { + "name": "stream_menu_accent_blue_text", + "value": "#BCE5F0" + }, + { + "name": "stream_menu_accent_pink_text", + "value": "#FFD0D9" + }, { "name": "stream_menu_accent_gold", "value": "#FFD166" From a5f8fc4bf327e0f4b6c724cc4fb0907962797b8d Mon Sep 17 00:00:00 2001 From: qiin <414382190@qq.com> Date: Sun, 26 Jul 2026 10:40:03 +0800 Subject: [PATCH 2/2] style(stream-menu): restore sock menu styling --- .../src/main/ets/common/OverlayConstants.ets | 1 - .../ets/components/dialogs/GameMenuDialog.ets | 26 ++++++++++++------- .../main/resources/base/element/color.json | 4 --- .../main/resources/dark/element/color.json | 4 --- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/entry/src/main/ets/common/OverlayConstants.ets b/entry/src/main/ets/common/OverlayConstants.ets index 3de5f10..a500096 100644 --- a/entry/src/main/ets/common/OverlayConstants.ets +++ b/entry/src/main/ets/common/OverlayConstants.ets @@ -63,7 +63,6 @@ export class StreamMenuColors { static readonly OnAccent = $r('app.color.stream_menu_on_accent'); static readonly Success = $r('app.color.stream_menu_success'); static readonly SuccessSurface = $r('app.color.stream_menu_success_surface'); - static readonly OnPastel = $r('app.color.stream_menu_on_pastel'); } /** 覆盖层背景色 */ diff --git a/entry/src/main/ets/components/dialogs/GameMenuDialog.ets b/entry/src/main/ets/components/dialogs/GameMenuDialog.ets index 7cd595d..4ff1f5e 100644 --- a/entry/src/main/ets/components/dialogs/GameMenuDialog.ets +++ b/entry/src/main/ets/components/dialogs/GameMenuDialog.ets @@ -65,6 +65,7 @@ interface MenuItem { label: string; bgColor: string; borderColor: string; + textColor: string; } /** 触摸模式选项 */ @@ -103,13 +104,13 @@ const CARD_USAGE_KEY = 'game_menu_card_usage'; // 马卡龙色系菜单配置 const MENU_ITEMS: MenuItem[] = [ - { icon: '✦', label: 'HDR', bgColor: '#F7EBC7', borderColor: '#D0A850' }, - { icon: '◎', label: 'USB驱动', bgColor: '#F7D1D1', borderColor: '#D87070' }, - { icon: '⌨', label: '键盘', bgColor: '#C7F7E0', borderColor: '#50C080' }, - { icon: '☝', label: '触控', bgColor: '#E0D4F7', borderColor: '#9080C0' }, - { icon: '🎮', label: '手柄', bgColor: '#D4E8F7', borderColor: '#6098C0' }, - { icon: '🖱', label: '鼠标', bgColor: '#F7E0C7', borderColor: '#C08050' }, - { icon: '✕', label: '退出', bgColor: '#F7CFCF', borderColor: '#D06060' } + { icon: '✦', label: 'HDR', bgColor: '#F7EBC7', borderColor: '#D0A850', textColor: '#7B632F' }, + { icon: '◎', label: 'USB驱动', bgColor: '#F7D1D1', borderColor: '#D87070', textColor: '#8A4848' }, + { icon: '⌨', label: '键盘', bgColor: '#C7F7E0', borderColor: '#50C080', textColor: '#30734D' }, + { icon: '☝', label: '触控', bgColor: '#E0D4F7', borderColor: '#9080C0', textColor: '#5F547F' }, + { icon: '🎮', label: '手柄', bgColor: '#D4E8F7', borderColor: '#6098C0', textColor: '#406681' }, + { icon: '🖱', label: '鼠标', bgColor: '#F7E0C7', borderColor: '#C08050', textColor: '#835736' }, + { icon: '✕', label: '退出', bgColor: '#F7CFCF', borderColor: '#D06060', textColor: '#904242' } ]; const MENU_OFFSETS: number[] = [25, 55, 70, 35, 45, 30, 50]; @@ -117,6 +118,7 @@ const MENU_OFFSETS: number[] = [25, 55, 70, 35, 45, 30, 50]; // 激活色 const ACTIVE_BG_COLOR = '#C7F7D4'; const ACTIVE_BORDER_COLOR = '#50A860'; +const ACTIVE_TEXT_COLOR = '#367241'; @CustomDialog export struct GameMenuDialog { @@ -566,6 +568,13 @@ export struct GameMenuDialog { return MENU_ITEMS[index].borderColor; } + private getMenuTextColor(index: number): string { + if ((index === 1 && this.isUsbDriverMode) || (index === 5 && this.isMouseEmulationActive)) { + return ACTIVE_TEXT_COLOR; + } + return MENU_ITEMS[index].textColor; + } + private async loadGyroSettings(): Promise { this.hasGyroscope = DeviceSensorService.getInstance().hasGyroscope(); const gyroAssist = GyroAssistService.getInstance(); @@ -1734,7 +1743,7 @@ export struct GameMenuDialog { Text(this.getMenuLabel(index)) .fontSize(12) .fontWeight(FontWeight.Bold) - .fontColor(StreamMenuColors.OnPastel) + .fontColor(this.getMenuTextColor(index)) } .width(75) .height(36) @@ -1758,7 +1767,6 @@ export struct GameMenuDialog { } .height(40) .padding(2) - .shadow({ radius: 6, color: StreamMenuColors.Shadow, offsetY: 2 }) .scale({ x: this.scales[index], y: this.scales[index] }) .translate({ x: this.positions[index] }) .margin({ right: MENU_OFFSETS[index], bottom: 4 }) diff --git a/entry/src/main/resources/base/element/color.json b/entry/src/main/resources/base/element/color.json index 269d4f3..f573249 100644 --- a/entry/src/main/resources/base/element/color.json +++ b/entry/src/main/resources/base/element/color.json @@ -207,10 +207,6 @@ { "name": "stream_menu_success_surface", "value": "#14126638" - }, - { - "name": "stream_menu_on_pastel", - "value": "#E61A1E24" } ] } diff --git a/entry/src/main/resources/dark/element/color.json b/entry/src/main/resources/dark/element/color.json index 02462d2..5f24062 100644 --- a/entry/src/main/resources/dark/element/color.json +++ b/entry/src/main/resources/dark/element/color.json @@ -207,10 +207,6 @@ { "name": "stream_menu_success_surface", "value": "#40202F27" - }, - { - "name": "stream_menu_on_pastel", - "value": "#E61A1E24" } ] }