Revision: 4440 http://vexi.svn.sourceforge.net/vexi/?rev=4440&view=rev Author: clrg Date: 2012-10-02 23:00:29 +0000 (Tue, 02 Oct 2012) Log Message: ----------- Clean up of lib.role.surface - theme/icon setup is not done per-surface; make static
Modified Paths: -------------- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/role/surface.t Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/role/surface.t =================================================================== --- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/role/surface.t 2012-10-02 15:38:27 UTC (rev 4439) +++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/role/surface.t 2012-10-02 23:00:29 UTC (rev 4440) @@ -1,4 +1,4 @@ -<!-- Copyright 2009 - see COPYING for details [LGPL] --> +<!-- Copyright 2012 - see COPYING for details [LGPL] --> <vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="vexi"> <meta:doc> @@ -8,10 +8,6 @@ <ui:box> - // stops warnings about an undeclared property - thisbox.theme; - thisbox.icons; - // the surface object and key components var s = {}; @@ -82,33 +78,11 @@ // special case Focused, forward only thisbox.Focused ++= function(v) { cascade = v; frame.Focused = v; } - /* - * THEME HANDLING - */ - - if (theme == null) { - // no theme has been specified - theme = static.theme; - } - // set up theme redirect - .theme ++= theme; - - if (icons == null) { - // no icons have been specified - icons = static.icon; - } - if (icons) { - // icons specified, set up icons redirect - .icon ++= icons; - } - - // apply the theme surface template - .theme.surface(thisbox); - </ui:box> + <theme.surface /> /** access to the theme parameter setting */ - static.theme ++= function() { + const getTheme = function() { var themestr = vexi.params["vexi.theme"]; var themeres = null; if (themestr != null) { @@ -132,7 +106,7 @@ } /** access to the icon parameter setting */ - static.icon ++= function() { + const getIcons = function() { var iconstr = vexi.params["vexi.icon"]; var iconres = null; if (iconstr != null) { @@ -155,4 +129,28 @@ return ret; } + /* + * THEME HANDLING + */ + + try { + var theme = getTheme(); + // theme specified + .theme ++= theme; + } catch(e) { + vexi.trace("Unable to establish theme, most widgets will not work"); + vexi.trace(e); + } + + try { + var icons = getIcons(); + // icons specified + if (icons) { + .icon ++= icons; + } + } catch(e) { + vexi.trace("Unable to establish icons"); + vexi.trace(e); + } + </vexi> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn