TW5: Theme Tweaks by Palette

186 views
Skip to first unread message

Tahoka Freeway

unread,
Sep 29, 2018, 8:25:51 AM9/29/18
to TiddlyWiki
I'm using a couple of TW's with Vanilla palette where I sometimes have to present on a TV or projector to a group.

When I do so, the text is too small to be readable to most.  So I manually adjust the font sizes in Theme Tweaks and all is good.

Is there a way to switch the font sizes over just like switching between palettes so I can quickly change from laptop mode to presentation mode?

Thx.

TonyM

unread,
Sep 30, 2018, 1:01:12 AM9/30/18
to TiddlyWiki
Tahoka,

In control panel, where you set these values. You are updating values thar are stored in tiddlers and or fields so you just need to find them and create a button (or two) to toggle the values with multiple action widgets to set the values. Im on my mobile so cant look these up or build it, but you could look around my site at tiddlywiki.psat.com.au to find my tool in the sidebar to display recent temp or config tiddlers and when you make a change they should appear in the list.

Alternativly you could export all the tiddlers related to each "mode" and tge prefered values in a single json file and import them to change modes.

Regards
Tony

JD

unread,
Sep 30, 2018, 1:48:43 AM9/30/18
to TiddlyWiki
Hello,

I have a tiddler that handles body font-sizing... Maybe something like this can make it easier for you to switch font-sizes, too:

Title: 
$:/jd/Buttons/font-size

List:
40px 34px 30px 24px 20px 18px 17px 15px 14px 13px 12px 10px

Tags:
$:/tags/PageControls

Text:
<$wikify name="fontUp" text="""
<$list filter="[{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize}previous[$:/jd/Buttons/font-size]]" emptyMessage="40px"/>
""">
<$wikify name="fontDown" text="""
<$list filter="[{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize}next[$:/jd/Buttons/font-size]]" emptyMessage="10px"/>
""">
<$button class="tc-btn-invisible" tooltip="Decrease font size">
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize" text=<<fontDown>>/>
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/bodylineheight" text="1.2"/>
&#8722;
</$button>
<$button class="tc-btn-invisible" tooltip="Increase font size">
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize" text=<<fontUp>>/>
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/bodylineheight" text="1.2"/>
&#43;
</$button>
</$wikify>
</$wikify>
 
I used <$wikify> because I need the "emptyMessage" parameter, the list field contains font sizes the buttons will scroll through, and I tagged the tiddler where I wanted it go.

Hope this helps :)

-jd

Mohammad

unread,
Sep 30, 2018, 4:54:37 AM9/30/18
to TiddlyWiki

Tahoka Freeway

unread,
Sep 30, 2018, 2:22:16 PM9/30/18
to TiddlyWiki


Thank you Tony and Mohammad for the ideas.

JD, your solution works very well for my application and allows me to adjust font size as needed during the presentation without having to switch back to Control Panel. 

Mohammad

unread,
Oct 1, 2018, 12:04:41 AM10/1/18
to TiddlyWiki
This also an alternative with a reset button and select widget to choose the font from a drop down list.
It uses the new range operator in TW 5.1.18pre. You name the tiddler whatever you want and if need to have it on the sidebar tag with $:/tags/PageControls as JD explained above.

Cheers
Mohammad
\define set-lineheight()
<$list filter="[range[18,24]addsuffix[px]after{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize!!text}]" variable="font-size">
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/bodylineheight" text="26px"/>
</$list>
<$list filter="[range[10,18]addsuffix[px]after{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize!!text}]" variable="font-size">
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/bodylineheight" text="22px"/>
</$list>
\end


''Font size:''
<$select tiddler='$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize' defualt="15px"
actions=<<set-lineheight>> >
<$list filter="[range[10,24]addsuffix[px]]" variable="font-size">
<option value=<<font-size>>><<font-size>></option>
</$list>
</$select>
<$button>Reset
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize" text="15px"/>
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/bodylineheight" text="22px"/>
</$button>


Reply all
Reply to author
Forward
0 new messages