Compare commits

..

2 Commits

Author SHA1 Message Date
yuquanjun 794345d3ba Enable chord-progression LEDs in universal mode.
Drive measure-synced Loop_Light for TAB 0 (and settings entered from it) using the same 1645/1564/1364 rules as normal mode.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 08:41:30 +08:00
yuquanjun c5428ad81f Fix incomplete status-bar battery outline.
Keep L/R walls when generating the outline asset, tighten fill to the cavity, and nudge the icon up so the bottom edge is not clipped.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 07:57:55 +08:00
5 changed files with 68 additions and 51 deletions

View File

@ -1254,8 +1254,15 @@ uint8_t GetChordNotesByType(uint8_t MIDI_Index,uint8_t type,uint8_t *buff)
void Read_Cur_Measure()
{
uint32_t now = rt_tick_get();
static uint32_t last_tick_i = 0;;
if((mGuiData[GUI_TAB_INDEX].Current == 2 || (mGuiData[GUI_TAB_LAST_INDEX].Current == 2 && mGuiData[GUI_TAB_INDEX].Current == 3)) && StartFlag)
static uint32_t last_tick_i = 0;
uint8_t tab = (uint8_t)mGuiData[GUI_TAB_INDEX].Current;
uint8_t last = (uint8_t)mGuiData[GUI_TAB_LAST_INDEX].Current;
/* 普通(2)与万能(0)均按「和弦走向」同步亮灯;设置页(3)沿用进入前模式 */
uint8_t loop_light_ok =
(tab == 0 || tab == 2) ||
(tab == 3 && (last == 0 || last == 2));
if (loop_light_ok && StartFlag)
{
if(now - last_tick_i >= 10)
{

View File

@ -230,7 +230,7 @@ void label_top()
{
const uint16_t btn_color = /*DARKLGRAY*/0x2988;
LCD_FillByColor(0, 0, 240, UI_STATUS_BAR_H, UI0902_BG_COLOR);
/* 仅一组动态音量条(音量图标素材本身也是竖条,不再叠绘以免双图标 */
/* 音量条:渐变 + 圆角(见 Draw_Volume_Bar */
Draw_Volume_Bar(UI0902_VOL_X, UI0902_VOL_Y, level, 1, WHITE, GRAY);
LCD_DrawLine(0, 26, 240, 26, btn_color);
Show_BL_Icon(mGuiData[GUI_BL_SW].Current);
@ -340,13 +340,13 @@ void Draw_Status_Battery_Icon(uint8_t battery_percent)
LCD_FillByColor(bat_x > 2 ? (uint16_t)(bat_x - 2) : 0, 0, 240, UI_STATUS_BAR_H,
UI0902_BG_COLOR);
/* 实心电量条(旧 fill 图误含「80%」文字) */
fill_w = (uint16_t)((22UL * battery_percent) / 100);
/* 实心电量条:内腔约 x+3..x+23宽21勿盖住右侧壳壁 */
fill_w = (uint16_t)((21UL * battery_percent) / 100);
if (fill_w > 0) {
fill_x1 = (uint16_t)(bat_x + 3);
fill_y1 = (uint16_t)(UI0902_BATTERY_Y + 2);
fill_x2 = (uint16_t)(fill_x1 + fill_w - 1);
fill_y2 = (uint16_t)(fill_y1 + 8);
fill_y2 = (uint16_t)(fill_y1 + 7);
LCD_FillByColor(fill_x1, fill_y1, fill_x2, fill_y2, WHITE);
}
LCD_WR_PIC_Trans(bat_x, UI0902_BATTERY_Y, UI0902_BATTERY_W, UI0902_BATTERY_H,

View File

@ -122,7 +122,7 @@ void CallUI_RestoreSelect(void);
#define UI0902_BT_Y 5
#define UI0902_BATTERY_W 29
#define UI0902_BATTERY_H 12
#define UI0902_BATTERY_Y 14 /* mode.png 状态栏电池顶 ≈y14 */
#define UI0902_BATTERY_Y 13 /* 顶≈y13底 y24与分隔线 y26 留空,避免底边被切 */
#define UI0902_BATTERY_RIGHT_MARGIN 6
#define UI0902_BATTERY_TEXT_GAP 4
#define UI0902_BATTERY_TEXT_SIZE 9 /* mode.png 百分比字号 ≈9完整显示 % */

View File

@ -3,50 +3,50 @@
/* Auto-generated by tools/gen_ui0902_assets.py. Do not hand-edit. */
const unsigned char gImage_UI0902_BatteryOutline_29x12[696] = { /* 29x12 RGB565 BE */
0x00,0x00,0x5B,0x0D,0xC6,0x18,0xC6,0x18,0xC6,0x18,0xC6,0x18,0xC6,0x18,0xC6,0x18,
0xC6,0x18,0xC6,0x18,0xC6,0x18,0xC6,0x18,0xC6,0x18,0xC6,0x18,0xC6,0x18,0xC6,0x18,
0xC6,0x18,0xC6,0x18,0xC6,0x18,0xC6,0x18,0xC6,0x18,0xC6,0x18,0xC6,0x18,0xC6,0x18,
0xC6,0x18,0xA5,0x14,0x10,0xA3,0x00,0x21,0x00,0x00,0x21,0x04,0xFF,0xFF,0xD6,0x9A,
0x84,0x31,0x84,0x31,0x84,0x31,0x84,0x31,0x84,0x31,0x84,0x31,0x84,0x31,0x84,0x31,
0x84,0x31,0x84,0x31,0x84,0x31,0x84,0x31,0x84,0x31,0x84,0x31,0x84,0x31,0x84,0x31,
0x84,0x31,0x84,0x31,0x84,0x31,0x84,0x31,0x84,0x31,0x94,0x93,0xFF,0xFF,0xA5,0x14,
0x00,0x42,0x00,0x00,0x42,0x08,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x00,0x00,0x42,0x08,
0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x42,0x00,0x00,0x42,0x08,0xFF,0xFF,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD6,0x9A,
0x10,0x82,0x42,0x08,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x42,0x08,0x42,0x08,0xFF,0xFF,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xFF,0xFF,0x42,0x08,0x42,0x08,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF7,0x9E,0x21,0x04,
0x42,0x08,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x26,0x00,0x00,0x42,0x08,0xFF,0xFF,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x42,0x00,0x00,0x29,0x86,0xFF,0xFF,0xA5,0x14,0x42,0x29,0x42,0x29,0x42,0x29,
0x42,0x29,0x42,0x29,0x42,0x29,0x42,0x29,0x42,0x29,0x42,0x29,0x42,0x29,0x42,0x29,
0x42,0x29,0x42,0x29,0x42,0x29,0x42,0x29,0x42,0x29,0x42,0x29,0x42,0x29,0x42,0x29,
0x42,0x29,0x42,0x29,0x52,0xAB,0xF7,0x9E,0xB5,0x96,0x00,0x42,0x00,0x00,0x00,0x00,
0xA5,0x14,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xE7,0x1C,0x31,0xA7,0x00,0x42,0x00,0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x21,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x00,0x42,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x42,0xFF,0xFF,0xFF,0xFF,0x00,0x42,0x00,0x00,0xFF,0xFF,
0xFF,0xFF,0x00,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,
0xFF,0xFF,0xFF,0xFF,0x00,0x42,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x42,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x42,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x00,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x42,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x00,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x42,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x42,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0xFF,0xFF,0xFF,0xFF,
0x00,0x42,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x42,0x00,0x00,0x00,0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x00,0x42,0x00,0x00,
};
const unsigned char gImage_UI0902_Volume_20x15[600] = { /* 20x15 RGB565 BE */

View File

@ -82,15 +82,25 @@ def emit_c_array(lines, name, data, w, h):
def make_battery_outline():
"""电池图标-10 -> outline only (interior fill removed; runtime draws level fill)."""
"""电池图标-10 -> outline only (keep L/R walls; runtime draws level fill)."""
im = Image.open(SRC / "02_顶部图标" / "电池图标-10.png").convert("RGBA")
px = im.load()
w, h = im.size
# 旧 range(2,27) 会抹掉右侧壳壁,导致显示残缺
for y in range(2, 10):
for x in range(2, 27):
for x in range(3, 24):
px[x, y] = (0, 0, 0, 0)
for y in range(h):
for x in range(w):
r, g, b, a = px[x, y]
if a >= 40 and (r + g + b) >= 60:
px[x, y] = (255, 255, 255, 255)
elif a < 40 or (r < 12 and g < 12 and b < 12):
px[x, y] = (0, 0, 0, 0)
return im
def make_battery_fill():
"""Solid white 22x9 level strip (do NOT use 电池电量 mockup — it embeds \"80%\" text)."""
return Image.new("RGBA", (22, 9), (255, 255, 255, 255))