Next/back button assignment moves from a frame-level "Button assignments" card into each widget's own gear-icon dialog, prefilled with a sane default at creation (photos/calendar -> advance/back, whiteboard/weather -> check_now, others -> none). At most one binding per (widget, button) now -- cross-widget execution order never mattered since each widget's action only touches its own state. New firmware capability: holding NEXT or BACK past a configurable duration (min 3s, server-side default) triggers a frame-wide action instead of the per-widget short-press one -- cycling saved layouts, refreshing all widgets, or freezing/unfreezing every photo widget (see app/global_actions.py). Firmware next/back checks gain the same hold-duration polling the combo button already had; the threshold comes from the previous wake's /frame/config fetch (persisted in NVS), since this wake's button decision happens before that request. Not done here: firmware/version.txt is intentionally left unbumped -- this hasn't been built or hardware-tested (no ESP-IDF toolchain in this environment), so no firmware release build should be triggered yet.
49 lines
2.0 KiB
HTML
49 lines
2.0 KiB
HTML
<h2 class="dialog-title">Static image widget</h2>
|
|
|
|
<section class="card">
|
|
<h2 class="card-title">Image</h2>
|
|
<p class="sub">Upload a PNG, JPEG, GIF, BMP, WEBP, TIFF, or PDF (first
|
|
page only) -- it's decoded once on upload and shown as-is until you
|
|
upload something else.</p>
|
|
<p class="sub" id="static-current-file">
|
|
{% if static_cfg and static_cfg.original_filename %}
|
|
Currently showing: <strong>{{ static_cfg.original_filename }}</strong>
|
|
{% else %}
|
|
No image uploaded yet.
|
|
{% endif %}
|
|
</p>
|
|
<input type="file" id="static-file" accept="image/*,application/pdf">
|
|
<button type="button" class="secondary" id="static-upload" style="margin-top: 8px;">Upload</button>
|
|
</section>
|
|
|
|
<section class="card" style="margin-top: 20px;">
|
|
<h2 class="card-title">Settings</h2>
|
|
<form id="static-config-form">
|
|
<label>Display mode
|
|
<select id="display_mode">
|
|
{% for mode, label in display_mode_labels.items() %}
|
|
<option value="{{ mode }}" {% if static_cfg and static_cfg.display_mode == mode %}selected{% endif %}>{{ label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</label>
|
|
<p class="sub" style="margin-top: 8px;">How the image's aspect ratio
|
|
is reconciled with this widget's box: <strong>Crop to fill</strong>
|
|
trims the excess; <strong>Stretch to fill</strong> fills the box
|
|
exactly without cropping (an image with a different aspect ratio
|
|
looks stretched); <strong>Shrink to fit</strong> shows the whole
|
|
image, letterboxed if needed.</p>
|
|
<button type="submit">Save</button>
|
|
</form>
|
|
</section>
|
|
|
|
{% include "_widget_border_fields.html" %}
|
|
|
|
{% include "_widget_button_fields.html" %}
|
|
|
|
<section class="card" style="margin-top: 20px;">
|
|
<h2 class="card-title">Preview</h2>
|
|
<p class="sub">How this widget currently renders.</p>
|
|
<img class="preview-img" id="static-preview" alt="Static image preview">
|
|
<button type="button" class="secondary" id="static-preview-refresh">Refresh now</button>
|
|
</section>
|