From 1e0d4b87fbc096f08d653bb2916246bb6bb97333 Mon Sep 17 00:00:00 2001 From: Simon Huber Date: Fri, 4 Oct 2024 12:34:55 +0200 Subject: [PATCH] Create sidebar-resizer.tid --- core/wiki/macros/sidebar-resizer.tid | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 core/wiki/macros/sidebar-resizer.tid diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid new file mode 100644 index 000000000..6fd13fa4b --- /dev/null +++ b/core/wiki/macros/sidebar-resizer.tid @@ -0,0 +1,30 @@ +title: $:/core/macros/sidebar-resizer + +\procedure sidebar-resizer-pointerdown-actions() +<%if [[$:/state/sidebar/resizing]is[missing]thenmatch[left]thenmatch[normal]] %> + <$let dragDiff=<> dragWidth=<> rightDiff={{{ [subtract] }}} storyRiverWidth={{{ [subtractsubtract[14]] }}} sidebarWidth={{{ [subtractsubtractsubtract[14]] }}}> + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" text={{{ [addsuffix[px]] }}}/> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addadd[6]addsuffix[px]] }}}/> + <% else %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffix[px]] }}}/> + <% endif %> + <$action-setfield $tiddler="$:/state/sidebar/resizing" text="yes" drag-diff=<> right-diff=<>/> + +<% endif %> +\end +\procedure sidebar-resizer-pointercancel-actions() +<$action-deletetiddler $tiddler="$:/state/sidebar/resizing"/> +\end +\procedure sidebar-resizer-pointermove-actions() +<%if [[$:/state/sidebar/resizing]!is[missing]] %> + <$let storyRiverWidth={{{ [subtract{$:/state/sidebar/resizing!!drag-diff}subtract[14]] }}} sidebarWidth={{{ [subtractsubtract{$:/state/sidebar/resizing!!drag-diff}subtract[14]] }}}> + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" text={{{ [addsuffix[px]] }}}/> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [add{$:/state/sidebar/resizing!!right-diff}add[6]addsuffix[px]] }}}/> + <% else %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffix[px]] }}}/> + <% endif %> + +<% endif %> +\end