Skip to content

Commit f6df37a

Browse files
committed
2026.09.15
1 parent a3f07e9 commit f6df37a

23 files changed

Lines changed: 13845 additions & 13055 deletions

data/www/script.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,19 @@ function onMessage(event) {
265265
websocket.send('getindex=1');
266266
return;
267267
}
268-
if(typeof data.act !== 'undefined'){ data.act.forEach(showclass=> { classEach(showclass, function(el) { el.classList.remove("hidden"); }); }); return; }
268+
/* The server reports the settings groups in BOTH directions: "group_x" offers a group and
269+
"hide_group_x" withdraws it. The conditions for the layout-driven groups (VU, buffer bar,
270+
weather) come from the active layout, so they can flip while this page is open - the withdrawal
271+
is what stops a row for a widget the new layout dropped from lingering until a reload.
272+
The token has to be INTERPRETED, not applied: classEach() does querySelectorAll('.'+name), so
273+
passing "hide_group_x" through as a class name would silently match nothing. */
274+
if(typeof data.act !== 'undefined'){
275+
data.act.forEach(showclass=> {
276+
if (showclass.startsWith('hide_')) classEach(showclass.slice(5), function(el) { el.classList.add("hidden"); });
277+
else classEach(showclass, function(el) { el.classList.remove("hidden"); });
278+
});
279+
return;
280+
}
269281
// Apply maxVol to volume slider if present in flat config data
270282
if (typeof data.maxVol !== 'undefined') {
271283
var volSlider = getId('volume');

src/core/commandhandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ bool CommandHandler::exec(const char *command, const char *value, uint8_t cid, C
138138
if (cmdIs(command, "flipscreen")) { config.saveValueButWait(&config.store.flipscreen, static_cast<bool>(atoi(value)), 5000); display.flip(); display.putRequest(NEWMODE, CLEAR); display.putRequest(NEWMODE, PLAYER); return true; }
139139
if (cmdIs(command, "invertdisplay")) { config.saveValueButWait(&config.store.invertdisplay, static_cast<bool>(atoi(value)), 5000); return true; } //display.invert();
140140
if (cmdIs(command, "inverttitle")) { config.saveValueButWait(&config.store.inverttitle, static_cast<bool>(atoi(value)), 5000); display.applyTheme(config.store.themeId); return true; }
141-
if (cmdIs(command, "layout")) { uint8_t id = constrain(atoi(value), 0, display.getLayoutCount() - 1); config.saveValueButWait(&config.store.layoutId, id, 5000); display.applyLayout(id); return true; }
141+
if (cmdIs(command, "layout")) { uint8_t id = constrain(atoi(value), 0, display.getLayoutCount() - 1); config.saveValueButWait(&config.store.layoutId, id, 5000); display.applyLayout(id); netserver.requestOnChange(GETACTIVE, 0); return true; }
142142
if (cmdIs(command, "theme")) { uint8_t id = constrain(atoi(value), 0, display.getThemeCount() - 1); config.saveValueButWait(&config.store.themeId, id, 5000); display.applyTheme(id); return true; }
143143
if (cmdIs(command, "numplaylist")) { config.saveValueButWait(&config.store.numplaylist, static_cast<bool>(atoi(value)), 5000); display.putRequest(NEWMODE, CLEAR); display.putRequest(NEWMODE, PLAYER); return true; }
144144
if (cmdIs(command, "clock12")) { config.saveValueButWait(&config.store.clock12, static_cast<bool>(atoi(value)), 5000); display.putRequest(CLOCK); return true; }

src/core/display.cpp

Lines changed: 284 additions & 140 deletions
Large diffs are not rendered by default.

src/core/display.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ class Display {
9191
void _applyState();
9292
void _showDialog(const char *title);
9393
void _setReturnTicker(uint8_t time_s);
94+
/* Widget visibility = runtime state AND active layout, decided in one place. */
95+
bool _clockHidden();
96+
bool _weatherHidden();
9497
void _swichMode(displayMode_e newmode);
9598
void _updateBattery();
9699
void _updateVolume();

src/core/netserver.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,11 @@ void NetServer::processQueue() {
534534
act += F("\"group_oled\",");
535535
#endif
536536
#if (I2S_BCLK!=255 || (VS1053_CS != 255 && VS_PATCH_ENABLE == true) || DBGWUI)
537-
if (vuConf_ptr->textsize > 0 || DBGWUI) act += F("\"group_vu\",");
537+
if (vuConf_ptr->textsize > 0 || DBGWUI) act += F("\"group_vu\",");
538+
else act += F("\"hide_group_vu\",");
538539
#endif
539540
if (bufferbarConf_ptr->height > 0 || DBGWUI) act += F("\"group_buffer\",");
541+
else act += F("\"hide_group_buffer\",");
540542
if (BRIGHTNESS_PIN != 255 || DBGWUI) act += F("\"group_brightness\",");
541543
if (DSP_DIMMING_ENABLED || DBGWUI) act += F("\"group_dimming\",");
542544
if (DSP_CAN_FLIPPED || DBGWUI) act += F("\"group_tft\",");
@@ -552,6 +554,7 @@ void NetServer::processQueue() {
552554
if (DSP_MODEL == DSP_NOKIA5110 || DBGWUI) act += F("\"group_nokia\",");
553555
act += F("\"group_locale\",");
554556
if (weatherConf_ptr->buffsize > 0 || DBGWUI) act += F("\"group_weather\",");
557+
else act += F("\"hide_group_weather\",");
555558
act += F("\"group_controls\",");
556559
if (BTN_UP != 255 || BTN_DOWN != 255 || DBGWUI) act += F("\"group_volbuttons\",");
557560
if ((DSP_MODEL != DSP_DUMMY && (BTN_NEXT != 255 || BTN_PREV != 255)) || DBGWUI)

src/core/options.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,8 @@ Use this tool to setup connections:
208208
#ifndef DSP_INVERT_QUIRK
209209
#define DSP_INVERT_QUIRK false // if a display shows inverted colors by default, override it by setting this to true
210210
#endif
211-
#ifndef RSSI_DIGIT
212-
#define RSSI_DIGIT false // display RSSI as number
213-
#endif
211+
/* RSSI_DIGIT used to be a per-model macro here ("display RSSI as number"). It is a per-layout
212+
boolean now (LayoutData.rssiDigit), so a stale #define is no longer read. */
214213
#ifndef RSSI_STEPS
215214
#define RSSI_STEPS -50,-60,-70,-80
216215
#endif

src/displays/conf/displayLCD16x2conf.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
#define TFT_FRAMEWDT 0
99
#define MAX_WIDTH 16
1010
#define PLMITEMS 2
11-
#define META_MOVE
11+
/* Dialog placement for the meta line. Display::_showDialog() calls _meta->moveTo(LCD_META_MOVE),
12+
which re-lays the line at the origin with the full width so a centred dialog title has room;
13+
moveBack() restores it. The braces make this a single macro argument - never use it after a
14+
comma in a call. */
15+
#define LCD_META_MOVE { 0, 0, MAX_WIDTH }
1216
#define BOOTLOGOTOP 0
1317

1418
const BootData _bootConfig PROGMEM = {

src/displays/conf/displayLCD20x4conf.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
#define TFT_FRAMEWDT 0
99
#define MAX_WIDTH 20
1010
#define PLMITEMS 4
11-
#define META_MOVE
11+
/* Dialog placement for the meta line. Display::_showDialog() calls _meta->moveTo(LCD_META_MOVE),
12+
which re-lays the line at the origin with the full width so a centred dialog title has room;
13+
moveBack() restores it. The braces make this a single macro argument - never use it after a
14+
comma in a call. */
15+
#define LCD_META_MOVE { 0, 0, MAX_WIDTH }
1216
#define BOOTLOGOTOP 0
1317

1418
const BootData _bootConfig PROGMEM = {

src/displays/conf/displayOLED128x64conf.h

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
#define TFT_FRAMEWDT 1
99
#define MAX_WIDTH DSP_WIDTH-TFT_FRAMEWDT*2
1010
#define BOOTLOGOTOP 8
11-
#define IP_WEATHER_SHARED true // these widgets share the same space
12-
#define RSSI_BATT_SHARED true // these widgets share the same space
1311

1412
#if CLOCKFONT == YO_MONO
1513
#define FONTSHIFT 0
@@ -34,6 +32,7 @@ const BootData _bootConfig PROGMEM = {
3432
const char _layoutNames[][64] PROGMEM = {
3533
"Default",
3634
"Default (no VU)",
35+
"Big VU",
3736
};
3837

3938
/* LAYOUT DEFINITIONS */
@@ -72,11 +71,11 @@ const LayoutData _layouts[] PROGMEM = {
7271
.clockMove = { TFT_FRAMEWDT+(44/2)+2, 38+FONTSHIFT, 0 },
7372
.weatherMove = { 0, 0, -1 },
7473
.weatherMoveVU = { 0, 0, -1 },
75-
/* Rotated so the bands run horizontally: ch = width*2+space = 15px tall and
76-
cw = height = 44px long, fitting the y=38..54 line beside the clock */
7774
.rotateVU = true,
75+
.shareWeatherIP = true, // IP and weather share the bottom row (both at top 55)
76+
.shareBattRSSI = true, // RSSI and battery share the same row (both at top 55)
7877
},
79-
{ // Default
78+
{ // Default (no VU)
8079
/* SCROLLS {{ left, top, fontsize, align }, buffsize, uppercase, width, scrolldelay, scrolldelta, scrolltime } */
8180
.metaConf = {{ TFT_FRAMEWDT, TFT_FRAMEWDT, 2, WA_LEFT }, 140, true, MAX_WIDTH, SCROLLDELAY, 2, SCROLLTIME*7/4 },
8281
.title1Conf = {{ TFT_FRAMEWDT, 19, 1, WA_LEFT }, 140, true, MAX_WIDTH-6*4, SCROLLDELAY, 1, SCROLLTIME },
@@ -111,6 +110,43 @@ const LayoutData _layouts[] PROGMEM = {
111110
/* Rotated so the bands run horizontally: ch = width*2+space = 15px tall and
112111
cw = height = 44px long, fitting the y=38..54 line beside the clock */
113112
.rotateVU = true,
113+
.shareWeatherIP = true, // IP and weather share the bottom row (both at top 55)
114+
.shareBattRSSI = true, // RSSI and battery share the same row (both at top 55)
115+
},
116+
{ // Big VU
117+
/* SCROLLS {{ left, top, fontsize, align }, buffsize, uppercase, width, scrolldelay, scrolldelta, scrolltime } */
118+
.metaConf = {{ TFT_FRAMEWDT, TFT_FRAMEWDT, 2, WA_LEFT }, 140, true, MAX_WIDTH, SCROLLDELAY, 2, SCROLLTIME*7/4 },
119+
.title1Conf = {{ TFT_FRAMEWDT, 19, 1, WA_LEFT }, 140, true, MAX_WIDTH-6*4, SCROLLDELAY, 1, SCROLLTIME },
120+
.title2Conf = {{ TFT_FRAMEWDT, 28, 1, WA_LEFT }, 140, true, MAX_WIDTH, SCROLLDELAY, 1, SCROLLTIME },
121+
.playlistConf = {{ TFT_FRAMEWDT, 30, 1, WA_LEFT }, 140, true, MAX_WIDTH, SCROLLDELAY/5, 1, SCROLLTIME },
122+
.weatherConf = {{ TFT_FRAMEWDT, 64-9, 1, WA_LEFT }, 140, true, MAX_WIDTH-6*4, 0, 1, SCROLLTIME },
123+
/* BACKGROUNDS {{ left, top, fontsize, align }, width, height, outlined } */
124+
.metaBGConf = { },
125+
.metaBGConfInv = {{ 0, 0, 0, WA_LEFT }, DSP_WIDTH, 17, false },
126+
.volbarConf = {{ 0, 64-1, 0, WA_LEFT }, DSP_WIDTH, 1, false },
127+
.playlBGConf = {{ 0, 26, 0, WA_LEFT }, DSP_WIDTH, 12, false },
128+
.bufferbarConf = { }, // unused
129+
/* WIDGETS { left, top, fontsize, align } */
130+
.bitrateConf = { 0, 19, 1, WA_RIGHT },
131+
.voltxtConf = { }, // unused
132+
.batteryConf = { 0, 64-9, 1, WA_RIGHT },
133+
.iptxtConf = { TFT_FRAMEWDT, 64-9, 1, WA_LEFT },
134+
.rssiConf = { 0, 64-9, 1, WA_RIGHT },
135+
.numConf = { 0, 28+FONTSHIFT, 0, WA_CENTER },
136+
//.clockConf = { TFT_FRAMEWDT, 38+FONTSHIFT, 0, WA_CENTER },
137+
.clockConf = { TFT_FRAMEWDT, 38+FONTSHIFT, 0, WA_CENTER },
138+
.vuConf = { TFT_FRAMEWDT, 38, 1, WA_LEFT },
139+
/* CODEC BADGE {{ left, top, fontsize, align }, dimension} - if empty, bitrateConf will be used instead */
140+
.fullbitrateConf = { }, // unused
141+
/* BANDS { onebandwidth, onebandheight, bandsHspace, bandsVspace, numofbands } */
142+
.bandsConf = { 7, MAX_WIDTH-(TFT_FRAMEWDT*2), 1, 1, 10 },
143+
/* MOVES { left, top, width (-1 keeps Conf position) */
144+
.clockMove = { }, // clock disappears when VU is on
145+
.weatherMove = { 0, 0, -1 },
146+
.weatherMoveVU = { 0, 0, -1 },
147+
.rotateVU = true,
148+
.shareWeatherIP = true, // IP and weather share the bottom row (both at top 55)
149+
.shareBattRSSI = true, // RSSI and battery share the same row (both at top 55)
114150
},
115151
};
116152

src/displays/conf/displayTFT160x128conf.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#define TFT_FRAMEWDT 4
99
#define MAX_WIDTH DSP_WIDTH-TFT_FRAMEWDT*2
1010
#define BOOTLOGOTOP 16
11-
#define RSSI_BATT_SHARED true // these widgets share the same space
1211

1312
const BootData _bootConfig PROGMEM = {
1413
/* SCROLLS {{ left, top, fontsize, align }, buffsize, uppercase, width, scrolldelay, scrolldelta, scrolltime } */
@@ -62,6 +61,9 @@ const LayoutData _layouts[] PROGMEM = {
6261
.clockMove = { 14, 98, 0},
6362
.weatherMove = {TFT_FRAMEWDT, 48, MAX_WIDTH},
6463
.weatherMoveVU = { 34, 48, MAX_WIDTH-34+TFT_FRAMEWDT },
64+
/* batteryConf, iptxtConf and rssiConf are all on top 108, so RSSI and battery share a
65+
row and are drawn alternately rather than over each other. */
66+
.shareBattRSSI = true,
6567
},
6668
};
6769

0 commit comments

Comments
 (0)