Revision: 4835 http://sourceforge.net/p/vexi/code/4835 Author: clrg Date: 2015-12-09 15:57:13 +0000 (Wed, 09 Dec 2015) Log Message: ----------- Add 'styles' to links - a prototype for how things should be done - probably can be generalised in some cases
Modified Paths: -------------- branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/link.t Modified: branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/link.t =================================================================== --- branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/link.t 2015-12-04 10:33:41 UTC (rev 4834) +++ branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/link.t 2015-12-09 15:57:13 UTC (rev 4835) @@ -1,16 +1,11 @@ <!-- Copyright (c) - see COPYING for details [LGPL] --> <vexi xmlns:ui="vexi://ui" - xmlns:lang="vexi://lang" - xmlns:meta="vexi://meta" - xmlns="vexi.layout" - xmlns:role="org.vexi.lib.role" - xmlns:theme="vexi.theme" - xmlns:rdt="vexi.util.redirect"> - <meta:doc> - <author>Charles Goodwin</author> - <name>Link</name> - </meta:doc> + xmlns:lang="vexi://lang" + xmlns="vexi.layout" + xmlns:role="org.vexi.lib.role" + xmlns:theme="vexi.theme" + xmlns:rdt="vexi.util.redirect"> <role:clickable /> <role:focusable /> @@ -34,7 +29,13 @@ </pad> </theme:lib.focusborder> + $text.textcolor ++= function(v) { + cascade = v; + $hintline.fill = v; + $underline.fill = v; + } + thisbox.style = static.default_style; thisbox.th_focus = $focus; thisbox.v_linkbox = $link; thisbox.v_textbox = $text; @@ -107,23 +108,41 @@ return; } + static.default_style = { + textcolor : { + normal : "black", + disabled : "#666666", + hover : "blue", + active : "red" + }, +// fill : { +// normal : null, +// disabled : null, +// hover : null, +// active : null +// } + } + static.activeWrite = function(v) { - trapee.v_linkbox[0].textcolor = "red"; + const s = trapee.style.textcolor; + trapee.v_linkbox[0].textcolor = s.active; trapee.v_linkbox[2].display = true; - trapee.v_linkbox[2].fill = "red"; + trapee.v_linkbox[2].fill = s.active; return; } static.hoverWrite = function(v) { - trapee.v_linkbox[0].textcolor = "blue"; + const s = trapee.style.textcolor; + trapee.v_linkbox[0].textcolor = s.hover; trapee.v_linkbox[2].display = true; - trapee.v_linkbox[2].fill = "blue"; + trapee.v_linkbox[2].fill = s.hover; return; } static.normalWrite = function(v) { - trapee.v_linkbox[0].textcolor = trapee.enabled ? "black" : "#666666"; - trapee.v_linkbox[1].fill = trapee.enabled ? "black" : null; + const s = trapee.style.textcolor; + trapee.v_linkbox[0].textcolor = trapee.enabled ? s.normal : s.tdisabled; + trapee.v_linkbox[1].fill = trapee.enabled ? s.normal : null; trapee.v_linkbox[2].display = false; return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn