From 08f278624b1590b7949bb6e6ff59099bacdc9f0d Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Fri, 5 Jul 2013 08:53:09 +0100 Subject: [PATCH] Allow tag tiddlers to specify the title of an icon tiddler Demonstrated on the "done" tag --- core/ui/TagTemplate.tid | 2 +- editions/tw5.com/tiddlers/tags/done.tid | 1 + themes/tiddlywiki/snowwhite/base.tid | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/ui/TagTemplate.tid b/core/ui/TagTemplate.tid index b4db35a0f..d9d16adcb 100644 --- a/core/ui/TagTemplate.tid +++ b/core/ui/TagTemplate.tid @@ -1,6 +1,6 @@ title: $:/core/ui/TagTemplate -<$button popup="$:/state/tagpopup" qualifyTiddlerTitles="yes" class="btn-invisible"><$setstyle name="background-color" value={{!!color}} class="tw-tag-label"><$view field="title" format="text" /> +<$button popup="$:/state/tagpopup" qualifyTiddlerTitles="yes" class="btn-invisible"><$setstyle name="background-color" value={{!!color}} class="tw-tag-label"><$transclude target={{!!icon}}/> <$view field="title" format="text" /> <$reveal state="$:/state/tagpopup" type="popup" position="below" qualifyTiddlerTitles="yes" >
<$view field="title" format="link" /> ---- diff --git a/editions/tw5.com/tiddlers/tags/done.tid b/editions/tw5.com/tiddlers/tags/done.tid index 55827afcd..34edfebf1 100644 --- a/editions/tw5.com/tiddlers/tags/done.tid +++ b/editions/tw5.com/tiddlers/tags/done.tid @@ -1,4 +1,5 @@ color: #3ae745 modified: 201306131058 title: done +icon: $:/core/images/done-button diff --git a/themes/tiddlywiki/snowwhite/base.tid b/themes/tiddlywiki/snowwhite/base.tid index 205a83847..8e2bf4849 100644 --- a/themes/tiddlywiki/snowwhite/base.tid +++ b/themes/tiddlywiki/snowwhite/base.tid @@ -264,6 +264,12 @@ a.tw-tiddlylink-external { <> } +.tw-tag-label svg { + height: 1em; + width: 1em; + fill: #fff; +} + /* ** Page layout */ @@ -541,6 +547,7 @@ canvas.tw-edit-bitmapeditor { .tw-add-tag svg { height: 1em; + width: 1em; fill: #999; } @@ -591,6 +598,7 @@ canvas.tw-edit-bitmapeditor { .tw-edit-field-remove svg { height: 1em; + width: 1em; fill: #888; vertical-align: middle; }