diff --git a/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/ChartRenderer.java b/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/ChartRenderer.java index 44b59ed30f..f1e51da4f3 100644 --- a/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/ChartRenderer.java +++ b/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/ChartRenderer.java @@ -127,6 +127,12 @@ public EList renderWidget(Widget w, StringBuilder sb, String sitemap) th } String snippet = getSnippet("chart"); + + boolean showHeaderRow = chart.getLabel() != null; + snippet = snippet.replace("%header_visibility_class%", + showHeaderRow ? "%visibility_class%" : "mdl-form__row--hidden"); + snippet = snippet.replace("%header_row%", Boolean.valueOf(showHeaderRow).toString()); + snippet = preprocessSnippet(snippet, w, true); // Process the color tags diff --git a/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/ImageRenderer.java b/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/ImageRenderer.java index 51d6e9d4f9..462efdbfc6 100644 --- a/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/ImageRenderer.java +++ b/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/ImageRenderer.java @@ -61,6 +61,11 @@ public EList renderWidget(Widget w, StringBuilder sb, String sitemap) th Image image = (Image) w; String snippet = (image.getChildren().size() > 0) ? getSnippet("image_link") : getSnippet("image"); + boolean showHeaderRow = image.getLabel() != null; + snippet = snippet.replace("%header_visibility_class%", + showHeaderRow ? "%visibility_class%" : "mdl-form__row--hidden"); + snippet = snippet.replace("%header_row%", Boolean.valueOf(showHeaderRow).toString()); + if (image.getRefresh() > 0) { snippet = snippet.replace("%update_interval%", Integer.toString(image.getRefresh())); } else { diff --git a/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/MapviewRenderer.java b/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/MapviewRenderer.java index 13c96c14ee..707bd54820 100644 --- a/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/MapviewRenderer.java +++ b/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/MapviewRenderer.java @@ -58,7 +58,7 @@ public EList renderWidget(Widget w, StringBuilder sb, String sitemap) th Mapview mapview = (Mapview) w; String snippet = getSnippet("mapview"); - boolean showHeaderRow = !getLabel(w).isEmpty(); + boolean showHeaderRow = w.getLabel() != null; snippet = snippet.replace("%header_visibility_class%", showHeaderRow ? "%visibility_class%" : "mdl-form__row--hidden"); snippet = snippet.replace("%header_row%", Boolean.valueOf(showHeaderRow).toString()); diff --git a/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/VideoRenderer.java b/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/VideoRenderer.java index 58739d4319..4a19b2fd40 100644 --- a/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/VideoRenderer.java +++ b/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/VideoRenderer.java @@ -67,7 +67,7 @@ public EList renderWidget(Widget w, StringBuilder sb, String sitemap) th snippet = getSnippet(snippetName); - boolean showHeaderRow = !getLabel(w).isEmpty(); + boolean showHeaderRow = w.getLabel() != null; snippet = snippet.replace("%header_visibility_class%", showHeaderRow ? "%visibility_class%" : "mdl-form__row--hidden"); snippet = snippet.replace("%header_row%", Boolean.valueOf(showHeaderRow).toString()); diff --git a/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/WebviewRenderer.java b/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/WebviewRenderer.java index c24dfb3bad..1eedb5a965 100644 --- a/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/WebviewRenderer.java +++ b/bundles/org.openhab.ui.basic/src/main/java/org/openhab/ui/basic/internal/render/WebviewRenderer.java @@ -53,7 +53,7 @@ public EList renderWidget(Widget w, StringBuilder sb, String sitemap) th Webview webview = (Webview) w; String snippet = getSnippet("webview"); - boolean showHeaderRow = !getLabel(w).isEmpty(); + boolean showHeaderRow = w.getLabel() != null; snippet = snippet.replace("%header_visibility_class%", showHeaderRow ? "%visibility_class%" : "mdl-form__row--hidden"); snippet = snippet.replace("%header_row%", Boolean.valueOf(showHeaderRow).toString()); diff --git a/bundles/org.openhab.ui.basic/src/main/resources/snippets/chart.html b/bundles/org.openhab.ui.basic/src/main/resources/snippets/chart.html index 063fb7e82b..f00aca62ad 100644 --- a/bundles/org.openhab.ui.basic/src/main/resources/snippets/chart.html +++ b/bundles/org.openhab.ui.basic/src/main/resources/snippets/chart.html @@ -1,4 +1,4 @@ -
+
%icon_snippet% @@ -33,7 +33,7 @@ Refresh chart
-
+