From edbbd753f79d2fda15fef5c72ab31388676d9a1e Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Wed, 19 Dec 2007 11:54:57 +0000 Subject: [PATCH] fixes #1238 svn changeset:3268/svn branch:trunk --- .../gwt/client/ApplicationConnection.java | 4 ++++ .../terminal/gwt/client/ui/ICustomLayout.java | 22 +++++-------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java b/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java index bfc55cc196..67f80dae77 100755 --- a/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java @@ -654,4 +654,8 @@ public class ApplicationConnection { } return toolkitUri; } + + public String getTheme() { + return view.getTheme(); + } } diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java index c3aa2d45b9..b96c99dfad 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java @@ -181,24 +181,14 @@ public class ICustomLayout extends ComplexPanel implements Paintable, locationToElement.clear(); scanForLocations(getElement()); - // Remap image srcs in layout - Widget parent = getParent(); - while (parent != null && !(parent instanceof IView)) { - parent = parent.getParent(); - } - if (parent != null && ((IView) parent).getTheme() != null) { - String prefix; - if (uriEndsWithSlash()) { - prefix = "../ITMILL/themes/"; - } else { - prefix = "ITMILL/themes/"; - } - prefixImgSrcs(getElement(), prefix + ((IView) parent).getTheme() - + "/layouts/"); + String themeName = client.getTheme(); + String prefix; + if (uriEndsWithSlash()) { + prefix = "../ITMILL/themes/"; } else { - throw (new IllegalStateException( - "Could not find IView; maybe updateFromUIDL() was called before attaching the widget?")); + prefix = "ITMILL/themes/"; } + prefixImgSrcs(getElement(), prefix + themeName + "/layouts/"); publishResizedFunction(DOM.getFirstChild(getElement())); -- 2.39.5