diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 34944ae6b..e3f00ab94 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -8,6 +8,7 @@ title: $:/core/macros/sidebar-resizer \function is.in.value(value) [removesuffix[in]] \function is.pc.value(value) [removesuffix[pc]] \function is.pt.value(value) [removesuffix[pt]] +\function is.em.value(value) [removesuffix[em]] \function convert.to.percentage(value) [dividemultiply[100]] \function convert.to.cm(value) [divide[37.8]] @@ -16,6 +17,7 @@ title: $:/core/macros/sidebar-resizer \function convert.to.in(value) [divide[96]] \function convert.to.pc(value) [convert.to.inmultiply[6]] \function convert.to.pt(value) [convert.to.inmultiply[72]] +\function convert.to.em(value) [divide{$:/themes/tiddlywiki/vanilla/metrics/fontsize}] \function convert.to.percentage.value() [convert.to.percentage] \function convert.to.cm.value() [convert.to.cm] @@ -24,12 +26,13 @@ title: $:/core/macros/sidebar-resizer \function convert.to.in.value() [convert.to.in] \function convert.to.pc.value() [convert.to.pc] \function convert.to.pt.value() [convert.to.pt] +\function convert.to.em.value() [convert.to.em] -\function convert.to.pixels(value) [is.pixel.value] [is.percentage.valuemultiplydivide[100]] [is.cm.valuemultiply[37.8]] [is.mm.valuemultiply[37.8]divide[10]] [is.Q.valuemultiply[37.8]divide[40]] [is.in.valuemultiply[96]] [is.pc.valuemultiply[96]divide[6]] [is.pt.valuemultiply[96]divide[72]] +\function convert.to.pixels(value) [is.pixel.value] [is.percentage.valuemultiplydivide[100]] [is.cm.valuemultiply[37.8]] [is.mm.valuemultiply[37.8]divide[10]] [is.Q.valuemultiply[37.8]divide[40]] [is.in.valuemultiply[96]] [is.pc.valuemultiply[96]divide[6]] [is.pt.valuemultiply[96]divide[72]] [is.em.valuemultiply{$:/themes/tiddlywiki/vanilla/metrics/fontsize}] -\function convert.to.result(value,suffix) [match[px]then] [match[%]then] [match[cm]then] [match[mm]then] [match[Q]then] [match[in]then] [match[pc]then] [match[pt]then] +\function convert.to.result(value,suffix) [match[px]then] [match[%]then] [match[cm]then] [match[mm]then] [match[Q]then] [match[in]then] [match[pc]then] [match[pt]then] [match[em]then] -\function get.value.metric(value) [suffix[px]then[px]] ~[suffix[%]then[%]] ~[suffix[cm]then[cm]] ~[suffix[mm]then[mm]] ~[suffix[Q]then[Q]] ~[suffix[in]then[in]] ~[suffix[pc]then[pc]] ~[suffix[pt]then[pt]] +\function get.value.metric(value) [suffix[px]then[px]] ~[suffix[%]then[%]] ~[suffix[cm]then[cm]] ~[suffix[mm]then[mm]] ~[suffix[Q]then[Q]] ~[suffix[in]then[in]] ~[suffix[pc]then[pc]] ~[suffix[pt]then[pt]] ~[suffix[em]then[em]] \procedure sidebar-resizer-pointerdown-actions() <%if [[$:/state/sidebar/resizing]is[missing]thenmatch[left]] %> @@ -72,7 +75,7 @@ title: $:/core/macros/sidebar-resizer \procedure set-sidebarwidth-actions() <$let sidebarWidthMetric={{$:/state/sidebar/resizing!!sidebar-width-metric}} sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} storyLeftConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} storyMinWidthConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] }}} sidebarMaxWidth={{{ [subtractsubtract] }}}> <$vars sidebarWidthConverted={{{ [function[convert.to.result],,] }}} sidebarMaxWidthConverted={{{ [function[convert.to.result],,] }}} sidebarMinWidthConverted={{{ [function[convert.to.result],,] }}}> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [compare:number:gteqthenaddsuffix] [compare:number:ltthenaddsuffix] ~[addsuffix] }}}/> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [compare:number:gteqthenaddsuffix] ~[compare:number:ltthenaddsuffix] ~[addsuffix] }}}/> \end