smarthome
smarthome copied to clipboard
Possibility to remove icon / label from webview completely
In addition to this PR: https://github.com/eclipse/smarthome/pull/6046 - it would be nice to have the opportunity to remove the icon/label completely, if you wish to.
You can set the icon to none and never define a label - but then theres this ugly unused space above the webview.
+1
more details here: https://community.openhab.org/t/oh-2-4-0-m7-testing-results/58475/72
+1
this change bothered me too
+1
+1
+1 This change just screwed up the whole screen (everything did fit on the display before, now I've to scroll...)
Maybe it would be possible to add an additional option for the Webview widget that allows one to turn off the additional line/icon for those webviews where one does not want the line?
Just as an idea, maybe a Webview along the lines of
Webview icon="none" url="https://www.google.com/" height=15
could work, with the understanding that the special icon "none" means that one does not want the icon and extra line? Alternatively one could also use an empty icon (""), but that may already be interpreted as the default "webview" icon.
I haven't fully looked into the code, but it seems to me the change has to be made in the WebviewRenderer
.
Probably an override of the preprocessSnippet()
or getSnippet()
method from AbstractWidgetRenderer
in the package org.eclipse.smarthome.ui.basic.internal.render
Please correct me if I'm wrong, I just started looking into this project.
It seems a simple change but I don't have the time to setup, edit and test the project locally. But maybe this saves a fellow dev 5 precious minutes.
+1
Please make the label for the webview optional. This empty row is such a PITA and blows up the layout - especially if you are heavily using webviews for displaying graphs, weather information or whatever on a single page which is of course not an edge case.
If you serve the iframe's content from the same IP as your openHAB, you can put this JavaScript snippet to your iframe as a workaround. It will hide all labels from your webviews.
window.addEventListener('load', function() {
var lastRowWithLabel;
for (let row of window.parent.document.getElementsByClassName("mdl-form__row")) {
if (row.getElementsByClassName("mdl-form__label").length) {
lastRowWithLabel = row;
}
if (row.getElementsByTagName("iframe").length) {
lastRowWithLabel.style.display = "none";
}
}
});
+1
+1
+1
+1
+1
+1