smarthome icon indicating copy to clipboard operation
smarthome copied to clipboard

Possibility to remove icon / label from webview completely

Open sparetimetherapist opened this issue 6 years ago • 15 comments

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.

sparetimetherapist avatar Dec 07 '18 01:12 sparetimetherapist

+1

more details here: https://community.openhab.org/t/oh-2-4-0-m7-testing-results/58475/72

AngelosF avatar Dec 07 '18 09:12 AngelosF

+1

this change bothered me too

illnesse avatar Dec 08 '18 13:12 illnesse

+1

FlSchauer avatar Dec 23 '18 11:12 FlSchauer

+1

ulbi avatar Dec 31 '18 08:12 ulbi

+1 This change just screwed up the whole screen (everything did fit on the display before, now I've to scroll...)

ulbi avatar Dec 31 '18 08:12 ulbi

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?

tobiasisenberg avatar Jan 02 '19 10:01 tobiasisenberg

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.

tobiasisenberg avatar Jan 02 '19 21:01 tobiasisenberg

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.

rdhaese avatar Jan 13 '19 11:01 rdhaese

+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";
        }
    }
});

dprokscha avatar May 04 '19 09:05 dprokscha

+1

bvdh82 avatar May 20 '19 11:05 bvdh82

+1

sttts avatar Jul 27 '19 12:07 sttts

+1

real-easy avatar Aug 26 '19 02:08 real-easy

+1

NutzerGitHub avatar Aug 31 '19 22:08 NutzerGitHub

+1

blackjack53 avatar Sep 24 '19 18:09 blackjack53

+1

tobsie avatar Oct 02 '19 12:10 tobsie