mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 19:56:30 +00:00
LVGL Mirroring add checkbox to enable/disable the feature (#23047)
This commit is contained in:
parent
b8459eb685
commit
1db796c40f
@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- LVGL, prepare for HASPmota theme, change: no-grow when clicked, DPI set to 160
|
- LVGL, prepare for HASPmota theme, change: no-grow when clicked, DPI set to 160
|
||||||
|
- LVGL Mirroring add checkbox to enable/disable the feature (in the iterim for a better solution)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
@ -1018,8 +1018,13 @@ class lvgl_panel
|
|||||||
'<tbody>'
|
'<tbody>'
|
||||||
'<tr>'
|
'<tr>'
|
||||||
'<td>'
|
'<td>'
|
||||||
'<fieldset style="background-color:{tasmota.webcolor(1)};"><legend style="text-align:left;"> LVGL screen mirroring </legend>'
|
'<fieldset style="background-color:{tasmota.webcolor(1)};">'
|
||||||
'<iframe id="lvgl_iframe" src="http://{ip}:{self.port}/lvgl" '
|
'<legend style="text-align:left;">'
|
||||||
|
'<label>'
|
||||||
|
'<input type="checkbox" id="lvchk"> LVGL screen mirroring '
|
||||||
|
'</label>'
|
||||||
|
'</legend>'
|
||||||
|
'<iframe id="lvgl_iframe" src="about:blank" hidden="true"'
|
||||||
'style="color:#eaeaea; border:0px none;height:{height}px;width:{width}px;margin:0px 8px 0px 8px;padding:0px 0px;">'
|
'style="color:#eaeaea; border:0px none;height:{height}px;width:{width}px;margin:0px 8px 0px 8px;padding:0px 0px;">'
|
||||||
'</iframe>'
|
'</iframe>'
|
||||||
'</fieldset>'
|
'</fieldset>'
|
||||||
@ -1027,6 +1032,30 @@ class lvgl_panel
|
|||||||
'</tr>'
|
'</tr>'
|
||||||
'</tbody>'
|
'</tbody>'
|
||||||
'</table>'
|
'</table>'
|
||||||
|
'<script>'
|
||||||
|
'const lvuri="http://{ip}:{self.port}/lvgl";'
|
||||||
|
'</script>'
|
||||||
|
)
|
||||||
|
webserver.content_send(
|
||||||
|
'<script>'
|
||||||
|
'function lvg(){'
|
||||||
|
'lvchk=eb("lvchk");'
|
||||||
|
# checkbox event
|
||||||
|
'lvchk.addEventListener("change",(event)=>{'
|
||||||
|
'const iframe=document.getElementById("lvgl_iframe");'
|
||||||
|
'if(lvchk.checked){'
|
||||||
|
# When checked, reload the original content
|
||||||
|
'iframe.src=lvuri;'
|
||||||
|
'iframe.hidden=false;'
|
||||||
|
'}else{'
|
||||||
|
# When unchecked, replace iframe with itself to unload it
|
||||||
|
'iframe.src="about:blank";'
|
||||||
|
'iframe.hidden=true;'
|
||||||
|
'}'
|
||||||
|
'});'
|
||||||
|
'}'
|
||||||
|
'wl(lvg);'
|
||||||
|
'</script>'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user