From e22255fbbbd0778eda9d71d4b75919eea35c816c Mon Sep 17 00:00:00 2001 From: Marc Englund Date: Wed, 11 Jun 2008 08:39:57 +0000 Subject: [PATCH] Window (caption) can have icon (fixes #1761) svn changeset:4855/svn branch:trunk --- WebContent/ITMILL/themes/default/styles.css | 5 +++++ WebContent/ITMILL/themes/default/window/window.css | 5 +++++ .../toolkit/terminal/gwt/client/ui/IWindow.java | 14 ++++++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/WebContent/ITMILL/themes/default/styles.css b/WebContent/ITMILL/themes/default/styles.css index 60616baa76..85397ac5a6 100644 --- a/WebContent/ITMILL/themes/default/styles.css +++ b/WebContent/ITMILL/themes/default/styles.css @@ -1854,6 +1854,11 @@ input.i-modified, overflow:hidden; } +.i-window-header .i-icon { + vertical-align: bottom; +} + + .i-window-outerheader:before { display: block; content: ""; diff --git a/WebContent/ITMILL/themes/default/window/window.css b/WebContent/ITMILL/themes/default/window/window.css index 25d2ae3bf6..8ca85ac727 100644 --- a/WebContent/ITMILL/themes/default/window/window.css +++ b/WebContent/ITMILL/themes/default/window/window.css @@ -42,6 +42,11 @@ overflow:hidden; } +.i-window-header .i-icon { + vertical-align: bottom; +} + + .i-window-outerheader:before { display: block; content: ""; diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java index 1df4f0f683..420719d5d1 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java @@ -253,7 +253,8 @@ public class IWindow extends PopupPanel implements Paintable, ScrollListener { } if (uidl.hasAttribute("caption")) { - setCaption(uidl.getStringAttribute("caption")); + setCaption(uidl.getStringAttribute("caption"), uidl + .getStringAttribute("icon")); } boolean showingUrl = false; @@ -472,7 +473,16 @@ public class IWindow extends PopupPanel implements Paintable, ScrollListener { } public void setCaption(String c) { - DOM.setInnerText(headerText, c); + setCaption(c, null); + } + + public void setCaption(String c, String icon) { + String html = c; + if (icon != null) { + icon = client.translateToolkitUri(icon); + html = "" + html; + } + DOM.setInnerHTML(headerText, html); } protected Element getContainerElement() { -- 2.39.5