diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 892ea3243..67a690465 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -88,51 +88,51 @@ title: $:/core/macros/sidebar-resizer \end \procedure set-storyright-action(suffix) -<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffixcompare:number:ltthen] [addsuffixcompare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> +<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [subtractaddsuffixcompare:number:ltthenaddaddsuffix] [addsuffixcompare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> \end \procedure set-storyright-actions-percentage() -<$set name="storyRiverWidthConverted" value={{{ [multiply[100]divide] }}}> +<$let storyLeftStart={{{ [is.pixel.value{$:/state/sidebar/resizing!!start-story-left}multiply[100]divide] ~[is.percentage.value{$:/state/sidebar/resizing!!start-story-left}] }}} storyRightStart={{$:/state/sidebar/resizing!!start-story-right}} storyRiverWidthConverted={{{ [multiply[100]divide] }}}> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] :then[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$vars storyWidthConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiply[100]divide] }}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divide] }}}> + <$let storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiply[100]divideaddsubtractmultiply[-1]] }}} storyWidthConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiply[100]divideaddsuffix[%]] }}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divide] }}}> <> - + <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] :then[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$let storyWidthConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiply[100]divide] }}} sidebarMinWidth={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiplydivide[100]] }}} storyRiverLimit={{{ [subtractmultiply[100]divide] }}}> + <$let storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiply[100]divideaddsubtractmultiply[-1]] }}} storyWidthConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiply[100]divideaddsuffix[%]] }}} sidebarMinWidth={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiplydivide[100]] }}} storyRiverLimit={{{ [subtractmultiply[100]divide] }}}> <> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] :then[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$let storyWidthConverted={{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divide] }}}> + <$let storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}addsubtractmultiply[-1]] }}} storyWidthConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] }}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divide] }}}> <> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] :then[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$let storyWidthConverted={{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} sidebarMinWidth={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}divide[100]] }}} storyRiverLimit={{{ [subtractmultiply[100]divide] }}}> + <$let storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}addsubtractmultiply[-1]] }}} storyWidthConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] }}} sidebarMinWidth={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}divide[100]] }}} storyRiverLimit={{{ [subtractmultiply[100]divide] }}}> <> <% endif %> - + \end \procedure set-storyright-actions-pixel() -<$set name="storyRiverWidthConverted" value=<>> +<$let storyLeftStart={{{ [is.percentage.value{$:/state/sidebar/resizing!!start-story-left}multiplydivide[100]] ~[is.pixel.value{$:/state/sidebar/resizing!!start-story-left}] }}} storyRightStart={{$:/state/sidebar/resizing!!start-story-right}} storyRiverWidthConverted=<>> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] :then[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$vars storyWidthConverted={{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> + <$let storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}addsubtractmultiply[-1]] }}} storyWidthConverted={{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> <> - + <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] :then[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$let storyWidthConverted={{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} sidebarMinWidth={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divide] }}} storyRiverLimit={{{ [subtract] }}}> + <$let storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}addsubtractmultiply[-1]] }}} storyWidthConverted={{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} sidebarMinWidth={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divide] }}} storyRiverLimit={{{ [subtract] }}}> <> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] :then[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$let storyWidthConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storywidth}divide[100]addsuffix[px]] }}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> + <$let storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiplydivide[100]addsubtractmultiply[-1]] }}} storyWidthConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storywidth}divide[100]addsuffix[px]] }}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> <> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] :then[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$let storyWidthConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storywidth}divide[100]addsuffix[px]] }}} sidebarMinWidth={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}divide[100]] }}} storyRiverLimit={{{ [subtract] }}}> + <$let storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiplydivide[100]addsubtractmultiply[-1]] }}} storyWidthConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storywidth}divide[100]addsuffix[px]] }}} sidebarMinWidth={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}divide[100]] }}} storyRiverLimit={{{ [subtract] }}}> <> <% endif %> - + \end \procedure set-sidebarwidth-action(suffix) @@ -191,23 +191,17 @@ title: $:/core/macros/sidebar-resizer <> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] %> <> - <% else %> - <> <% endif %> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyright}] %> <> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyright}] %> <> - <% else %> - <> <% endif %> <% else %> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] %> <> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] %> <> - <% else %> - <> <% endif %> <% endif %>