mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-06 12:16:11 +00:00
fix: adaptive layout for e-ink landscape across all remaining screens
- GxEPDDisplay: sz2 uses 4× scale on landscape (clock 32px vs body 16px) - UITask: clock date_y and splash date_y computed from lh2 after setTextSize(2) - UITask: battery/mute/BT/advert indicators scale with lh; muted uses text 'M' - UITask: hibernate hint split into two lines to prevent wrapping - ToolsScreen: full refactor — headerH, listStart, lineStep, getCharWidth - KeyboardWidget: all cell sizes computed from display metrics (cell_w, cell_h, spec_w) - RingtoneEditorScreen: cell_w = charWidth×2+6 (was hardcoded 18) - SettingsScreen: BRIGHTNESS hidden on e-ink; renderBar boxes scale with lh Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
f8fb1dac99
commit
1d8ca25469
@@ -8,7 +8,9 @@ class SettingsScreen : public UIScreen {
|
||||
enum SettingItem {
|
||||
// Display section
|
||||
SECTION_DISPLAY,
|
||||
#if !defined(EINK_DISPLAY_MODEL)
|
||||
BRIGHTNESS,
|
||||
#endif
|
||||
AUTO_OFF,
|
||||
AUTO_LOCK,
|
||||
BATT_DISPLAY,
|
||||
@@ -85,7 +87,9 @@ class SettingsScreen : public UIScreen {
|
||||
}
|
||||
|
||||
void renderBar(DisplayDriver& display, int x, int y, int value, int max_val) {
|
||||
const int box_w = 7, box_h = 7, gap = 2;
|
||||
const int box_h = display.getLineHeight() - 2;
|
||||
const int box_w = box_h;
|
||||
const int gap = 2;
|
||||
for (int i = 0; i < max_val; i++) {
|
||||
int bx = x + i * (box_w + gap);
|
||||
display.drawRect(bx, y, box_w, box_h);
|
||||
@@ -236,10 +240,13 @@ class SettingsScreen : public UIScreen {
|
||||
display.print(sel ? ">" : " ");
|
||||
display.setCursor(display.getCharWidth() + 2, y);
|
||||
|
||||
#if !defined(EINK_DISPLAY_MODEL)
|
||||
if (item == BRIGHTNESS) {
|
||||
display.print("Bright");
|
||||
renderBar(display, display.valCol(), y, (p ? p->display_brightness : 2) + 1, 5);
|
||||
} else if (item == BUZZER) {
|
||||
} else
|
||||
#endif
|
||||
if (item == BUZZER) {
|
||||
display.print("Buzzer");
|
||||
display.setCursor(display.valCol(), y);
|
||||
#ifdef PIN_BUZZER
|
||||
@@ -357,7 +364,7 @@ class SettingsScreen : public UIScreen {
|
||||
|
||||
public:
|
||||
SettingsScreen(UITask* task)
|
||||
: _task(task), _selected(BRIGHTNESS), _scroll(0), _visible(4), _dirty(false), _edit_slot(-1) {}
|
||||
: _task(task), _selected(AUTO_OFF), _scroll(0), _visible(4), _dirty(false), _edit_slot(-1) {}
|
||||
|
||||
|
||||
void markClean() { _dirty = false; }
|
||||
@@ -441,12 +448,14 @@ public:
|
||||
bool left = (c == KEY_LEFT || c == KEY_PREV);
|
||||
bool enter = (c == KEY_ENTER);
|
||||
|
||||
#if !defined(EINK_DISPLAY_MODEL)
|
||||
if (_selected == BRIGHTNESS) {
|
||||
uint8_t lvl = _task->getBrightnessLevel();
|
||||
if (right && lvl < 4) { _task->setBrightnessLevel(lvl + 1); _dirty = true; return true; }
|
||||
if (left && lvl > 0) { _task->setBrightnessLevel(lvl - 1); _dirty = true; return true; }
|
||||
return right || left;
|
||||
}
|
||||
#endif
|
||||
if (_selected == BUZZER && (left || right || enter)) {
|
||||
_task->cycleBuzzerMode();
|
||||
_dirty = true;
|
||||
|
||||
Reference in New Issue
Block a user