From 6fd34324260cb720ab8620db1b41d1164f7c7ba4 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 5 Oct 2024 13:10:41 +0200 Subject: [PATCH] updates --- core/wiki/macros/sidebar-resizer.tid | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 70c338dc8..892ea3243 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -30,7 +30,7 @@ title: $:/core/macros/sidebar-resizer <% else %> <$action-setfield $tiddler="$:/state/sidebar/resizing" start-story-left={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyleft}compare:number:gteq[0]] ~0px }}}/> <% endif %> - <$action-setfield $tiddler="$:/state/sidebar/resizing" text="yes" drag-grip-diff=<> widget-node-width=<> start-posx=<>/> + <$action-setfield $tiddler="$:/state/sidebar/resizing" text="yes" drag-grip-diff=<> widget-node-width=<> start-posx=<> start-story-right={{$:/themes/tiddlywiki/vanilla/metrics/storyright}}/> <% endif %> \end @@ -44,21 +44,21 @@ title: $:/core/macros/sidebar-resizer \end \procedure set-storyleft-actions-percentage() -<$let dragDiffPercentage={{{ [dividemultiply[100]] }}} storyLeft={{{ [{$:/state/sidebar/resizing!!start-story-left}addaddsuffix[%]] }}}> +<$let storyLeftStart={{$:/state/sidebar/resizing!!start-story-left}} storyRightStart={{{ [is.pixel.value{$:/state/sidebar/resizing!!start-story-right}multiply[100]divide] ~[is.percentage.value{$:/state/sidebar/resizing!!start-story-right}] }}} dragDiffPercentage={{{ [dividemultiply[100]] }}} storyLeft={{{ [addaddsuffix[%]] }}}> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] :then[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$vars storyLeftMax={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}subtract{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiply[100]divideaddsuffix[%]] }}}> + <$let storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiply[100]divideaddsubtractmultiply[-1]] }}} storyLeftMax={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}subtract{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiply[100]dividesubtractaddsuffix[%]] }}}> <> - + <%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]divideaddsuffix[%]] }}} storyLeftMax={{{ [[100]subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}subtractaddsuffix[%]] }}}> + <$let storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiply[100]divideaddsubtractmultiply[-1]] }}} storyWidthConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiply[100]divideaddsuffix[%]] }}} storyLeftMax={{{ [[100]subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}subtractsubtractaddsuffix[%]] }}}> <> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] :then[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$let sidebarMinWidth={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divide] }}} storyLeftMax={{{ [[100]subtractsubtract{$:/themes/tiddlywiki/vanilla/metrics/storywidth}addsuffix[%]] }}}> + <$let storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}addsubtractmultiply[-1]] }}} sidebarMinWidth={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divide] }}} storyLeftMax={{{ [[100]subtractsubtract{$:/themes/tiddlywiki/vanilla/metrics/storywidth}subtractaddsuffix[%]] }}}> <> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] :then[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$set name="storyLeftMax" value={{{ [[100]subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}subtract{$:/themes/tiddlywiki/vanilla/metrics/storywidth}addsuffix[%]] }}}> + <$set storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}addsubtractmultiply[-1]] }}} name="storyLeftMax" value={{{ [[100]subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}subtract{$:/themes/tiddlywiki/vanilla/metrics/storywidth}subtractaddsuffix[%]] }}}> <> <% endif %> @@ -66,25 +66,25 @@ title: $:/core/macros/sidebar-resizer \end \procedure set-storyleft-actions-pixel() -<$set name="storyLeft" value={{{ [{$:/state/sidebar/resizing!!start-story-left}addaddsuffix[px]] }}}> +<$let storyLeftStart={{$:/state/sidebar/resizing!!start-story-left}} storyRightStart={{{ [is.percentage.value{$:/state/sidebar/resizing!!start-story-right}multiplydivide[100]] ~[is.pixel.value{$:/state/sidebar/resizing!!start-story-right}] }}} storyLeft={{{ [{$:/state/sidebar/resizing!!start-story-left}addaddsuffix[px]] }}}> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] :then[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$set name="storyLeftMax" value={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}subtract{$:/themes/tiddlywiki/vanilla/metrics/storywidth}addsuffix[px]] }}}> + <$let storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}addsubtractmultiply[-1]] }}} storyLeftMax={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}subtract{$:/themes/tiddlywiki/vanilla/metrics/storywidth}subtractaddsuffix[px]] }}}> <> - + <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] :then[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$let sidebarMinWidth={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divide] }}} storyLeftMax={{{ [subtractsubtract{$:/themes/tiddlywiki/vanilla/metrics/storywidth}addsuffix[px]] }}}> + <$let storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}addsubtractmultiply[-1]] }}} sidebarMinWidth={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divide] }}} storyLeftMax={{{ [subtractsubtract{$:/themes/tiddlywiki/vanilla/metrics/storywidth}subtractaddsuffix[px]] }}}> <> <%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]] }}} storyLeftMax={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}subtractaddsuffix[px]] }}}> + <$let storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiplydivide[100]addsubtractmultiply[-1]] }}} storyWidthConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storywidth}divide[100]] }}} storyLeftMax={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}subtractsubtractaddsuffix[px]] }}}> <> <%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]] }}} sidebarMinWidth={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}divide[100]] }}} storyLeftMax={{{ [subtractsubtractaddsuffix[px]] }}}> + <$let storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiplydivide[100]addsubtractmultiply[-1]] }}} storyWidthConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storywidth}divide[100]] }}} sidebarMinWidth={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}divide[100]] }}} storyLeftMax={{{ [subtractsubtractsubtractaddsuffix[px]] }}}> <> <% endif %> - + \end \procedure set-storyright-action(suffix)