From 1e0d4b87fbc096f08d653bb2916246bb6bb97333 Mon Sep 17 00:00:00 2001 From: Simon Huber Date: Fri, 4 Oct 2024 12:34:55 +0200 Subject: [PATCH 001/147] 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 00000000000..6fd13fa4bd0 --- /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 From be6510bcb481a0e3e6e3a8d9428d349d453d7ba8 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Fri, 4 Oct 2024 14:36:00 +0200 Subject: [PATCH 002/147] updates --- core/ui/PageTemplate/sidebar-resizer.tid | 26 ++++ core/wiki/macros/sidebar-resizer.tid | 4 +- themes/tiddlywiki/vanilla/base.tid | 8 +- themes/tiddlywiki/vanilla/metrics.multids | 8 +- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 136 ++++++++++++++++++ 5 files changed, 173 insertions(+), 9 deletions(-) create mode 100644 core/ui/PageTemplate/sidebar-resizer.tid create mode 100644 themes/tiddlywiki/vanilla/sidebar-resizer.tid diff --git a/core/ui/PageTemplate/sidebar-resizer.tid b/core/ui/PageTemplate/sidebar-resizer.tid new file mode 100644 index 00000000000..cb626cf2b13 --- /dev/null +++ b/core/ui/PageTemplate/sidebar-resizer.tid @@ -0,0 +1,26 @@ +title: $:/core/ui/PageTemplate/sidebar-resizer +tags: $:/tags/PageTemplate +list-after: $:/core/ui/PageTemplate/story + +\import $:/core/macros/sidebar-resizer +\whitespace trim + +<$eventcatcher tag="div" class="tc-sidebar-resizer-pointerdown-eventcatcher" selector=".tc-sidebar-resizer" matchSelector=".tc-sidebar-resizer" $pointerdown=<> $pointerup=<>> + +<%if [{$:/state/sidebar}!match[no]] %> + +<$eventcatcher tag="div" class="tc-sidebar-resizer-pointermove-eventcatcher-wrapper" selector=".tc-sidebar-resizer" matchSelector=".tc-sidebar-resizer" $pointerup={{{ [[$:/state/sidebar/resizing]!is[missing]then] }}}> + +<$eventcatcher tag="div" selector=".tc-sidebar-resizer-pointermove" matchSelector=".tc-sidebar-resizer-pointermove" class="tc-sidebar-resizer-pointermove-eventcatcher" $pointerup=<> $pointerleave=<> $pointerout=<> $pointercancel=<> $pointerdown=<> $touchstart=<> $pointermove=<> $contextmenu=<>> + +
+ + + +
+ + + +<% endif %> + + \ No newline at end of file diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 6fd13fa4bd0..5ee7c20c9d6 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -2,7 +2,7 @@ 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]] }}}> + <$let dragDiff=<> dragWidth=<> rightDiff={{{ [subtract] }}} storyRiverWidth={{{ [subtractsubtract[14]] }}} sidebarWidth={{{ [subtractaddadd[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]] }}}/> @@ -18,7 +18,7 @@ title: $:/core/macros/sidebar-resizer \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]] }}}> + <$let storyRiverWidth={{{ [subtract{$:/state/sidebar/resizing!!drag-diff}subtract[14]] }}} sidebarWidth={{{ [subtractadd{$:/state/sidebar/resizing!!drag-diff}add[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]] }}}/> diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index c13b69f9bd3..a8b2c19b909 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1027,7 +1027,7 @@ button.tc-btn-invisible.tc-remove-tag-button { .tc-sidebar-scrollable { position: fixed; top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; - left: {{$:/themes/tiddlywiki/vanilla/metrics/storyright}}; + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),{{$:/themes/tiddlywiki/vanilla/metrics/storyright}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); bottom: 0; right: 0; overflow-y: auto; @@ -1046,7 +1046,7 @@ button.tc-btn-invisible.tc-remove-tag-button { position: relative; left: {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}; top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; - width: {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}}; + width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}})); padding: 42px 42px 42px 42px; } @@ -1481,7 +1481,7 @@ html body.tc-body.tc-single-tiddler-window { width: auto; left: 0; margin-left: {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}; - margin-right: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}}; + margin-right: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); } .tc-tiddler-frame { @@ -1492,7 +1492,7 @@ html body.tc-body.tc-single-tiddler-window { left: auto; bottom: 0; right: 0; - width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}}; + width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); } body.tc-body .tc-page-container.tc-page-view-zoomin .tc-tiddler-frame { diff --git a/themes/tiddlywiki/vanilla/metrics.multids b/themes/tiddlywiki/vanilla/metrics.multids index 3607bd6c93b..87a9021efb8 100644 --- a/themes/tiddlywiki/vanilla/metrics.multids +++ b/themes/tiddlywiki/vanilla/metrics.multids @@ -4,10 +4,12 @@ bodyfontsize: 15px bodylineheight: 22px fontsize: 14px lineheight: 20px +sidebarbreakpoint: 960px +sidebarminwidth: 350px +sidebarwidth: 350px storyleft: 0px +storyminwidth: 350px storytop: 0px storyright: 770px storywidth: 770px -tiddlerwidth: 686px -sidebarbreakpoint: 960px -sidebarwidth: 350px +tiddlerwidth: 686px \ No newline at end of file diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid new file mode 100644 index 00000000000..0baf614296c --- /dev/null +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -0,0 +1,136 @@ +title: $:/themes/tiddlywiki/vanilla/sidebar-resizer +tags: [[$:/tags/Stylesheet]] +code-body: yes + +\function sidebarbreakpoint() [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] + +\function sidebarbreakpoint-minus-one() [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}removesuffix[px]subtract[1]addsuffix[px]] ~[{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] + +\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock conditional + +@media (min-width: <>) { + + .tc-sidebar-resizer { + position: fixed; + top: 0; + height: 100%; + width: 22px; + z-index: 1; + transition: opacity 100ms; + opacity: 0.1; + cursor: ew-resize; + background: linear-gradient(<>, <>) no-repeat center/2px 100%; + } + + .tc-sidebar-resizer:hover { + opacity: 0.6; + } + + @media (pointer: coarse) { + + .tc-sidebar-resizer { + background: <>; + } + + .tc-sidebar-resizer:hover { + opacity: 0.1; + } + } + + .tc-sidebar-resizer-pointerdown-eventcatcher { + z-index: 0; + } + + .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove { + position: absolute; + top: 0; + left: 0; + right: 0; + } + + .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove { + width: 100%; + height: 100%; + min-height: 100%; + z-index: -1; + } + + .tc-sidebar-resizer-pointermove-eventcatcher-wrapper { + z-index: -1; + } + + .tc-sidebar-resizer, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove { + touch-action: none; + user-select: none; + } + + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> + + .tc-sidebar-resizer { + right: calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}} + 6px); + } + + <% endif %> + + <%if [[$:/state/sidebar/resizing]!is[missing]] %> + + .tc-sidebar-resizer-pointerdown-eventcatcher { + z-index: 800; + } + + .tc-sidebar-resizer-pointermove-eventcatcher-wrapper { + z-index: 801; + } + + .tc-sidebar-resizer-pointermove-eventcatcher { + z-index: 802; + } + + .tc-sidebar-resizer-pointermove { + z-index: 803; + cursor: ew-resize; + } + + .tc-sidebar-resizer { + opacity: 0.6; + } + + @media (pointer: coarse) { + + .tc-sidebar-resizer { + opacity: 0.25; + } + } + + <% endif %> + + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> + + .tc-sidebar-resizer { + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - 36px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 36px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 36px)); + } + + <% else %> + + .tc-sidebar-resizer { + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 14px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + 14px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 14px)); + } + + <% endif %> + + <%if [{$:/state/sidebar}match[no]] %> + + tc-sidebar-resizer-pointermove-eventcatcher-wrapper, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer { + display: none; + } + + <% endif %> + +} + +@media (max-width: <>) { + + .tc-sidebar-resizer-pointermove-eventcatcher-wrapper, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer { + display: none; + } +} \ No newline at end of file From 7fbbb4e8b8b80fde4a4be0aa3f35b1e6bc809390 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Fri, 4 Oct 2024 14:44:03 +0200 Subject: [PATCH 003/147] updates --- themes/tiddlywiki/vanilla/base.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index a8b2c19b909..74c58010107 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1157,7 +1157,7 @@ button.tc-btn-invisible.tc-remove-tag-button { @media (min-width: <>) { .tc-tiddler-frame { padding: 28px 42px 42px 42px; - width: {{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}}; + width: min({{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}},100%); border-radius: 2px; } From 22b33e6fe4288f365230e7dec5d70039ad12f80f Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Fri, 4 Oct 2024 15:34:52 +0200 Subject: [PATCH 004/147] updates --- core/wiki/macros/sidebar-resizer.tid | 4 ++-- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 5ee7c20c9d6..064dd97e51d 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -5,7 +5,7 @@ title: $:/core/macros/sidebar-resizer <$let dragDiff=<> dragWidth=<> rightDiff={{{ [subtract] }}} storyRiverWidth={{{ [subtractsubtract[14]] }}} sidebarWidth={{{ [subtractaddadd[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]] }}}/> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]] }}}/> <% else %> <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffix[px]] }}}/> <% endif %> @@ -21,7 +21,7 @@ title: $:/core/macros/sidebar-resizer <$let storyRiverWidth={{{ [subtract{$:/state/sidebar/resizing!!drag-diff}subtract[14]] }}} sidebarWidth={{{ [subtractadd{$:/state/sidebar/resizing!!drag-diff}add[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]] }}}/> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]] }}}/> <% else %> <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffix[px]] }}}/> <% endif %> diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index 0baf614296c..aa30f6556f9 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -107,7 +107,7 @@ code-body: yes <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - 36px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 36px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 36px)); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 28px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px)); } <% else %> From 035c23e0d5c63552f7d848e04c5be1725a3e9147 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Fri, 4 Oct 2024 15:52:16 +0200 Subject: [PATCH 005/147] updates --- core/wiki/macros/sidebar-resizer.tid | 4 ++-- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 064dd97e51d..270b2ce7de0 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -2,7 +2,7 @@ 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={{{ [subtractaddadd[14]] }}}> + <$let dragDiff=<> dragWidth=<> rightDiff={{{ [subtract] }}} storyRiverWidth={{{ [subtractsubtract[14]add[42]] }}} sidebarWidth={{{ [subtractaddadd[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={{{ [addsuffix[px]] }}}/> @@ -18,7 +18,7 @@ title: $:/core/macros/sidebar-resizer \end \procedure sidebar-resizer-pointermove-actions() <%if [[$:/state/sidebar/resizing]!is[missing]] %> - <$let storyRiverWidth={{{ [subtract{$:/state/sidebar/resizing!!drag-diff}subtract[14]] }}} sidebarWidth={{{ [subtractadd{$:/state/sidebar/resizing!!drag-diff}add[14]] }}}> + <$let storyRiverWidth={{{ [subtract{$:/state/sidebar/resizing!!drag-diff}subtract[14]add[42]] }}} sidebarWidth={{{ [subtractadd{$:/state/sidebar/resizing!!drag-diff}add[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={{{ [addsuffix[px]] }}}/> diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index aa30f6556f9..e223e977a7c 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -36,10 +36,6 @@ code-body: yes opacity: 0.1; } } - - .tc-sidebar-resizer-pointerdown-eventcatcher { - z-index: 0; - } .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove { position: absolute; From f547be6b8ebb91feef8bbaf5f6d22367a69bee2c Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Fri, 4 Oct 2024 16:55:27 +0200 Subject: [PATCH 006/147] remove some unnecessary calculations --- core/wiki/macros/sidebar-resizer.tid | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 270b2ce7de0..02b66c6d3e4 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -2,14 +2,14 @@ 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]add[42]] }}} sidebarWidth={{{ [subtractaddadd[14]] }}}> + <$let dragDiff=<> storyRiverWidth={{{ [subtractsubtract[14]add[42]] }}} sidebarWidth={{{ [subtractaddadd[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={{{ [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=<>/> + <$action-setfield $tiddler="$:/state/sidebar/resizing" text="yes" drag-diff=<>/> <% endif %> \end From 315e5433c54792bd2ef8e81365722d3c7acedd4a Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Fri, 4 Oct 2024 18:09:02 +0200 Subject: [PATCH 007/147] clean up stylesheet --- core/ui/PageTemplate/sidebar-resizer.tid | 1 - themes/tiddlywiki/vanilla/sidebar-resizer.tid | 19 ++----------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/core/ui/PageTemplate/sidebar-resizer.tid b/core/ui/PageTemplate/sidebar-resizer.tid index cb626cf2b13..7ecabc3debd 100644 --- a/core/ui/PageTemplate/sidebar-resizer.tid +++ b/core/ui/PageTemplate/sidebar-resizer.tid @@ -1,6 +1,5 @@ title: $:/core/ui/PageTemplate/sidebar-resizer tags: $:/tags/PageTemplate -list-after: $:/core/ui/PageTemplate/story \import $:/core/macros/sidebar-resizer \whitespace trim diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index e223e977a7c..78e9be67aae 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -42,32 +42,17 @@ code-body: yes top: 0; left: 0; right: 0; - } - - .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove { width: 100%; height: 100%; min-height: 100%; z-index: -1; } - .tc-sidebar-resizer-pointermove-eventcatcher-wrapper { - z-index: -1; - } - .tc-sidebar-resizer, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove { touch-action: none; user-select: none; } - <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> - - .tc-sidebar-resizer { - right: calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}} + 6px); - } - - <% endif %> - <%if [[$:/state/sidebar/resizing]!is[missing]] %> .tc-sidebar-resizer-pointerdown-eventcatcher { @@ -116,7 +101,7 @@ code-body: yes <%if [{$:/state/sidebar}match[no]] %> - tc-sidebar-resizer-pointermove-eventcatcher-wrapper, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer { + .tc-sidebar-resizer-pointerdown-eventcatcher, .tc-sidebar-resizer-pointermove-eventcatcher-wrapper, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove, .tc-sidebar-resizer { display: none; } @@ -126,7 +111,7 @@ code-body: yes @media (max-width: <>) { - .tc-sidebar-resizer-pointermove-eventcatcher-wrapper, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer { + .tc-sidebar-resizer-pointerdown-eventcatcher, .tc-sidebar-resizer-pointermove-eventcatcher-wrapper, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove, .tc-sidebar-resizer { display: none; } } \ No newline at end of file From 445547d113d2e22596f9b4696f2194f6f1724171 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Fri, 4 Oct 2024 19:12:24 +0200 Subject: [PATCH 008/147] for now, in fixed-fluid mode keep story and tiddler fixed width --- core/wiki/macros/sidebar-resizer.tid | 10 ++++------ themes/tiddlywiki/vanilla/base.tid | 2 +- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 02b66c6d3e4..3bdc128a06a 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -2,14 +2,13 @@ title: $:/core/macros/sidebar-resizer \procedure sidebar-resizer-pointerdown-actions() <%if [[$:/state/sidebar/resizing]is[missing]thenmatch[left]thenmatch[normal]] %> - <$let dragDiff=<> storyRiverWidth={{{ [subtractsubtract[14]add[42]] }}} sidebarWidth={{{ [subtractaddadd[14]] }}}> - <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" text={{{ [addsuffix[px]] }}}/> + <$let dragGripDiff=<> storyRiverWidth={{{ [subtractsubtract[14]add[42]] }}} sidebarWidth={{{ [subtractaddadd[14]] }}}> + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [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=<>/> + <$action-setfield $tiddler="$:/state/sidebar/resizing" text="yes" drag-grip-diff=<>/> <% endif %> \end @@ -18,9 +17,8 @@ title: $:/core/macros/sidebar-resizer \end \procedure sidebar-resizer-pointermove-actions() <%if [[$:/state/sidebar/resizing]!is[missing]] %> - <$let storyRiverWidth={{{ [subtract{$:/state/sidebar/resizing!!drag-diff}subtract[14]add[42]] }}} sidebarWidth={{{ [subtractadd{$:/state/sidebar/resizing!!drag-diff}add[14]] }}}> + <$let storyRiverWidth={{{ [subtract{$:/state/sidebar/resizing!!drag-grip-diff}subtract[14]add[42]] }}} sidebarWidth={{{ [subtractadd{$:/state/sidebar/resizing!!drag-grip-diff}add[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={{{ [addsuffix[px]] }}}/> <% else %> <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffix[px]] }}}/> diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 74c58010107..630de5eefb2 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1027,7 +1027,7 @@ button.tc-btn-invisible.tc-remove-tag-button { .tc-sidebar-scrollable { position: fixed; top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),{{$:/themes/tiddlywiki/vanilla/metrics/storyright}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}}),{{$:/themes/tiddlywiki/vanilla/metrics/storyright}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); bottom: 0; right: 0; overflow-y: auto; diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index 78e9be67aae..b223f2d9e50 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -88,7 +88,7 @@ code-body: yes <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 28px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px)); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 28px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px)); } <% else %> From bc9706d9b40110097092e6df743adc58b67f9384 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Fri, 4 Oct 2024 21:52:44 +0200 Subject: [PATCH 009/147] wip: fixed-fluid mode, change storyleft. + more calculations --- core/wiki/macros/sidebar-resizer.tid | 84 +++++++++++++++++-- themes/tiddlywiki/vanilla/base.tid | 6 +- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 2 +- 3 files changed, 80 insertions(+), 12 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 3bdc128a06a..1df2a11fefe 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -1,14 +1,35 @@ title: $:/core/macros/sidebar-resizer +\function is.pixel.value(value) [removesuffix[px]compare:number:eq] +\function is.percentage.value(value) [removesuffix[%]compare:number:eq] \procedure sidebar-resizer-pointerdown-actions() <%if [[$:/state/sidebar/resizing]is[missing]thenmatch[left]thenmatch[normal]] %> - <$let dragGripDiff=<> storyRiverWidth={{{ [subtractsubtract[14]add[42]] }}} sidebarWidth={{{ [subtractaddadd[14]] }}}> + <$let startPosX=<> dragGripDiff=<> storyRiverWidth={{{ [subtractsubtract[14]add[42]] }}} sidebarWidth={{{ [subtractaddadd[14]] }}}> <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]] }}}/> + <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyright}] %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]] }}}/> + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyright}] %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [dividemultiply[100]addsuffix[%]] }}}/> + <% else %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]] }}}/> + <% endif %> <% else %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffix[px]] }}}/> + <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffix[px]] }}}/> + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [dividemultiply[100]addsuffix[%]] }}}/> + <% else %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffix[px]] }}}/> + <% endif %> <% endif %> - <$action-setfield $tiddler="$:/state/sidebar/resizing" text="yes" drag-grip-diff=<>/> + <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] %> + <$action-setfield $tiddler="$:/state/sidebar/resizing" start-story-left={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyleft}compare:number:gteq[0]] ~0px }}}/> + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] %> + <$action-setfield $tiddler="$:/state/sidebar/resizing" start-story-left={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyleft}compare:number:gteq[0]] ~0% }}}/> + <% 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=<>/> <% endif %> \end @@ -17,11 +38,58 @@ title: $:/core/macros/sidebar-resizer \end \procedure sidebar-resizer-pointermove-actions() <%if [[$:/state/sidebar/resizing]!is[missing]] %> - <$let storyRiverWidth={{{ [subtract{$:/state/sidebar/resizing!!drag-grip-diff}subtract[14]add[42]] }}} sidebarWidth={{{ [subtractadd{$:/state/sidebar/resizing!!drag-grip-diff}add[14]] }}}> - <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]] }}}/> + <$let dragDiff={{{ [subtract{$:/state/sidebar/resizing!!start-posx}] }}} storyRiverWidth={{{ [subtract{$:/state/sidebar/resizing!!drag-grip-diff}subtract[14]add[42]] }}} sidebarWidth={{{ [subtractadd{$:/state/sidebar/resizing!!drag-grip-diff}add[14]] }}} widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}}> + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> + <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] %> + <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <$vars storyLeft={{{ [{$:/state/sidebar/resizing!!start-story-left}addaddsuffix[px]] }}} storyLeftMax={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}subtract{$:/themes/tiddlywiki/vanilla/metrics/storywidth}addsuffix[px]] }}}> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyleft" text={{{ [compare:number:lteq[0]then[0px]] ~[compare:number:gteqthen] ~[] }}}/> + + <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + + <% endif %> + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] %> + <$set name="dragDiffPercentage" value={{{ [dividemultiply[100]] }}}> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyleft" text={{{ [{$:/state/sidebar/resizing!!start-story-left}addaddsuffix[%]compare:number:gteq[0]] ~0% }}}/> + + <% else %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyleft" text={{{ [{$:/state/sidebar/resizing!!start-story-left}addaddsuffix[px]compare:number:gteq[0]] ~0px }}}/> + <% endif %> + <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyright}] %> + <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <$set name="storyRiverLimit" value={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]compare:number:lteq{$:/themes/tiddlywiki/vanilla/metrics/storywidth}then{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] [addsuffix[px]compare:number:gteqthenaddsuffix[px]] ~[addsuffix[px]] }}}/> + + <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <$let sidebarMinWidth={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divide] }}} storyRiverLimit={{{ [subtract] }}}> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]compare:number:lteq{$:/themes/tiddlywiki/vanilla/metrics/storywidth}then{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] [addsuffix[px]compare:number:gteqthenaddsuffix[px]] ~[addsuffix[px]] }}}/> + + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <$let storyWidthConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storywidth}divide[100]] }}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]compare:number:lteqthen] [addsuffix[px]compare:number:gteqthenaddsuffix[px]] ~[addsuffix[px]] }}}/> + + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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]] }}} storyRiverLimit={{{ [subtract] }}}> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]compare:number:lteqthen] [addsuffix[px]compare:number:gteqthenaddsuffix[px]] ~[addsuffix[px]] }}}/> + + <% endif %> + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyright}] %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [dividemultiply[100]addsuffix[%]] }}}/> + <% else %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]] }}}/> + <% endif %> <% else %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffix[px]] }}}/> + <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffix[px]] }}}/> + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [dividemultiply[100]addsuffix[%]] }}}/> + <% else %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffix[px]] }}}/> + <% endif %> <% endif %> <% endif %> diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 630de5eefb2..b02fd4f460e 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1027,7 +1027,7 @@ button.tc-btn-invisible.tc-remove-tag-button { .tc-sidebar-scrollable { position: fixed; top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}}),{{$:/themes/tiddlywiki/vanilla/metrics/storyright}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + left: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}},{{$:/themes/tiddlywiki/vanilla/metrics/storyright}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); bottom: 0; right: 0; overflow-y: auto; @@ -1044,9 +1044,9 @@ button.tc-btn-invisible.tc-remove-tag-button { .tc-story-river { position: relative; - left: {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}; + left: clamp(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}},calc(100% - max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}}),{{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))); top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; - width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}})); + width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/storywidth}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); padding: 42px 42px 42px 42px; } diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index b223f2d9e50..4ed186548d3 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -88,7 +88,7 @@ code-body: yes <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 28px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px)); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 28px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px)); } <% else %> From 02498a1df7a6f11c5308a0a8604d7cbb23385709 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Fri, 4 Oct 2024 21:55:24 +0200 Subject: [PATCH 010/147] no high z-index on first eventcatcher --- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 4 ---- 1 file changed, 4 deletions(-) diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index 4ed186548d3..4ac68feb610 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -55,10 +55,6 @@ code-body: yes <%if [[$:/state/sidebar/resizing]!is[missing]] %> - .tc-sidebar-resizer-pointerdown-eventcatcher { - z-index: 800; - } - .tc-sidebar-resizer-pointermove-eventcatcher-wrapper { z-index: 801; } From dd5af9f092aeaaadacfcc03d66b7b2191fa0c2a1 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 5 Oct 2024 06:11:13 +0200 Subject: [PATCH 011/147] cleanup pointermove actions --- core/wiki/macros/sidebar-resizer.tid | 141 ++++++++++++++++++++------- 1 file changed, 105 insertions(+), 36 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 1df2a11fefe..e1523925494 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -1,7 +1,8 @@ title: $:/core/macros/sidebar-resizer -\function is.pixel.value(value) [removesuffix[px]compare:number:eq] -\function is.percentage.value(value) [removesuffix[%]compare:number:eq] +\function is.pixel.value(value) [removesuffix[px]] +\function is.percentage.value(value) [removesuffix[%]] + \procedure sidebar-resizer-pointerdown-actions() <%if [[$:/state/sidebar/resizing]is[missing]thenmatch[left]thenmatch[normal]] %> <$let startPosX=<> dragGripDiff=<> storyRiverWidth={{{ [subtractsubtract[14]add[42]] }}} sidebarWidth={{{ [subtractaddadd[14]] }}}> @@ -33,54 +34,122 @@ title: $:/core/macros/sidebar-resizer <% endif %> \end + \procedure sidebar-resizer-pointercancel-actions() <$action-deletetiddler $tiddler="$:/state/sidebar/resizing"/> \end + +\procedure set-storyleft-action(suffix) +<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyleft" text={{{ [compare:number:lteq[0]then[0]addsuffix] ~[compare:number:gteqthen] ~[] }}}/> +\end + +\procedure set-storyleft-actions-percentage() +<$let dragDiffPercentage={{{ [dividemultiply[100]] }}} storyLeft={{{ [{$:/state/sidebar/resizing!!start-story-left}addaddsuffix[%]] }}}> + <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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[%]] }}}> + <> + + <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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[%]] }}}> + <> + + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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[%]] }}}> + <> + + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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[%]] }}}> + <> + + <% endif %> + +\end + +\procedure set-storyleft-actions-pixel() +<$set name="storyLeft" value={{{ [{$:/state/sidebar/resizing!!start-story-left}addaddsuffix[px]] }}}> + <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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]] }}}> + <> + + <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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]] }}}> + <> + + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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]] }}}> + <> + + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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]] }}}> + <> + + <% endif %> + +\end + +\procedure set-storyright-action(suffix) +<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffixcompare:number:lteqthen] [addsuffixcompare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> +\end + +\procedure set-storyright-actions-percentage() +<$set name="storyRiverWidth" value={{{ [multiply[100]divide] }}}> + <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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}] }}}> + <> + + <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <$let storyWidthConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiply[100]divide] }}} sidebarMinWidth={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divide] }}} storyRiverLimit={{{ [subtract] }}}> + <> + + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <$let storyWidthConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storywidth}divide[100]] }}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> + <> + + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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]] }}} storyRiverLimit={{{ [subtract] }}}> + <> + + <% endif %> + +\end + +\procedure set-storyright-actions-pixel() +<%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <$vars storyWidthConverted=<> storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> + <> + +<%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <$let storyWidthConverted=<> sidebarMinWidth={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divide] }}} storyRiverLimit={{{ [subtract] }}}> + <> + +<%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <$let storyWidthConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storywidth}divide[100]] }}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> + <> + +<%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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]] }}} storyRiverLimit={{{ [subtract] }}}> + <> + +<% endif %> +\end + \procedure sidebar-resizer-pointermove-actions() <%if [[$:/state/sidebar/resizing]!is[missing]] %> <$let dragDiff={{{ [subtract{$:/state/sidebar/resizing!!start-posx}] }}} storyRiverWidth={{{ [subtract{$:/state/sidebar/resizing!!drag-grip-diff}subtract[14]add[42]] }}} sidebarWidth={{{ [subtractadd{$:/state/sidebar/resizing!!drag-grip-diff}add[14]] }}} widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}}> <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] %> - <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$vars storyLeft={{{ [{$:/state/sidebar/resizing!!start-story-left}addaddsuffix[px]] }}} storyLeftMax={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}subtract{$:/themes/tiddlywiki/vanilla/metrics/storywidth}addsuffix[px]] }}}> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyleft" text={{{ [compare:number:lteq[0]then[0px]] ~[compare:number:gteqthen] ~[] }}}/> - - <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - - <% endif %> + <> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] %> - <$set name="dragDiffPercentage" value={{{ [dividemultiply[100]] }}}> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyleft" text={{{ [{$:/state/sidebar/resizing!!start-story-left}addaddsuffix[%]compare:number:gteq[0]] ~0% }}}/> - + <> <% else %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyleft" text={{{ [{$:/state/sidebar/resizing!!start-story-left}addaddsuffix[px]compare:number:gteq[0]] ~0px }}}/> + <> <% endif %> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyright}] %> - <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$set name="storyRiverLimit" value={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]compare:number:lteq{$:/themes/tiddlywiki/vanilla/metrics/storywidth}then{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] [addsuffix[px]compare:number:gteqthenaddsuffix[px]] ~[addsuffix[px]] }}}/> - - <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$let sidebarMinWidth={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divide] }}} storyRiverLimit={{{ [subtract] }}}> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]compare:number:lteq{$:/themes/tiddlywiki/vanilla/metrics/storywidth}then{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] [addsuffix[px]compare:number:gteqthenaddsuffix[px]] ~[addsuffix[px]] }}}/> - - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$let storyWidthConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storywidth}divide[100]] }}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]compare:number:lteqthen] [addsuffix[px]compare:number:gteqthenaddsuffix[px]] ~[addsuffix[px]] }}}/> - - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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]] }}} storyRiverLimit={{{ [subtract] }}}> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]compare:number:lteqthen] [addsuffix[px]compare:number:gteqthenaddsuffix[px]] ~[addsuffix[px]] }}}/> - - <% endif %> + <> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyright}] %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [dividemultiply[100]addsuffix[%]] }}}/> + <> <% else %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]] }}}/> + <> <% endif %> <% else %> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] %> From ea7da2b8c12e3b584d4cb06db1a15e0243f50d54 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 5 Oct 2024 08:04:03 +0200 Subject: [PATCH 012/147] more calculations --- core/wiki/macros/sidebar-resizer.tid | 98 +++++++++++++++++++++------- 1 file changed, 74 insertions(+), 24 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index e1523925494..883cc55e010 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -88,11 +88,11 @@ title: $:/core/macros/sidebar-resizer \end \procedure set-storyright-action(suffix) -<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffixcompare:number:lteqthen] [addsuffixcompare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> +<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffixcompare:number:lteqthen] [addsuffixcompare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> \end \procedure set-storyright-actions-percentage() -<$set name="storyRiverWidth" value={{{ [multiply[100]divide] }}}> +<$set name="storyRiverWidthConverted" value={{{ [multiply[100]divide] }}}> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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}] }}}> <> @@ -102,11 +102,11 @@ title: $:/core/macros/sidebar-resizer <> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$let storyWidthConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storywidth}divide[100]] }}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> + <$let storyWidthConverted={{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> <> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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]] }}} storyRiverLimit={{{ [subtract] }}}> + <$let storyWidthConverted={{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} sidebarMinWidth={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}divide[100]] }}} storyRiverLimit={{{ [subtract] }}}> <> <% endif %> @@ -114,23 +114,73 @@ title: $:/core/macros/sidebar-resizer \end \procedure set-storyright-actions-pixel() -<%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$vars storyWidthConverted=<> storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> - <> - -<%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$let storyWidthConverted=<> sidebarMinWidth={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divide] }}} storyRiverLimit={{{ [subtract] }}}> - <> - -<%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$let storyWidthConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storywidth}divide[100]] }}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> - <> - -<%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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]] }}} storyRiverLimit={{{ [subtract] }}}> - <> - -<% endif %> +<$set name="storyRiverWidthConverted" value=<>> + <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <$vars storyWidthConverted={{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> + <> + + <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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] }}}> + <> + + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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}] }}}> + <> + + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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] }}}> + <> + + <% endif %> + +\end + +\procedure set-sidebarwidth-action(suffix) +<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffixcompare:number:gteqthen] [addsuffixcompare:number:lteqthen] ~[addsuffix] }}}/> +\end + +\procedure set-sidebarwidth-actions-percentage() +<$vars sidebarWidthConverted={{{ [multiply[100]divide] }}} sidebarMinWidth={{{ [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divideaddsuffix[%]] [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> + <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> + <$let storyLeftConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyleft}multiply[100]divide] }}} storyMinWidthConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}multiply[100]divide] }}} sidebarMaxWidth={{{ [[100]subtractsubtractaddsuffix[%]] }}}> + <> + + <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> + <$let storyLeftConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyleft}multiply[100]divide] }}} sidebarMaxWidth={{{ [[100]subtractsubtract{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}addsuffix[%]] }}}> + <> + + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> + <$let storyMinWidthConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}multiply[100]divide] }}} sidebarMaxWidth={{{ [[100]subtract{$:/themes/tiddlywiki/vanilla/metrics/storyleft}subtractaddsuffix[%]] }}}> + <> + + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> + <$set name="sidebarMaxWidth" value={{{ [[100]subtract{$:/themes/tiddlywiki/vanilla/metrics/storyleft}subtract{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}addsuffix[%]] }}}> + <> + + <% endif %> + +\end + +\procedure set-sidebarwidth-actions-pixel() +<$vars sidebarWidthConverted=<> sidebarMinWidth={{{ [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}addsuffix[px]] [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiplydivide[100]addsuffix[px]] }}}> + <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> + <$vars sidebarMaxWidth={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/storyleft}subtract{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}addsuffix[px]] }}}> + <> + + <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> + <$let storyMinWidthConverted={{{ [multipy{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}divide[100]] }}} sidebarMaxWidth={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/storyleft}subtractaddsuffix[px]] }}}> + <> + + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> + <$let storyLeftConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storyleft}divide[100]] }}} sidebarMaxWidth={{{ [subtractsubtract{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}addsuffix[px]] }}}> + <> + + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> + <$let storyLeftConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storyleft}divide[100]] }}} storyMinWidthConverted={{{ [multipy{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}divide[100]] }}} sidebarMaxWidth={{{ [subtractsubtractaddsuffix[px]] }}}> + <> + + <% endif %> + \end \procedure sidebar-resizer-pointermove-actions() @@ -153,11 +203,11 @@ title: $:/core/macros/sidebar-resizer <% endif %> <% else %> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffix[px]] }}}/> + <> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [dividemultiply[100]addsuffix[%]] }}}/> + <> <% else %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffix[px]] }}}/> + <> <% endif %> <% endif %> From 6b98a2d20f51500689f30c4bd83895629d2eba43 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 5 Oct 2024 08:25:02 +0200 Subject: [PATCH 013/147] update base stylesheet --- themes/tiddlywiki/vanilla/base.tid | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index b02fd4f460e..4a5c015d308 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1027,7 +1027,7 @@ button.tc-btn-invisible.tc-remove-tag-button { .tc-sidebar-scrollable { position: fixed; top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; - left: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}},{{$:/themes/tiddlywiki/vanilla/metrics/storyright}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + left: {{$:/themes/tiddlywiki/vanilla/metrics/storyright}}; bottom: 0; right: 0; overflow-y: auto; @@ -1044,16 +1044,16 @@ button.tc-btn-invisible.tc-remove-tag-button { .tc-story-river { position: relative; - left: clamp(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}},calc(100% - max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}}),{{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))); + left: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; - width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/storywidth}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + width: {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}}; padding: 42px 42px 42px 42px; } <> @@ -1480,8 +1480,8 @@ html body.tc-body.tc-single-tiddler-window { position: relative; width: auto; left: 0; - margin-left: {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}; - margin-right: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); + margin-left: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); + margin-right: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}}; } .tc-tiddler-frame { @@ -1492,7 +1492,7 @@ html body.tc-body.tc-single-tiddler-window { left: auto; bottom: 0; right: 0; - width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); + width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}}; } body.tc-body .tc-page-container.tc-page-view-zoomin .tc-tiddler-frame { From 01c945eea375be03044c697103c36264649c3bdf Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 5 Oct 2024 12:34:54 +0200 Subject: [PATCH 014/147] fix filters --- core/ui/PageTemplate/sidebar-resizer.tid | 1 + core/wiki/macros/sidebar-resizer.tid | 62 +++++++++---------- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 1 - 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/core/ui/PageTemplate/sidebar-resizer.tid b/core/ui/PageTemplate/sidebar-resizer.tid index 7ecabc3debd..cb626cf2b13 100644 --- a/core/ui/PageTemplate/sidebar-resizer.tid +++ b/core/ui/PageTemplate/sidebar-resizer.tid @@ -1,5 +1,6 @@ title: $:/core/ui/PageTemplate/sidebar-resizer tags: $:/tags/PageTemplate +list-after: $:/core/ui/PageTemplate/story \import $:/core/macros/sidebar-resizer \whitespace trim diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 883cc55e010..70c338dc8f5 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -40,24 +40,24 @@ title: $:/core/macros/sidebar-resizer \end \procedure set-storyleft-action(suffix) -<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyleft" text={{{ [compare:number:lteq[0]then[0]addsuffix] ~[compare:number:gteqthen] ~[] }}}/> +<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyleft" text={{{ [compare:number:lt[0]then[0]addsuffix] ~[compare:number:gteqthen] ~[] }}}/> \end \procedure set-storyleft-actions-percentage() <$let dragDiffPercentage={{{ [dividemultiply[100]] }}} storyLeft={{{ [{$:/state/sidebar/resizing!!start-story-left}addaddsuffix[%]] }}}> - <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <%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[%]] }}}> <> - <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.percentage.value{$:/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}multiply[100]divideaddsuffix[%]] }}} storyLeftMax={{{ [[100]subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}subtractaddsuffix[%]] }}}> <> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <%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[%]] }}}> <> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <%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[%]] }}}> <> @@ -67,19 +67,19 @@ title: $:/core/macros/sidebar-resizer \procedure set-storyleft-actions-pixel() <$set name="storyLeft" value={{{ [{$:/state/sidebar/resizing!!start-story-left}addaddsuffix[px]] }}}> - <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <%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]] }}}> <> - <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <%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]] }}}> <> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <%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]] }}}> <> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.percentage.value{$:/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]] }}} sidebarMinWidth={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}divide[100]] }}} storyLeftMax={{{ [subtractsubtractaddsuffix[px]] }}}> <> @@ -88,25 +88,25 @@ title: $:/core/macros/sidebar-resizer \end \procedure set-storyright-action(suffix) -<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffixcompare:number:lteqthen] [addsuffixcompare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> +<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffixcompare:number:ltthen] [addsuffixcompare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> \end \procedure set-storyright-actions-percentage() <$set name="storyRiverWidthConverted" value={{{ [multiply[100]divide] }}}> - <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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}] }}}> + <%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] }}}> <> - <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$let storyWidthConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}multiply[100]divide] }}} sidebarMinWidth={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divide] }}} storyRiverLimit={{{ [subtract] }}}> + <%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] }}}> <> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> - <$let storyWidthConverted={{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> + <%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] }}}> <> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[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={{{ [subtract] }}}> + <%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] }}}> <> <% endif %> @@ -115,19 +115,19 @@ title: $:/core/macros/sidebar-resizer \procedure set-storyright-actions-pixel() <$set name="storyRiverWidthConverted" value=<>> - <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <%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}] }}}> <> - <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.percentage.value{$:/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] }}}> <> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] %> + <%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}] }}}> <> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] +[is.percentage.value{$:/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] }}}> <> @@ -136,24 +136,24 @@ title: $:/core/macros/sidebar-resizer \end \procedure set-sidebarwidth-action(suffix) -<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffixcompare:number:gteqthen] [addsuffixcompare:number:lteqthen] ~[addsuffix] }}}/> +<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffixcompare:number:gteqthen] [addsuffixcompare:number:ltthen] ~[addsuffix] }}}/> \end \procedure set-sidebarwidth-actions-percentage() <$vars sidebarWidthConverted={{{ [multiply[100]divide] }}} sidebarMinWidth={{{ [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divideaddsuffix[%]] [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> - <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> + <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] :then[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> <$let storyLeftConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyleft}multiply[100]divide] }}} storyMinWidthConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}multiply[100]divide] }}} sidebarMaxWidth={{{ [[100]subtractsubtractaddsuffix[%]] }}}> <> - <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> + <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] :then[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> <$let storyLeftConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyleft}multiply[100]divide] }}} sidebarMaxWidth={{{ [[100]subtractsubtract{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}addsuffix[%]] }}}> <> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] :then[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> <$let storyMinWidthConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}multiply[100]divide] }}} sidebarMaxWidth={{{ [[100]subtract{$:/themes/tiddlywiki/vanilla/metrics/storyleft}subtractaddsuffix[%]] }}}> <> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] :then[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> <$set name="sidebarMaxWidth" value={{{ [[100]subtract{$:/themes/tiddlywiki/vanilla/metrics/storyleft}subtract{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}addsuffix[%]] }}}> <> @@ -163,19 +163,19 @@ title: $:/core/macros/sidebar-resizer \procedure set-sidebarwidth-actions-pixel() <$vars sidebarWidthConverted=<> sidebarMinWidth={{{ [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}addsuffix[px]] [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiplydivide[100]addsuffix[px]] }}}> - <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> + <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] :then[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> <$vars sidebarMaxWidth={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/storyleft}subtract{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}addsuffix[px]] }}}> <> - <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> + <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] :then[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> <$let storyMinWidthConverted={{{ [multipy{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}divide[100]] }}} sidebarMaxWidth={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/storyleft}subtractaddsuffix[px]] }}}> <> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] +[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] :then[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> <$let storyLeftConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storyleft}divide[100]] }}} sidebarMaxWidth={{{ [subtractsubtract{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}addsuffix[px]] }}}> <> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] +[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> + <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] :then[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> <$let storyLeftConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storyleft}divide[100]] }}} storyMinWidthConverted={{{ [multipy{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}divide[100]] }}} sidebarMaxWidth={{{ [subtractsubtractaddsuffix[px]] }}}> <> diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index 4ac68feb610..c1217749b61 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -15,7 +15,6 @@ code-body: yes top: 0; height: 100%; width: 22px; - z-index: 1; transition: opacity 100ms; opacity: 0.1; cursor: ew-resize; From 6fd34324260cb720ab8620db1b41d1164f7c7ba4 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 5 Oct 2024 13:10:41 +0200 Subject: [PATCH 015/147] 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 70c338dc8f5..892ea32433f 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) From 667e173d028bebc54ae91d519880bca59eee708d Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 5 Oct 2024 14:23:14 +0200 Subject: [PATCH 016/147] updates --- core/wiki/macros/sidebar-resizer.tid | 36 ++++++++++++---------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 892ea32433f..67a690465af 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 %> From ca32bed4483d0bd0f071a6fd38d726f8c3a0b084 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 5 Oct 2024 14:25:03 +0200 Subject: [PATCH 017/147] add fallbacks --- core/wiki/macros/sidebar-resizer.tid | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 67a690465af..9e024c10be3 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -191,17 +191,23 @@ 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 %> From 40a89fc3375e71ec2b6fe90fc68086c153ead720 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 5 Oct 2024 15:52:15 +0200 Subject: [PATCH 018/147] add ctrl modifier drag for fixed-fluid mode that changes behavior --- core/wiki/macros/sidebar-resizer.tid | 86 +++++++++++++++++++++++----- 1 file changed, 73 insertions(+), 13 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 9e024c10be3..c031a0f672c 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -4,7 +4,7 @@ title: $:/core/macros/sidebar-resizer \function is.percentage.value(value) [removesuffix[%]] \procedure sidebar-resizer-pointerdown-actions() -<%if [[$:/state/sidebar/resizing]is[missing]thenmatch[left]thenmatch[normal]] %> +<%if [[$:/state/sidebar/resizing]is[missing]thenmatch[left]] %> <$let startPosX=<> dragGripDiff=<> storyRiverWidth={{{ [subtractsubtract[14]add[42]] }}} sidebarWidth={{{ [subtractaddadd[14]] }}}> <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyright}] %> @@ -87,26 +87,74 @@ title: $:/core/macros/sidebar-resizer \end -\procedure set-storyright-action(suffix) +\procedure set-storyright-action-alternative(suffix) <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [subtractaddsuffixcompare:number:ltthenaddaddsuffix] [addsuffixcompare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> \end -\procedure set-storyright-actions-percentage() +\procedure set-storyright-actions-percentage-alternative() <$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}] %> <$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 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 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 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-alternative() +<$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}] %> + <$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 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 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 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-storyright-action(suffix) +<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffixcompare:number:ltthen] [addsuffixcompare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> +\end + +\procedure set-storyright-actions-percentage() +<$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}] %> + <$let 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]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] }}}> + <> + + <%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] }}}> <> <% endif %> @@ -116,19 +164,19 @@ title: $:/core/macros/sidebar-resizer \procedure set-storyright-actions-pixel() <$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}] %> - <$let storyDiff={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storywidth}addsubtractmultiply[-1]] }}} storyWidthConverted={{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} storyRiverLimit={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> + <$let 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 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] }}}> + <$let 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 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}] }}}> + <$let 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 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] }}}> + <$let storyWidthConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storywidth}divide[100]addsuffix[px]] }}} sidebarMinWidth={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}divide[100]] }}} storyRiverLimit={{{ [subtract] }}}> <> <% endif %> @@ -195,11 +243,23 @@ title: $:/core/macros/sidebar-resizer <> <% endif %> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyright}] %> - <> + <%if [match[ctrl]] %> + <> + <% else %> + <> + <% endif %> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyright}] %> - <> + <%if [match[ctrl]] %> + <> + <% else %> + <> + <% endif %> <% else %> - <> + <%if [match[ctrl]] %> + <> + <% else %> + <> + <% endif %> <% endif %> <% else %> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] %> From b7d542e34b7808bdc144e313ffa4efad61459e95 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 5 Oct 2024 16:41:56 +0200 Subject: [PATCH 019/147] updates --- core/wiki/macros/sidebar-resizer.tid | 21 ++----------------- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 2 +- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index c031a0f672c..1d685c16835 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -6,23 +6,6 @@ title: $:/core/macros/sidebar-resizer \procedure sidebar-resizer-pointerdown-actions() <%if [[$:/state/sidebar/resizing]is[missing]thenmatch[left]] %> <$let startPosX=<> dragGripDiff=<> storyRiverWidth={{{ [subtractsubtract[14]add[42]] }}} sidebarWidth={{{ [subtractaddadd[14]] }}}> - <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> - <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyright}] %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]] }}}/> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyright}] %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [dividemultiply[100]addsuffix[%]] }}}/> - <% else %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffix[px]] }}}/> - <% endif %> - <% else %> - <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffix[px]] }}}/> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [dividemultiply[100]addsuffix[%]] }}}/> - <% else %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffix[px]] }}}/> - <% endif %> - <% endif %> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] %> <$action-setfield $tiddler="$:/state/sidebar/resizing" start-story-left={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyleft}compare:number:gteq[0]] ~0px }}}/> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] %> @@ -30,7 +13,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=<> start-story-right={{$:/themes/tiddlywiki/vanilla/metrics/storyright}}/> + <$action-setfield $tiddler="$:/state/sidebar/resizing" text="yes" drag-grip-diff=<> drag-grip-diff-right={{{ [subtract] }}} widget-node-width=<> start-posx=<> start-story-right={{$:/themes/tiddlywiki/vanilla/metrics/storyright}}/> <% endif %> \end @@ -233,7 +216,7 @@ title: $:/core/macros/sidebar-resizer \procedure sidebar-resizer-pointermove-actions() <%if [[$:/state/sidebar/resizing]!is[missing]] %> - <$let dragDiff={{{ [subtract{$:/state/sidebar/resizing!!start-posx}] }}} storyRiverWidth={{{ [subtract{$:/state/sidebar/resizing!!drag-grip-diff}subtract[14]add[42]] }}} sidebarWidth={{{ [subtractadd{$:/state/sidebar/resizing!!drag-grip-diff}add[14]] }}} widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}}> + <$let widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}} dragDiff={{{ [subtract{$:/state/sidebar/resizing!!start-posx}] }}} startStoryRight={{{ [is.percentage.value{$:/state/sidebar/resizing!!start-story-right}multiplydivide[100]] ~[is.pixel.value{$:/state/sidebar/resizing!!start-story-right}] }}} storyRiverWidth={{{ [add] }}} sidebarWidth={{{ [subtractadd{$:/state/sidebar/resizing!!drag-grip-diff}add[14]] }}}> <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] %> <> diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index c1217749b61..5afaababc20 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -83,7 +83,7 @@ code-body: yes <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 28px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px)); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px)); } <% else %> From c31a51fb25f877f8880fb0cc7cfbb89b482d802b Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 5 Oct 2024 16:47:38 +0200 Subject: [PATCH 020/147] cleanup --- core/wiki/macros/sidebar-resizer.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 1d685c16835..ede8f976348 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -5,7 +5,7 @@ title: $:/core/macros/sidebar-resizer \procedure sidebar-resizer-pointerdown-actions() <%if [[$:/state/sidebar/resizing]is[missing]thenmatch[left]] %> - <$let startPosX=<> dragGripDiff=<> storyRiverWidth={{{ [subtractsubtract[14]add[42]] }}} sidebarWidth={{{ [subtractaddadd[14]] }}}> + <$let startPosX=<> dragGripDiff=<>> <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] %> <$action-setfield $tiddler="$:/state/sidebar/resizing" start-story-left={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyleft}compare:number:gteq[0]] ~0px }}}/> <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] %> From 61cb65fe489d376dd7c7f9ce7da00a4912cb2557 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 6 Oct 2024 06:04:53 +0200 Subject: [PATCH 021/147] updates --- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index 5afaababc20..df6c878ad9a 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -83,7 +83,7 @@ code-body: yes <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px)); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 28px)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px)); } <% else %> From 6176f3ad90afc1b996dc36d0809f0cec497e1d25 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 6 Oct 2024 10:39:09 +0200 Subject: [PATCH 022/147] simplify pointermove actions and calculations --- core/wiki/macros/sidebar-resizer.tid | 285 ++++-------------- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 2 +- 2 files changed, 59 insertions(+), 228 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index ede8f976348..d54a55aa988 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -2,19 +2,48 @@ title: $:/core/macros/sidebar-resizer \function is.pixel.value(value) [removesuffix[px]] \function is.percentage.value(value) [removesuffix[%]] +\function is.cm.value(value) [removesuffix[cm]] +\function is.mm.value(value) [removesuffix[mm]] +\function is.Q.value(value) [removesuffix[Q]] +\function is.in.value(value) [removesuffix[in]] +\function is.pc.value(value) [removesuffix[pc]] +\function is.pt.value(value) [removesuffix[pt]] + +\function convert.to.percentage(value) [dividemultiply[100]] +\function convert.to.cm(value) [divide[37.8]] +\function convert.to.mm(value) [convert.to.cmmultiply[10]] +\function convert.to.Q(value) [convert.to.cmmultiply[40]] +\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.percentage.value() [convert.to.percentage] +\function convert.to.cm.value() [convert.to.cm] +\function convert.to.mm.value() [convert.to.mm] +\function convert.to.Q.value() [convert.to.Q] +\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.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.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 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]] \procedure sidebar-resizer-pointerdown-actions() <%if [[$:/state/sidebar/resizing]is[missing]thenmatch[left]] %> - <$let startPosX=<> dragGripDiff=<>> - <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] %> - <$action-setfield $tiddler="$:/state/sidebar/resizing" start-story-left={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyleft}compare:number:gteq[0]] ~0px }}}/> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] %> - <$action-setfield $tiddler="$:/state/sidebar/resizing" start-story-left={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyleft}compare:number:gteq[0]] ~0% }}}/> - <% 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=<> drag-grip-diff-right={{{ [subtract] }}} widget-node-width=<> start-posx=<> start-story-right={{$:/themes/tiddlywiki/vanilla/metrics/storyright}}/> - + <$action-setfield $tiddler="$:/state/sidebar/resizing" + text="yes" + widget-node-width=<> + start-posx=<> + start-story-left={{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + story-left-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} + start-story-right={{$:/themes/tiddlywiki/vanilla/metrics/storyright}} + story-right-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/storyright}] }}} + start-sidebar-width={{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + sidebar-width-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] }}} + /> <% endif %> \end @@ -22,236 +51,38 @@ title: $:/core/macros/sidebar-resizer <$action-deletetiddler $tiddler="$:/state/sidebar/resizing"/> \end -\procedure set-storyleft-action(suffix) -<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyleft" text={{{ [compare:number:lt[0]then[0]addsuffix] ~[compare:number:gteqthen] ~[] }}}/> -\end - -\procedure set-storyleft-actions-percentage() -<$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}] %> - <$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 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 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 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 %> - -\end - -\procedure set-storyleft-actions-pixel() -<$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}] %> - <$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 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 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 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-alternative(suffix) -<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [subtractaddsuffixcompare:number:ltthenaddaddsuffix] [addsuffixcompare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> -\end - -\procedure set-storyright-actions-percentage-alternative() -<$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}] %> - <$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 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 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 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-alternative() -<$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}] %> - <$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 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 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 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 %> +\procedure set-storyright-actions() +<$let storyLeftStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-left}] }}} storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyWidthConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] }}} sidebarMinWidthConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} storyRiverLimit={{{ [subtract] }}} storyDiff={{{ [addsubtractmultiply[-1]] }}}> + <$let storyRightMetric={{$:/state/sidebar/resizing!!story-right-metric}} storyRiverWidthConverted={{{ [function[convert.to.result],,] }}} storyRiverLimitConverted={{{ [function[convert.to.result],,] }}} storyDiffConverted={{{ [!match[ctrl]function[convert.to.result],,] ~[0] }}} storyWidthConverted={{{ [function[convert.to.result],,] }}}> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [subtractcompare:number:ltthenaddsuffix] [compare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> + \end -\procedure set-storyright-action(suffix) -<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [addsuffixcompare:number:ltthen] [addsuffixcompare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> -\end - -\procedure set-storyright-actions-percentage() -<$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}] %> - <$let 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]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] }}}> - <> - - <%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] }}}> - <> - - <% endif %> +\procedure set-storyleft-actions() +<$let storyLeftStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-left}] }}} storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyLeft={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-left}add] }}} storyWidthPixelConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] }}} sidebarMinWidthPixelConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} storyDiff={{{ [addsubtractmultiply[-1]] }}} storyLeftMax={{{ [subtractsubtractsubtract] }}}> + <$let storyLeftMetric={{$:/state/sidebar/resizing!!story-left-metric}} storyLeftStart={{{ [function[convert.to.result],,] }}} storyLeftConverted={{{ [function[convert.to.result],,] }}} storyLeftMaxConverted={{{ [function[convert.to.result],,] }}}> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyleft" text={{{ [compare:number:lt[0]then[0]addsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> + \end -\procedure set-storyright-actions-pixel() -<$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}] %> - <$let 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] }}}> - <> - - <%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}] }}}> - <> - - <%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] }}}> - <> - - <% endif %> +\procedure set-sidebarwidth-actions() +<$let sidebarWidthMetric={{$:/state/sidebar/resizing!!sidebar-width-metric}} sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}addsuffix] }}} storyLeftConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} storyMinWidthConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] }}} sidebarMaxWidth={{{ [subtractsubtractaddsuffix[px]] }}}> + <$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] }}}/> + \end -\procedure set-sidebarwidth-action(suffix) -<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [addsuffixcompare:number:gteqthen] [addsuffixcompare:number:ltthen] ~[addsuffix] }}}/> -\end - -\procedure set-sidebarwidth-actions-percentage() -<$vars sidebarWidthConverted={{{ [multiply[100]divide] }}} sidebarMinWidth={{{ [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiply[100]divideaddsuffix[%]] [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}}> - <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] :then[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> - <$let storyLeftConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyleft}multiply[100]divide] }}} storyMinWidthConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}multiply[100]divide] }}} sidebarMaxWidth={{{ [[100]subtractsubtractaddsuffix[%]] }}}> - <> - - <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] :then[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> - <$let storyLeftConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyleft}multiply[100]divide] }}} sidebarMaxWidth={{{ [[100]subtractsubtract{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}addsuffix[%]] }}}> - <> - - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] :then[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> - <$let storyMinWidthConverted={{{ [{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}multiply[100]divide] }}} sidebarMaxWidth={{{ [[100]subtract{$:/themes/tiddlywiki/vanilla/metrics/storyleft}subtractaddsuffix[%]] }}}> - <> - - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] :then[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> - <$set name="sidebarMaxWidth" value={{{ [[100]subtract{$:/themes/tiddlywiki/vanilla/metrics/storyleft}subtract{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}addsuffix[%]] }}}> - <> - - <% endif %> - -\end - -\procedure set-sidebarwidth-actions-pixel() -<$vars sidebarWidthConverted=<> sidebarMinWidth={{{ [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}addsuffix[px]] [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}multiplydivide[100]addsuffix[px]] }}}> - <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] :then[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> - <$vars sidebarMaxWidth={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/storyleft}subtract{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}addsuffix[px]] }}}> - <> - - <%elseif [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] :then[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> - <$let storyMinWidthConverted={{{ [multipy{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}divide[100]] }}} sidebarMaxWidth={{{ [subtract{$:/themes/tiddlywiki/vanilla/metrics/storyleft}subtractaddsuffix[px]] }}}> - <> - - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] :then[is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> - <$let storyLeftConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storyleft}divide[100]] }}} sidebarMaxWidth={{{ [subtractsubtract{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}addsuffix[px]] }}}> - <> - - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] :then[is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] %> - <$let storyLeftConverted={{{ [multiply{$:/themes/tiddlywiki/vanilla/metrics/storyleft}divide[100]] }}} storyMinWidthConverted={{{ [multipy{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}divide[100]] }}} sidebarMaxWidth={{{ [subtractsubtractaddsuffix[px]] }}}> - <> - - <% endif %> - -\end - \procedure sidebar-resizer-pointermove-actions() <%if [[$:/state/sidebar/resizing]!is[missing]] %> - <$let widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}} dragDiff={{{ [subtract{$:/state/sidebar/resizing!!start-posx}] }}} startStoryRight={{{ [is.percentage.value{$:/state/sidebar/resizing!!start-story-right}multiplydivide[100]] ~[is.pixel.value{$:/state/sidebar/resizing!!start-story-right}] }}} storyRiverWidth={{{ [add] }}} sidebarWidth={{{ [subtractadd{$:/state/sidebar/resizing!!drag-grip-diff}add[14]] }}}> + <$let widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}} dragDiff={{{ [subtract{$:/state/sidebar/resizing!!start-posx}] }}} startStoryRight={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyRiverWidth={{{ [add] }}} startSidebarWidth={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-sidebar-width}] }}} sidebarWidth={{{ [subtract] }}}> <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> - <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] %> - <> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] %> - <> - <% else %> - <> - <% endif %> - <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/storyright}] %> - <%if [match[ctrl]] %> - <> - <% else %> - <> - <% endif %> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/storyright}] %> - <%if [match[ctrl]] %> - <> - <% else %> - <> - <% endif %> - <% else %> - <%if [match[ctrl]] %> - <> - <% else %> - <> - <% endif %> - <% endif %> + <> + <> <% else %> - <%if [is.pixel.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] %> - <> - <%elseif [is.percentage.value{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] %> - <> - <% else %> - <> - <% endif %> + <> <% endif %> <% endif %> diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index df6c878ad9a..2dab9998e20 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -83,7 +83,7 @@ code-body: yes <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 28px)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px)); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 28px)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}}))); } <% else %> From fb47dfd5fe5df0fdbe54d0a157b400223d52bd3e Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 6 Oct 2024 11:40:09 +0200 Subject: [PATCH 023/147] different behavior for ctrl-dragging --- core/wiki/macros/sidebar-resizer.tid | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index d54a55aa988..bcf60448074 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -53,8 +53,12 @@ title: $:/core/macros/sidebar-resizer \procedure set-storyright-actions() <$let storyLeftStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-left}] }}} storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyWidthConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] }}} sidebarMinWidthConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} storyRiverLimit={{{ [subtract] }}} storyDiff={{{ [addsubtractmultiply[-1]] }}}> - <$let storyRightMetric={{$:/state/sidebar/resizing!!story-right-metric}} storyRiverWidthConverted={{{ [function[convert.to.result],,] }}} storyRiverLimitConverted={{{ [function[convert.to.result],,] }}} storyDiffConverted={{{ [!match[ctrl]function[convert.to.result],,] ~[0] }}} storyWidthConverted={{{ [function[convert.to.result],,] }}}> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [subtractcompare:number:ltthenaddsuffix] [compare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> + <$let storyRightMetric={{$:/state/sidebar/resizing!!story-right-metric}} storyRiverWidthConverted={{{ [function[convert.to.result],,] }}} storyRiverLimitConverted={{{ [function[convert.to.result],,] }}} storyDiffConverted={{{ [function[convert.to.result],,] ~[0] }}} storyWidthConverted={{{ [function[convert.to.result],,] }}}> + <%if [match[ctrl]] %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [subtractcompare:number:ltthenaddsuffix] [compare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> + <% else %> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [compare:number:ltthenaddsuffix] [compare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> + <% endif %> \end From 3c4d7c5506a8c540ce77bacb7ad39dd09f75bd75 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 6 Oct 2024 12:00:22 +0200 Subject: [PATCH 024/147] fix problem with double px suffixes --- core/wiki/macros/sidebar-resizer.tid | 2 +- .../$__themes_tiddlywiki_vanilla_metrics_sidebarwidth.tid | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 editions/tw5.com/tiddlers/$__themes_tiddlywiki_vanilla_metrics_sidebarwidth.tid diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index bcf60448074..66a1472ff18 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -72,7 +72,7 @@ title: $:/core/macros/sidebar-resizer \end \procedure set-sidebarwidth-actions() -<$let sidebarWidthMetric={{$:/state/sidebar/resizing!!sidebar-width-metric}} sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}addsuffix] }}} storyLeftConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} storyMinWidthConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] }}} sidebarMaxWidth={{{ [subtractsubtractaddsuffix[px]] }}}> +<$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] }}}/> diff --git a/editions/tw5.com/tiddlers/$__themes_tiddlywiki_vanilla_metrics_sidebarwidth.tid b/editions/tw5.com/tiddlers/$__themes_tiddlywiki_vanilla_metrics_sidebarwidth.tid new file mode 100644 index 00000000000..c1398e45dbf --- /dev/null +++ b/editions/tw5.com/tiddlers/$__themes_tiddlywiki_vanilla_metrics_sidebarwidth.tid @@ -0,0 +1,6 @@ +created: 20241006095122581 +modified: 20241006095134090 +title: $:/themes/tiddlywiki/vanilla/metrics/sidebarwidth +type: text/vnd.tiddlywiki + +724px \ No newline at end of file From 126c216caa5ef5a8247798345f12bca87618bb91 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 6 Oct 2024 12:31:57 +0200 Subject: [PATCH 025/147] delete config tiddler --- .../$__themes_tiddlywiki_vanilla_metrics_sidebarwidth.tid | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 editions/tw5.com/tiddlers/$__themes_tiddlywiki_vanilla_metrics_sidebarwidth.tid diff --git a/editions/tw5.com/tiddlers/$__themes_tiddlywiki_vanilla_metrics_sidebarwidth.tid b/editions/tw5.com/tiddlers/$__themes_tiddlywiki_vanilla_metrics_sidebarwidth.tid deleted file mode 100644 index c1398e45dbf..00000000000 --- a/editions/tw5.com/tiddlers/$__themes_tiddlywiki_vanilla_metrics_sidebarwidth.tid +++ /dev/null @@ -1,6 +0,0 @@ -created: 20241006095122581 -modified: 20241006095134090 -title: $:/themes/tiddlywiki/vanilla/metrics/sidebarwidth -type: text/vnd.tiddlywiki - -724px \ No newline at end of file From e84dfa4e12cec2f7353240b20a023a5558eadce0 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 6 Oct 2024 12:44:19 +0200 Subject: [PATCH 026/147] position the resizer correctly in fixed-fluid --- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index 2dab9998e20..23412bf8133 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -83,7 +83,7 @@ code-body: yes <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 28px)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}}))); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 28px)),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px))); } <% else %> From 5d2213918779bee9ea6a8232a1c8be237c7be0a7 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 6 Oct 2024 13:31:32 +0200 Subject: [PATCH 027/147] make ctrl in fixed-fluid mode work like I intended --- core/wiki/macros/sidebar-resizer.tid | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 66a1472ff18..34944ae6b97 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -51,14 +51,12 @@ title: $:/core/macros/sidebar-resizer <$action-deletetiddler $tiddler="$:/state/sidebar/resizing"/> \end +\function convert.storydiff.to.result() [function[convert.to.result],,] + \procedure set-storyright-actions() -<$let storyLeftStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-left}] }}} storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyWidthConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] }}} sidebarMinWidthConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} storyRiverLimit={{{ [subtract] }}} storyDiff={{{ [addsubtractmultiply[-1]] }}}> - <$let storyRightMetric={{$:/state/sidebar/resizing!!story-right-metric}} storyRiverWidthConverted={{{ [function[convert.to.result],,] }}} storyRiverLimitConverted={{{ [function[convert.to.result],,] }}} storyDiffConverted={{{ [function[convert.to.result],,] ~[0] }}} storyWidthConverted={{{ [function[convert.to.result],,] }}}> - <%if [match[ctrl]] %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [subtractcompare:number:ltthenaddsuffix] [compare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> - <% else %> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [compare:number:ltthenaddsuffix] [compare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> - <% endif %> +<$let storyLeftStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-left}] }}} storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] }}} sidebarMinWidthConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} storyRiverLimit={{{ [subtract] }}} storyDiff={{{ [addsubtractmultiply[-1]] }}}> + <$let storyRightMetric={{$:/state/sidebar/resizing!!story-right-metric}} storyRiverWidthConverted={{{ [function[convert.to.result],,] }}} storyRiverLimitConverted={{{ [function[convert.to.result],,] }}} storyDiffConverted={{{ [!match[ctrl]then] ~0 }}} storyWidthConverted={{{ [function[convert.to.result],,] }}}> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [subtractcompare:number:ltthenaddaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> \end From c1499896f7e49631f3eaccdb27a9b1ba550b3675 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 6 Oct 2024 13:57:19 +0200 Subject: [PATCH 028/147] make it work with em too --- core/wiki/macros/sidebar-resizer.tid | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 34944ae6b97..e3f00ab94d0 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 From f823a81b7f81ba87f444f436fe6ce00d9ec59b02 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 6 Oct 2024 14:15:23 +0200 Subject: [PATCH 029/147] add themetweaks configs for sidebarminwidth and storyminwidth --- core/language/en-GB/ThemeTweaks.multids | 4 ++++ themes/tiddlywiki/vanilla/ThemeTweaks.tid | 2 ++ 2 files changed, 6 insertions(+) diff --git a/core/language/en-GB/ThemeTweaks.multids b/core/language/en-GB/ThemeTweaks.multids index 5168053c30b..d04635d0ce7 100644 --- a/core/language/en-GB/ThemeTweaks.multids +++ b/core/language/en-GB/ThemeTweaks.multids @@ -28,6 +28,8 @@ Metrics/BodyFontSize: Font size for tiddler body Metrics/BodyLineHeight: Line height for tiddler body Metrics/StoryLeft: Story left position Metrics/StoryLeft/Hint: how far the left margin of the story river
(tiddler area) is from the left of the page +Metrics/StoryMinWidth: Minimum Story width +Metrics/StoryMinWidth/Hint: the minimun width of the story river Metrics/StoryTop: Story top position Metrics/StoryTop/Hint: how far the top margin of the story river
is from the top of the page Metrics/StoryRight: Story right @@ -38,5 +40,7 @@ Metrics/TiddlerWidth: Tiddler width Metrics/TiddlerWidth/Hint: within the story river Metrics/SidebarBreakpoint: Sidebar breakpoint Metrics/SidebarBreakpoint/Hint: the minimum page width at which the story
river and sidebar will appear side by side +Metrics/SidebarMinWidth: Minimum Sidebar width +Metrics/SidebarMinWidth/Hint: the minimum width of the sidebar Metrics/SidebarWidth: Sidebar width Metrics/SidebarWidth/Hint: the width of the sidebar in fluid-fixed layout diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid index 0e8babf7af0..f69cbfde161 100644 --- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid +++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid @@ -72,6 +72,8 @@ caption: {{$:/language/ThemeTweaks/ThemeTweaks}} |<$link to="$:/themes/tiddlywiki/vanilla/metrics/storytop"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storytop" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/storyright"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/storywidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" default="" tag="input"/> | +|<$link to="$:/themes/tiddlywiki/vanilla/metrics/storyminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyminwidth" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth"><>
//<>//
|^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" default="" tag="input"/> | +|<$link to="$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth" default="" tag="input"/> | From 8f9cbe935d13184f36fe21762f77bfaa52713c4b Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 6 Oct 2024 14:23:16 +0200 Subject: [PATCH 030/147] store the ctrl modifier --- core/wiki/macros/sidebar-resizer.tid | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index e3f00ab94d0..4fe791767e2 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -58,7 +58,7 @@ title: $:/core/macros/sidebar-resizer \procedure set-storyright-actions() <$let storyLeftStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-left}] }}} storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] }}} sidebarMinWidthConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} storyRiverLimit={{{ [subtract] }}} storyDiff={{{ [addsubtractmultiply[-1]] }}}> - <$let storyRightMetric={{$:/state/sidebar/resizing!!story-right-metric}} storyRiverWidthConverted={{{ [function[convert.to.result],,] }}} storyRiverLimitConverted={{{ [function[convert.to.result],,] }}} storyDiffConverted={{{ [!match[ctrl]then] ~0 }}} storyWidthConverted={{{ [function[convert.to.result],,] }}}> + <$let storyRightMetric={{$:/state/sidebar/resizing!!story-right-metric}} storyRiverWidthConverted={{{ [function[convert.to.result],,] }}} storyRiverLimitConverted={{{ [function[convert.to.result],,] }}} storyDiffConverted={{{ [!match[ctrl]then{$:/state/sidebar/resizing!!modifier}!match[ctrl]then] ~0 }}} storyWidthConverted={{{ [function[convert.to.result],,] }}}> <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [subtractcompare:number:ltthenaddaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> @@ -83,6 +83,9 @@ title: $:/core/macros/sidebar-resizer \procedure sidebar-resizer-pointermove-actions() <%if [[$:/state/sidebar/resizing]!is[missing]] %> <$let widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}} dragDiff={{{ [subtract{$:/state/sidebar/resizing!!start-posx}] }}} startStoryRight={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyRiverWidth={{{ [add] }}} startSidebarWidth={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-sidebar-width}] }}} sidebarWidth={{{ [subtract] }}}> + <%if [match[ctrl]then{$:/state/sidebar/resizing!!modifier}!match[ctrl]] %> + <$action-setfield $tiddler="$:/state/sidebar/resizing" modifier="ctrl"/> + <% endif %> <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> <> <> From 807397cbf6252277c3586eb8083cf265ebb19bb8 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 6 Oct 2024 16:55:33 +0200 Subject: [PATCH 031/147] add css limits in base stylesheet --- themes/tiddlywiki/vanilla/base.tid | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 4a5c015d308..90ee6e44446 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1027,7 +1027,7 @@ button.tc-btn-invisible.tc-remove-tag-button { .tc-sidebar-scrollable { position: fixed; top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; - left: {{$:/themes/tiddlywiki/vanilla/metrics/storyright}}; + left: min(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}),{{$:/themes/tiddlywiki/vanilla/metrics/storyright}}); bottom: 0; right: 0; overflow-y: auto; @@ -1039,14 +1039,14 @@ button.tc-btn-invisible.tc-remove-tag-button { html[dir="rtl"] .tc-sidebar-scrollable { left: auto; - right: {{$:/themes/tiddlywiki/vanilla/metrics/storyright}}; + right: min(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}),{{$:/themes/tiddlywiki/vanilla/metrics/storyright}}); } .tc-story-river { position: relative; left: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; - width: {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}}; + width: max({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/storywidth}}); padding: 42px 42px 42px 42px; } @@ -1492,7 +1492,7 @@ html body.tc-body.tc-single-tiddler-window { left: auto; bottom: 0; right: 0; - width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}}; + width: max({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}}); } body.tc-body .tc-page-container.tc-page-view-zoomin .tc-tiddler-frame { From 9bae7caad745b56c74af660c84a5d560897822e0 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 6 Oct 2024 17:06:26 +0200 Subject: [PATCH 032/147] add hint in ThemeTweaks for now, make shift jump out of ctrl mode --- core/language/en-GB/ThemeTweaks.multids | 1 + core/wiki/macros/sidebar-resizer.tid | 2 ++ themes/tiddlywiki/vanilla/ThemeTweaks.tid | 2 ++ 3 files changed, 5 insertions(+) diff --git a/core/language/en-GB/ThemeTweaks.multids b/core/language/en-GB/ThemeTweaks.multids index d04635d0ce7..3e14875056f 100644 --- a/core/language/en-GB/ThemeTweaks.multids +++ b/core/language/en-GB/ThemeTweaks.multids @@ -26,6 +26,7 @@ Metrics/FontSize: Font size Metrics/LineHeight: Line height Metrics/BodyFontSize: Font size for tiddler body Metrics/BodyLineHeight: Line height for tiddler body +Metrics/SidebarResizer/Hint: the values for `storyleft`, `storyright`, `storywidth`, `storyminwidth`, `sidebarwidth` and `sidebarminwidth` need to be ''absolute'' CSS units, ''percentages'' or ''em'' units in order for the sidebar resizer to work Metrics/StoryLeft: Story left position Metrics/StoryLeft/Hint: how far the left margin of the story river
(tiddler area) is from the left of the page Metrics/StoryMinWidth: Minimum Story width diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 4fe791767e2..52b0300682e 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -85,6 +85,8 @@ title: $:/core/macros/sidebar-resizer <$let widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}} dragDiff={{{ [subtract{$:/state/sidebar/resizing!!start-posx}] }}} startStoryRight={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyRiverWidth={{{ [add] }}} startSidebarWidth={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-sidebar-width}] }}} sidebarWidth={{{ [subtract] }}}> <%if [match[ctrl]then{$:/state/sidebar/resizing!!modifier}!match[ctrl]] %> <$action-setfield $tiddler="$:/state/sidebar/resizing" modifier="ctrl"/> + <%elseif [match[shift]then{$:/state/sidebar/resizing!!modifier}match[ctrl]] %> + <$action-setfield $tiddler="$:/state/sidebar/resizing" modifier="shift"/> <% endif %> <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> <> diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid index f69cbfde161..25f859fce24 100644 --- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid +++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid @@ -64,6 +64,8 @@ caption: {{$:/language/ThemeTweaks/ThemeTweaks}} ! <> +<> + |<$link to="$:/themes/tiddlywiki/vanilla/metrics/fontsize"><> |<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/fontsize" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/lineheight"><> |<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/lineheight" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize"><> |<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize" default="" tag="input"/> | From 4a746bf27ab60e8621d9b0a2303b2c04b8d920a6 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 6 Oct 2024 17:09:36 +0200 Subject: [PATCH 033/147] set storyminwidth to 168px --- themes/tiddlywiki/vanilla/metrics.multids | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/tiddlywiki/vanilla/metrics.multids b/themes/tiddlywiki/vanilla/metrics.multids index 87a9021efb8..67f30502538 100644 --- a/themes/tiddlywiki/vanilla/metrics.multids +++ b/themes/tiddlywiki/vanilla/metrics.multids @@ -8,7 +8,7 @@ sidebarbreakpoint: 960px sidebarminwidth: 350px sidebarwidth: 350px storyleft: 0px -storyminwidth: 350px +storyminwidth: 168px storytop: 0px storyright: 770px storywidth: 770px From dbda2c881cb834ab76e1c73ff33930567be8d6a4 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 6 Oct 2024 22:06:37 +0200 Subject: [PATCH 034/147] cleanup --- core/wiki/macros/sidebar-resizer.tid | 65 ++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 19 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 52b0300682e..ce31db629a7 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -43,6 +43,7 @@ title: $:/core/macros/sidebar-resizer start-story-left={{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} story-left-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} start-story-right={{$:/themes/tiddlywiki/vanilla/metrics/storyright}} + saved-story-right={{$:/themes/tiddlywiki/vanilla/metrics/storyright}} story-right-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/storyright}] }}} start-sidebar-width={{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} sidebar-width-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] }}} @@ -54,27 +55,59 @@ title: $:/core/macros/sidebar-resizer <$action-deletetiddler $tiddler="$:/state/sidebar/resizing"/> \end +\function convert.storydiffintermediate.to.result() [function[convert.to.result],,] \function convert.storydiff.to.result() [function[convert.to.result],,] +\function convert.leftdiff.to.result() [function[convert.to.result],,] + +\procedure set-storyleft-storyright-actions() +<$let + storyLeftStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-left}] }}} + storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} + storyWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] }}} + storyLeft={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-left}add] }}} + sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} + storyRiverLimit={{{ [subtract] }}} + storyDiff={{{ [addsubtractmultiply[-1]] }}} + storyLeftMax={{{ [subtractsubtractsubtract] }}}> + + <$let + storyRightMetric={{$:/state/sidebar/resizing!!story-right-metric}} + storyRiverWidthConverted={{{ [function[convert.to.result],,] }}} + storyRiverLimitConverted={{{ [function[convert.to.result],,] }}} + storyDiffConverted={{{ [{$:/state/sidebar/resizing!!modifier}!match[ctrl]then] ~0 }}} + storyWidthConverted={{{ [function[convert.to.result],,] }}} + result={{{ [subtractcompare:number:ltthenaddaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}> + + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text=<>/> -\procedure set-storyright-actions() -<$let storyLeftStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-left}] }}} storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] }}} sidebarMinWidthConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} storyRiverLimit={{{ [subtract] }}} storyDiff={{{ [addsubtractmultiply[-1]] }}}> - <$let storyRightMetric={{$:/state/sidebar/resizing!!story-right-metric}} storyRiverWidthConverted={{{ [function[convert.to.result],,] }}} storyRiverLimitConverted={{{ [function[convert.to.result],,] }}} storyDiffConverted={{{ [!match[ctrl]then{$:/state/sidebar/resizing!!modifier}!match[ctrl]then] ~0 }}} storyWidthConverted={{{ [function[convert.to.result],,] }}}> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text={{{ [subtractcompare:number:ltthenaddaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> - -\end -\procedure set-storyleft-actions() -<$let storyLeftStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-left}] }}} storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyLeft={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-left}add] }}} storyWidthPixelConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] }}} sidebarMinWidthPixelConverted={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} storyDiff={{{ [addsubtractmultiply[-1]] }}} storyLeftMax={{{ [subtractsubtractsubtract] }}}> - <$let storyLeftMetric={{$:/state/sidebar/resizing!!story-left-metric}} storyLeftStart={{{ [function[convert.to.result],,] }}} storyLeftConverted={{{ [function[convert.to.result],,] }}} storyLeftMaxConverted={{{ [function[convert.to.result],,] }}}> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyleft" text={{{ [compare:number:lt[0]then[0]addsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> + <$let + storyLeftMetric={{$:/state/sidebar/resizing!!story-left-metric}} + storyLeftConverted={{{ [function[convert.to.result],,] }}} + storyLeftMaxConverted={{{ [function[convert.to.result],,] }}} + result={{{ [compare:number:lt[0]then[0]addsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}> + + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyleft" text=<>/> + + \end \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],,] }}}> +<$let + sidebarWidthMetric={{$:/state/sidebar/resizing!!sidebar-width-metric}} + sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} + storyLeft={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} + storyMinWidth={{{ [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] }}}/> @@ -83,14 +116,8 @@ title: $:/core/macros/sidebar-resizer \procedure sidebar-resizer-pointermove-actions() <%if [[$:/state/sidebar/resizing]!is[missing]] %> <$let widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}} dragDiff={{{ [subtract{$:/state/sidebar/resizing!!start-posx}] }}} startStoryRight={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyRiverWidth={{{ [add] }}} startSidebarWidth={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-sidebar-width}] }}} sidebarWidth={{{ [subtract] }}}> - <%if [match[ctrl]then{$:/state/sidebar/resizing!!modifier}!match[ctrl]] %> - <$action-setfield $tiddler="$:/state/sidebar/resizing" modifier="ctrl"/> - <%elseif [match[shift]then{$:/state/sidebar/resizing!!modifier}match[ctrl]] %> - <$action-setfield $tiddler="$:/state/sidebar/resizing" modifier="shift"/> - <% endif %> <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> - <> - <> + <> <% else %> <> <% endif %> From 76d8c97affef852fb14993e4697cce639787e43c Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 6 Oct 2024 22:07:25 +0200 Subject: [PATCH 035/147] cleanup --- core/wiki/macros/sidebar-resizer.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index ce31db629a7..1df6b67aec3 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -74,7 +74,7 @@ title: $:/core/macros/sidebar-resizer storyRightMetric={{$:/state/sidebar/resizing!!story-right-metric}} storyRiverWidthConverted={{{ [function[convert.to.result],,] }}} storyRiverLimitConverted={{{ [function[convert.to.result],,] }}} - storyDiffConverted={{{ [{$:/state/sidebar/resizing!!modifier}!match[ctrl]then] ~0 }}} + storyDiffConverted={{{ [!match[ctrl]then] ~0 }}} storyWidthConverted={{{ [function[convert.to.result],,] }}} result={{{ [subtractcompare:number:ltthenaddaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}> From e5a2f3781b668d0713ae007543fb01e7f92798b0 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Tue, 8 Oct 2024 06:25:27 +0200 Subject: [PATCH 036/147] updates, fixed-fluid --- core/wiki/macros/sidebar-resizer.tid | 68 ++++++++++++++++++---------- 1 file changed, 44 insertions(+), 24 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 1df6b67aec3..0e6c926dc7b 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -30,6 +30,8 @@ title: $:/core/macros/sidebar-resizer \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.pixels.relative.to(value,parent) [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] [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]] ~[suffix[em]then[em]] @@ -43,10 +45,13 @@ title: $:/core/macros/sidebar-resizer start-story-left={{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} story-left-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} start-story-right={{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - saved-story-right={{$:/themes/tiddlywiki/vanilla/metrics/storyright}} story-right-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/storyright}] }}} start-sidebar-width={{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} sidebar-width-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] }}} + start-tiddler-width={{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}} + tiddler-width-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] }}} + start-story-width={{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} + story-width-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] }}} /> <% endif %> \end @@ -55,40 +60,55 @@ title: $:/core/macros/sidebar-resizer <$action-deletetiddler $tiddler="$:/state/sidebar/resizing"/> \end -\function convert.storydiffintermediate.to.result() [function[convert.to.result],,] -\function convert.storydiff.to.result() [function[convert.to.result],,] -\function convert.leftdiff.to.result() [function[convert.to.result],,] - \procedure set-storyleft-storyright-actions() <$let - storyLeftStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-left}] }}} storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} - storyWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] }}} - storyLeft={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-left}add] }}} + storyWidthStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-width}] }}} + storyMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] }}} + storyWidth={{{ [add] }}} + innerStoryWidth={{{ [subtract[84]] }}} + innerStoryWidthStart={{{ [subtract[84]] }}} + storyLeft={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} + storyWidthAddLeft={{{ [add] }}} + storyMinWidthAddLeft={{{ [add] }}} sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} storyRiverLimit={{{ [subtract] }}} - storyDiff={{{ [addsubtractmultiply[-1]] }}} - storyLeftMax={{{ [subtractsubtractsubtract] }}}> + storyMaxWidth={{{ [subtract] }}} + tiddlerWidthMetric={{$:/state/sidebar/resizing!!tiddler-width-metric}} + tiddlerWidthStart={{$:/state/sidebar/resizing!!start-tiddler-width}} + tiddlerWidthStartPixels={{{ [match[%]thenmultiplydivide[100]] ~[convert.to.pixels] }}} + tiddlerWidth={{{ [add] }}} + tiddlerWidthDiff={{{ [subtract] }}} + tiddlerMinWidth={{{ [match[%]then] ~[subtract] }}} + tiddlerMaxWidth={{{ [match[%]then] ~[subtract] }}}> <$let - storyRightMetric={{$:/state/sidebar/resizing!!story-right-metric}} - storyRiverWidthConverted={{{ [function[convert.to.result],,] }}} - storyRiverLimitConverted={{{ [function[convert.to.result],,] }}} - storyDiffConverted={{{ [!match[ctrl]then] ~0 }}} - storyWidthConverted={{{ [function[convert.to.result],,] }}} - result={{{ [subtractcompare:number:ltthenaddaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}> + storyWidthMetric={{$:/state/sidebar/resizing!!story-width-metric}} + storyWidthConverted={{{ [function[convert.to.result],,] }}} + storyMinWidthConverted={{{ [function[convert.to.result],,] }}} + storyMaxWidthConverted={{{ [function[convert.to.result],,] }}} + tiddlerWidthConverted={{{ [match[%]thenmultiply[100]divide] ~[function[convert.to.result],,] }}} + tiddlerMinWidthConverted={{{ [match[%]thenmultiply[100]divide] ~[function[convert.to.result],,] }}} + tiddlerMaxWidthConverted={{{ [match[%]thenmultiply[100]divide] ~[function[convert.to.result],,] }}} - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text=<>/> + storyWidthResult={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}} + + tiddlerWidthResult={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}> + + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth" text=<>/> + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" text=<>/> <$let - storyLeftMetric={{$:/state/sidebar/resizing!!story-left-metric}} - storyLeftConverted={{{ [function[convert.to.result],,] }}} - storyLeftMaxConverted={{{ [function[convert.to.result],,] }}} - result={{{ [compare:number:lt[0]then[0]addsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}> + storyRightMetric={{$:/state/sidebar/resizing!!story-right-metric}} + storyRiverWidthConverted={{{ [function[convert.to.result],,] }}} + storyRiverLimitConverted={{{ [function[convert.to.result],,] }}} + storyMinWidthAddLeftConverted={{{ [function[convert.to.result],,] }}} - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyleft" text=<>/> + result={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}> + + <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text=<>/> @@ -102,12 +122,12 @@ title: $:/core/macros/sidebar-resizer storyLeft={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} storyMinWidth={{{ [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] }}}/> From 836087177db03ab6b4f8471f12b6176447138bf4 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Tue, 8 Oct 2024 07:48:47 +0200 Subject: [PATCH 037/147] make tiddlerwidth percentages work --- core/wiki/macros/sidebar-resizer.tid | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 0e6c926dc7b..57e57b20125 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -69,7 +69,6 @@ title: $:/core/macros/sidebar-resizer innerStoryWidth={{{ [subtract[84]] }}} innerStoryWidthStart={{{ [subtract[84]] }}} storyLeft={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} - storyWidthAddLeft={{{ [add] }}} storyMinWidthAddLeft={{{ [add] }}} sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} storyRiverLimit={{{ [subtract] }}} @@ -93,7 +92,7 @@ title: $:/core/macros/sidebar-resizer storyWidthResult={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}} - tiddlerWidthResult={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}> + tiddlerWidthResult={{{ [match[%]thencompare:number:ltthen{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] ~[match[%]thencompare:number:gteqthen{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] ~[!match[%]thencompare:number:ltthenaddsuffix] ~[!match[%]thencompare:number:gteqthenaddsuffix] ~[addsuffix] }}}> <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth" text=<>/> <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" text=<>/> From da76a2fd3e82ed4b6fab08130b81b56454e48313 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Tue, 8 Oct 2024 13:39:46 +0200 Subject: [PATCH 038/147] add support for centralised for testing --- core/wiki/macros/sidebar-resizer.tid | 34 ++++++++++++++++--- themes/tiddlywiki/centralised/metrics.multids | 4 +++ themes/tiddlywiki/centralised/styles.tid | 4 +-- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 10 ++++-- 4 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 themes/tiddlywiki/centralised/metrics.multids diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 57e57b20125..155d72ddea6 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -30,8 +30,6 @@ title: $:/core/macros/sidebar-resizer \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.pixels.relative.to(value,parent) [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] [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]] ~[suffix[em]then[em]] @@ -52,6 +50,8 @@ title: $:/core/macros/sidebar-resizer tiddler-width-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] }}} start-story-width={{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} story-width-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] }}} + start-centralised-story-width={{$:/themes/tiddlywiki/centralised/metrics/storywidth}} + centralised-story-width-metric={{{ [get.value.metric{$:/themes/tiddlywiki/centralised/metrics/storywidth}] }}} /> <% endif %> \end @@ -127,18 +127,42 @@ title: $:/core/macros/sidebar-resizer 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 +\procedure set-centralised-actions() +<$let + storyMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] }}} + storyWidthStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-centralised-story-width}] }}} + sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} + storyMaxWidth={{{ [subtractsubtract] }}} + dragDiffMultiplied={{{ [multiply[2]] }}} + storyWidth={{{ [add] }}}> + + <$let + storyWidthMetric={{$:/state/sidebar/resizing!!centralised-story-width-metric}} + storyWidthConverted={{{ [function[convert.to.result],,] }}} + storyMinWidthConverted={{{ [function[convert.to.result],,] }}} + storyMaxWidthConverted={{{ [function[convert.to.result],,] }}}> + + <$action-setfield $tiddler="$:/themes/tiddlywiki/centralised/metrics/storywidth" text={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> + + + + +\end + \procedure sidebar-resizer-pointermove-actions() <%if [[$:/state/sidebar/resizing]!is[missing]] %> <$let widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}} dragDiff={{{ [subtract{$:/state/sidebar/resizing!!start-posx}] }}} startStoryRight={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyRiverWidth={{{ [add] }}} startSidebarWidth={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-sidebar-width}] }}} sidebarWidth={{{ [subtract] }}}> - <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> <> - <% else %> + <%elseif [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> <> + <%elseif [{$:/theme}match[$:/themes/tiddlywiki/centralised]] %> + <> <% endif %> <% endif %> diff --git a/themes/tiddlywiki/centralised/metrics.multids b/themes/tiddlywiki/centralised/metrics.multids new file mode 100644 index 00000000000..809a4d5f394 --- /dev/null +++ b/themes/tiddlywiki/centralised/metrics.multids @@ -0,0 +1,4 @@ +title: $:/themes/tiddlywiki/centralised/metrics/ + +storyminwidth: 168px +storywidth: 770px \ No newline at end of file diff --git a/themes/tiddlywiki/centralised/styles.tid b/themes/tiddlywiki/centralised/styles.tid index 92bfe47bd2b..cfb42b39dc4 100644 --- a/themes/tiddlywiki/centralised/styles.tid +++ b/themes/tiddlywiki/centralised/styles.tid @@ -11,7 +11,7 @@ tags: [[$:/tags/Stylesheet]] html .tc-story-river { position: relative; - width: 770px; + width: {{$:/themes/tiddlywiki/centralised/metrics/storywidth}}; padding: 42px; margin: 0 auto; text-align: left; @@ -21,6 +21,6 @@ tags: [[$:/tags/Stylesheet]] text-align: left; left: 50%; right: 0; - margin-left: 343px; + margin-left: calc({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2 - 42px); } } diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index 23412bf8133..a28f1a313a3 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -80,18 +80,24 @@ code-body: yes <% endif %> - <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> .tc-sidebar-resizer { left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 28px)),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px))); } - <% else %> + <%elseif [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> .tc-sidebar-resizer { left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 14px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + 14px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 14px)); } + <%elseif [{$:/theme}match[$:/themes/tiddlywiki/centralised]] %> + + .tc-sidebar-resizer { + left: calc(50% + ({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2) - 28px); + } + <% endif %> <%if [{$:/state/sidebar}match[no]] %> From da232683fecd683993c3708b1b039e3fe4f4013d Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Tue, 8 Oct 2024 15:07:52 +0200 Subject: [PATCH 039/147] some small adjustments --- core/wiki/macros/sidebar-resizer.tid | 6 +++--- themes/tiddlywiki/centralised/styles.tid | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 155d72ddea6..eed35d2f998 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -90,9 +90,9 @@ title: $:/core/macros/sidebar-resizer tiddlerMinWidthConverted={{{ [match[%]thenmultiply[100]divide] ~[function[convert.to.result],,] }}} tiddlerMaxWidthConverted={{{ [match[%]thenmultiply[100]divide] ~[function[convert.to.result],,] }}} - storyWidthResult={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}} + storyWidthResult={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}} - tiddlerWidthResult={{{ [match[%]thencompare:number:ltthen{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] ~[match[%]thencompare:number:gteqthen{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] ~[!match[%]thencompare:number:ltthenaddsuffix] ~[!match[%]thencompare:number:gteqthenaddsuffix] ~[addsuffix] }}}> + tiddlerWidthResult={{{ [match[%]thencompare:number:ltthen{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] ~[match[%]thencompare:number:gteqthen{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] ~[!match[%]thencompare:number:ltthenaddsuffix] ~[!match[%]thencompare:number:gteqthenaddsuffix] ~[addsuffix] }}}> <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth" text=<>/> <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" text=<>/> @@ -105,7 +105,7 @@ title: $:/core/macros/sidebar-resizer storyRiverLimitConverted={{{ [function[convert.to.result],,] }}} storyMinWidthAddLeftConverted={{{ [function[convert.to.result],,] }}} - result={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}> + result={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}> <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text=<>/> diff --git a/themes/tiddlywiki/centralised/styles.tid b/themes/tiddlywiki/centralised/styles.tid index cfb42b39dc4..5d8da11220c 100644 --- a/themes/tiddlywiki/centralised/styles.tid +++ b/themes/tiddlywiki/centralised/styles.tid @@ -22,5 +22,6 @@ tags: [[$:/tags/Stylesheet]] left: 50%; right: 0; margin-left: calc({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2 - 42px); + width: auto; } } From 8cefe1bcf97c27c80f755948e68a5ae356cc57c1 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Tue, 8 Oct 2024 15:50:59 +0200 Subject: [PATCH 040/147] update for negative tiddler width --- core/wiki/macros/sidebar-resizer.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index eed35d2f998..c8f14d907a0 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -92,7 +92,7 @@ title: $:/core/macros/sidebar-resizer storyWidthResult={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}} - tiddlerWidthResult={{{ [match[%]thencompare:number:ltthen{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] ~[match[%]thencompare:number:gteqthen{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] ~[!match[%]thencompare:number:ltthenaddsuffix] ~[!match[%]thencompare:number:gteqthenaddsuffix] ~[addsuffix] }}}> + tiddlerWidthResult={{{ [match[%]thencompare:number:ltthen{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}compare:number:gteq[0]then{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] ~[match[%]thencompare:number:gteqthen{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] ~[!match[%]thencompare:number:ltthenaddsuffix] ~[!match[%]thencompare:number:gteqthenaddsuffix] ~[compare:number:lt[0]then[0]addsuffix] ~[addsuffix] }}}> <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth" text=<>/> <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" text=<>/> From fd615da984c6cde7e890834be735674354fbcbfc Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Tue, 8 Oct 2024 18:44:13 +0200 Subject: [PATCH 041/147] small update for centralised --- core/wiki/macros/sidebar-resizer.tid | 2 +- themes/tiddlywiki/centralised/styles.tid | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index c8f14d907a0..deec51a4558 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -92,7 +92,7 @@ title: $:/core/macros/sidebar-resizer storyWidthResult={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}} - tiddlerWidthResult={{{ [match[%]thencompare:number:ltthen{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}compare:number:gteq[0]then{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] ~[match[%]thencompare:number:gteqthen{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] ~[!match[%]thencompare:number:ltthenaddsuffix] ~[!match[%]thencompare:number:gteqthenaddsuffix] ~[compare:number:lt[0]then[0]addsuffix] ~[addsuffix] }}}> + tiddlerWidthResult={{{ [match[%]thencompare:number:ltthen{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}compare:number:gteq[0]then{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] ~[match[%]thencompare:number:gtthen{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] ~[!match[%]thencompare:number:ltthenaddsuffix] ~[!match[%]thencompare:number:gteqthenaddsuffix] ~[compare:number:lt[0]then[0]addsuffix] ~[addsuffix] }}}> <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth" text=<>/> <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" text=<>/> diff --git a/themes/tiddlywiki/centralised/styles.tid b/themes/tiddlywiki/centralised/styles.tid index 5d8da11220c..ebf32f54bcc 100644 --- a/themes/tiddlywiki/centralised/styles.tid +++ b/themes/tiddlywiki/centralised/styles.tid @@ -24,4 +24,8 @@ tags: [[$:/tags/Stylesheet]] margin-left: calc({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2 - 42px); width: auto; } + + html .tc-tiddler-frame { + width: 100%; + } } From 25d4bd339f61d133bc689535ef5455939ffdde7f Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Tue, 8 Oct 2024 19:00:17 +0200 Subject: [PATCH 042/147] centralised adjustments --- core/language/en-GB/ThemeTweaks.multids | 6 ++++++ core/wiki/macros/sidebar-resizer.tid | 4 ++-- themes/tiddlywiki/centralised/metrics.multids | 3 ++- themes/tiddlywiki/vanilla/ThemeTweaks.tid | 3 +++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/core/language/en-GB/ThemeTweaks.multids b/core/language/en-GB/ThemeTweaks.multids index 3e14875056f..fe0bc0867c5 100644 --- a/core/language/en-GB/ThemeTweaks.multids +++ b/core/language/en-GB/ThemeTweaks.multids @@ -1,5 +1,11 @@ title: $:/language/ThemeTweaks/ +Centralised/Metrics/SidebarMinWidth: Centralised Minimum Sidebar Width +Centralised/Metrics/SidebarMinWidth/Hint: the minimum width of the sidebar in the centralised theme +Centralised/Metrics/StoryMinWidth: Centralised Minimum Story Width +Centralised/Metrics/StoryMinWidth/Hint: the minimum width of the story river in the centralised theme +Centralised/Metrics/StoryWidth: Centralised Story Width +Centralised/Metrics/StoryWidth/Hint: the overall width of the story river in the centralised theme ThemeTweaks: Theme Tweaks ThemeTweaks/Hint: You can tweak certain aspects of the ''Vanilla'' theme. Options: Options diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index deec51a4558..06449435956 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -134,9 +134,9 @@ title: $:/core/macros/sidebar-resizer \procedure set-centralised-actions() <$let - storyMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] }}} + storyMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/centralised/metrics/storyminwidth}] }}} storyWidthStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-centralised-story-width}] }}} - sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} + sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}] }}} storyMaxWidth={{{ [subtractsubtract] }}} dragDiffMultiplied={{{ [multiply[2]] }}} storyWidth={{{ [add] }}}> diff --git a/themes/tiddlywiki/centralised/metrics.multids b/themes/tiddlywiki/centralised/metrics.multids index 809a4d5f394..7b3f96a8673 100644 --- a/themes/tiddlywiki/centralised/metrics.multids +++ b/themes/tiddlywiki/centralised/metrics.multids @@ -1,4 +1,5 @@ title: $:/themes/tiddlywiki/centralised/metrics/ -storyminwidth: 168px +sidebarminwidth: 350px +storyminwidth: 350px storywidth: 770px \ No newline at end of file diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid index 25f859fce24..2afbd418f6b 100644 --- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid +++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid @@ -74,8 +74,11 @@ caption: {{$:/language/ThemeTweaks/ThemeTweaks}} |<$link to="$:/themes/tiddlywiki/vanilla/metrics/storytop"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storytop" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/storyright"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/storywidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" default="" tag="input"/> | +|<$link to="$:/themes/tiddlywiki/centralised/metrics/storywidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/storywidth" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/storyminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyminwidth" default="" tag="input"/> | +|<$link to="$:/themes/tiddlywiki/centralised/metrics/storyminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/storyminwidth" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth"><>
//<>//
|^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth" default="" tag="input"/> | +|<$link to="$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth" default="" tag="input"/> | From 03a860f53569d048a784377e19a1571388897bfa Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Tue, 8 Oct 2024 19:06:18 +0200 Subject: [PATCH 043/147] conditionally show themetweaks metrics --- themes/tiddlywiki/vanilla/ThemeTweaks.tid | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid index 2afbd418f6b..3f697e601f3 100644 --- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid +++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid @@ -66,6 +66,8 @@ caption: {{$:/language/ThemeTweaks/ThemeTweaks}} <> +<%if [{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> + |<$link to="$:/themes/tiddlywiki/vanilla/metrics/fontsize"><> |<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/fontsize" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/lineheight"><> |<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/lineheight" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize"><> |<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize" default="" tag="input"/> | @@ -74,11 +76,16 @@ caption: {{$:/language/ThemeTweaks/ThemeTweaks}} |<$link to="$:/themes/tiddlywiki/vanilla/metrics/storytop"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storytop" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/storyright"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/storywidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/centralised/metrics/storywidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/storywidth" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/storyminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyminwidth" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/centralised/metrics/storyminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/storyminwidth" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth"><>
//<>//
|^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth" default="" tag="input"/> | + +<% else %> + +|<$link to="$:/themes/tiddlywiki/centralised/metrics/storywidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/storywidth" default="" tag="input"/> | +|<$link to="$:/themes/tiddlywiki/centralised/metrics/storyminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/storyminwidth" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth" default="" tag="input"/> | + +<% endif %> \ No newline at end of file From 910cffb4e2cc83f35e4857c0edebdaff343f8d77 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Tue, 8 Oct 2024 19:45:26 +0200 Subject: [PATCH 044/147] further adjustments --- themes/tiddlywiki/centralised/styles.tid | 4 ++-- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/tiddlywiki/centralised/styles.tid b/themes/tiddlywiki/centralised/styles.tid index ebf32f54bcc..8efa9ed9743 100644 --- a/themes/tiddlywiki/centralised/styles.tid +++ b/themes/tiddlywiki/centralised/styles.tid @@ -11,7 +11,7 @@ tags: [[$:/tags/Stylesheet]] html .tc-story-river { position: relative; - width: {{$:/themes/tiddlywiki/centralised/metrics/storywidth}}; + width: min({{$:/themes/tiddlywiki/centralised/metrics/storywidth}},calc(100% - (2 * {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}}))); padding: 42px; margin: 0 auto; text-align: left; @@ -21,7 +21,7 @@ tags: [[$:/tags/Stylesheet]] text-align: left; left: 50%; right: 0; - margin-left: calc({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2 - 42px); + margin-left: min(calc((100% - (2 * {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}})) / 2 - 42px),calc({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2 - 42px)); width: auto; } diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index a28f1a313a3..74ad3c9c3f9 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -95,7 +95,7 @@ code-body: yes <%elseif [{$:/theme}match[$:/themes/tiddlywiki/centralised]] %> .tc-sidebar-resizer { - left: calc(50% + ({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2) - 28px); + left: min(calc(50% + ({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2) - 28px),calc(100% - {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}} - 28px)); } <% endif %> From a69d3242d5fa14d828027d0d02512ce4c3365c10 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Tue, 8 Oct 2024 20:07:48 +0200 Subject: [PATCH 045/147] fix edgecase in centralised theme --- core/wiki/macros/sidebar-resizer.tid | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 06449435956..1958c917408 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -139,7 +139,8 @@ title: $:/core/macros/sidebar-resizer sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}] }}} storyMaxWidth={{{ [subtractsubtract] }}} dragDiffMultiplied={{{ [multiply[2]] }}} - storyWidth={{{ [add] }}}> + storyWidthClamped={{{ [addaddsubtract] }}} + storyWidth={{{ [addsubtract] }}}> <$let storyWidthMetric={{$:/state/sidebar/resizing!!centralised-story-width-metric}} From 22a40993ad0f2a224092c0bf9262a5efad4ce52a Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Tue, 8 Oct 2024 20:09:27 +0200 Subject: [PATCH 046/147] add some newlines at end of file --- core/ui/PageTemplate/sidebar-resizer.tid | 2 +- themes/tiddlywiki/vanilla/ThemeTweaks.tid | 2 +- themes/tiddlywiki/vanilla/metrics.multids | 2 +- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/ui/PageTemplate/sidebar-resizer.tid b/core/ui/PageTemplate/sidebar-resizer.tid index cb626cf2b13..efe0ac56dda 100644 --- a/core/ui/PageTemplate/sidebar-resizer.tid +++ b/core/ui/PageTemplate/sidebar-resizer.tid @@ -23,4 +23,4 @@ list-after: $:/core/ui/PageTemplate/story <% endif %> - \ No newline at end of file + diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid index 3f697e601f3..c688239d35a 100644 --- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid +++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid @@ -88,4 +88,4 @@ caption: {{$:/language/ThemeTweaks/ThemeTweaks}} |<$link to="$:/themes/tiddlywiki/centralised/metrics/storyminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/storyminwidth" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth" default="" tag="input"/> | -<% endif %> \ No newline at end of file +<% endif %> diff --git a/themes/tiddlywiki/vanilla/metrics.multids b/themes/tiddlywiki/vanilla/metrics.multids index 67f30502538..27368cd0071 100644 --- a/themes/tiddlywiki/vanilla/metrics.multids +++ b/themes/tiddlywiki/vanilla/metrics.multids @@ -12,4 +12,4 @@ storyminwidth: 168px storytop: 0px storyright: 770px storywidth: 770px -tiddlerwidth: 686px \ No newline at end of file +tiddlerwidth: 686px diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index 74ad3c9c3f9..e211617061e 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -115,4 +115,4 @@ code-body: yes .tc-sidebar-resizer-pointerdown-eventcatcher, .tc-sidebar-resizer-pointermove-eventcatcher-wrapper, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove, .tc-sidebar-resizer { display: none; } -} \ No newline at end of file +} From fbf299be4148077a4807af88fc52411bfc74e001 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Tue, 8 Oct 2024 20:19:37 +0200 Subject: [PATCH 047/147] fix edgecase in centralised theme fix --- core/wiki/macros/sidebar-resizer.tid | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 1958c917408..da431bd00c6 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -140,7 +140,8 @@ title: $:/core/macros/sidebar-resizer storyMaxWidth={{{ [subtractsubtract] }}} dragDiffMultiplied={{{ [multiply[2]] }}} storyWidthClamped={{{ [addaddsubtract] }}} - storyWidth={{{ [addsubtract] }}}> + storyWidth={{{ [add] }}} + storyWidth={{{ [compare:number:gt[0]thensubtract] ~[] }}} <$let storyWidthMetric={{$:/state/sidebar/resizing!!centralised-story-width-metric}} From c092912df7260e9705e515e515f769aa20c7267f Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Tue, 8 Oct 2024 20:22:09 +0200 Subject: [PATCH 048/147] missing closing bla --- core/wiki/macros/sidebar-resizer.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index da431bd00c6..280874634bd 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -141,7 +141,7 @@ title: $:/core/macros/sidebar-resizer dragDiffMultiplied={{{ [multiply[2]] }}} storyWidthClamped={{{ [addaddsubtract] }}} storyWidth={{{ [add] }}} - storyWidth={{{ [compare:number:gt[0]thensubtract] ~[] }}} + storyWidth={{{ [compare:number:gt[0]thensubtract] ~[] }}}> <$let storyWidthMetric={{$:/state/sidebar/resizing!!centralised-story-width-metric}} From 8637f16e2d0eaf7303b5d43dc30cf897e8834346 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Wed, 9 Oct 2024 05:03:21 +0200 Subject: [PATCH 049/147] update for clamped edgecases --- core/wiki/macros/sidebar-resizer.tid | 13 ++++++++----- themes/tiddlywiki/vanilla/base.tid | 10 +++++----- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 280874634bd..ff9e2009120 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -60,7 +60,7 @@ title: $:/core/macros/sidebar-resizer <$action-deletetiddler $tiddler="$:/state/sidebar/resizing"/> \end -\procedure set-storyleft-storyright-actions() +\procedure set-storywidth-storyright-actions() <$let storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyWidthStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-width}] }}} @@ -73,13 +73,16 @@ title: $:/core/macros/sidebar-resizer sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} storyRiverLimit={{{ [subtract] }}} storyMaxWidth={{{ [subtract] }}} + clampedDiff={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} tiddlerWidthMetric={{$:/state/sidebar/resizing!!tiddler-width-metric}} tiddlerWidthStart={{$:/state/sidebar/resizing!!start-tiddler-width}} tiddlerWidthStartPixels={{{ [match[%]thenmultiplydivide[100]] ~[convert.to.pixels] }}} tiddlerWidth={{{ [add] }}} tiddlerWidthDiff={{{ [subtract] }}} tiddlerMinWidth={{{ [match[%]then] ~[subtract] }}} - tiddlerMaxWidth={{{ [match[%]then] ~[subtract] }}}> + tiddlerMaxWidth={{{ [match[%]then] ~[subtract] }}} + storyWidth={{{ [subtract] }}} + storyRiverWidth={{{ [subtract] }}}> <$let storyWidthMetric={{$:/state/sidebar/resizing!!story-width-metric}} @@ -139,9 +142,9 @@ title: $:/core/macros/sidebar-resizer sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}] }}} storyMaxWidth={{{ [subtractsubtract] }}} dragDiffMultiplied={{{ [multiply[2]] }}} - storyWidthClamped={{{ [addaddsubtract] }}} + storyWidthClamped={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} storyWidth={{{ [add] }}} - storyWidth={{{ [compare:number:gt[0]thensubtract] ~[] }}}> + storyWidth={{{ [subtract] }}}> <$let storyWidthMetric={{$:/state/sidebar/resizing!!centralised-story-width-metric}} @@ -160,7 +163,7 @@ title: $:/core/macros/sidebar-resizer <%if [[$:/state/sidebar/resizing]!is[missing]] %> <$let widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}} dragDiff={{{ [subtract{$:/state/sidebar/resizing!!start-posx}] }}} startStoryRight={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyRiverWidth={{{ [add] }}} startSidebarWidth={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-sidebar-width}] }}} sidebarWidth={{{ [subtract] }}}> <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> - <> + <> <%elseif [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> <> <%elseif [{$:/theme}match[$:/themes/tiddlywiki/centralised]] %> diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 90ee6e44446..d196d3cd811 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1027,7 +1027,7 @@ button.tc-btn-invisible.tc-remove-tag-button { .tc-sidebar-scrollable { position: fixed; top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; - left: min(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}),{{$:/themes/tiddlywiki/vanilla/metrics/storyright}}); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),{{$:/themes/tiddlywiki/vanilla/metrics/storyright}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); bottom: 0; right: 0; overflow-y: auto; @@ -1039,14 +1039,14 @@ button.tc-btn-invisible.tc-remove-tag-button { html[dir="rtl"] .tc-sidebar-scrollable { left: auto; - right: min(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}),{{$:/themes/tiddlywiki/vanilla/metrics/storyright}}); + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),{{$:/themes/tiddlywiki/vanilla/metrics/storyright}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } .tc-story-river { position: relative; left: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; - width: max({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/storywidth}}); + width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/storywidth}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); padding: 42px 42px 42px 42px; } @@ -1481,7 +1481,7 @@ html body.tc-body.tc-single-tiddler-window { width: auto; left: 0; margin-left: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); - margin-right: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}}; + margin-right: max({{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}); } .tc-tiddler-frame { @@ -1492,7 +1492,7 @@ html body.tc-body.tc-single-tiddler-window { left: auto; bottom: 0; right: 0; - width: max({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}}); + width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}},(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}})); } body.tc-body .tc-page-container.tc-page-view-zoomin .tc-tiddler-frame { diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index e211617061e..6ec7169c124 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -83,7 +83,7 @@ code-body: yes <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 28px)),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px))); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - 28px),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 28px)),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px)); } <%elseif [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> From ca68786a64909715e6d396d044abdd943556b033 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Wed, 9 Oct 2024 06:02:28 +0200 Subject: [PATCH 050/147] update for clamped edgecases --- core/wiki/macros/sidebar-resizer.tid | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index ff9e2009120..30101f85594 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -65,23 +65,25 @@ title: $:/core/macros/sidebar-resizer storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyWidthStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-width}] }}} storyMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] }}} + sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} + storyLeft={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} + clampedDiff={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} + storyWidthStart={{{ [subtract] }}} + storyRightStart={{{ [subtract] }}} storyWidth={{{ [add] }}} innerStoryWidth={{{ [subtract[84]] }}} innerStoryWidthStart={{{ [subtract[84]] }}} - storyLeft={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} storyMinWidthAddLeft={{{ [add] }}} - sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} storyRiverLimit={{{ [subtract] }}} storyMaxWidth={{{ [subtract] }}} - clampedDiff={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} tiddlerWidthMetric={{$:/state/sidebar/resizing!!tiddler-width-metric}} tiddlerWidthStart={{$:/state/sidebar/resizing!!start-tiddler-width}} tiddlerWidthStartPixels={{{ [match[%]thenmultiplydivide[100]] ~[convert.to.pixels] }}} + tiddlerWidthStartPixels={{{ [subtract] }}} tiddlerWidth={{{ [add] }}} tiddlerWidthDiff={{{ [subtract] }}} tiddlerMinWidth={{{ [match[%]then] ~[subtract] }}} tiddlerMaxWidth={{{ [match[%]then] ~[subtract] }}} - storyWidth={{{ [subtract] }}} storyRiverWidth={{{ [subtract] }}}> <$let From 6122c5ba171156f74bcab5f9d606f8fdd9480b4a Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Wed, 9 Oct 2024 06:07:36 +0200 Subject: [PATCH 051/147] tiddlerwidth is not clamped --- core/wiki/macros/sidebar-resizer.tid | 1 - 1 file changed, 1 deletion(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 30101f85594..e4a8b53268e 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -79,7 +79,6 @@ title: $:/core/macros/sidebar-resizer tiddlerWidthMetric={{$:/state/sidebar/resizing!!tiddler-width-metric}} tiddlerWidthStart={{$:/state/sidebar/resizing!!start-tiddler-width}} tiddlerWidthStartPixels={{{ [match[%]thenmultiplydivide[100]] ~[convert.to.pixels] }}} - tiddlerWidthStartPixels={{{ [subtract] }}} tiddlerWidth={{{ [add] }}} tiddlerWidthDiff={{{ [subtract] }}} tiddlerMinWidth={{{ [match[%]then] ~[subtract] }}} From 0a3dd8ba96fa215950fd347067fd0cf76ee94dee Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Wed, 9 Oct 2024 07:56:33 +0200 Subject: [PATCH 052/147] tiddlerwidth is clamped in certain cases --- core/wiki/macros/sidebar-resizer.tid | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index e4a8b53268e..ba9ee6d8ec1 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -79,7 +79,8 @@ title: $:/core/macros/sidebar-resizer tiddlerWidthMetric={{$:/state/sidebar/resizing!!tiddler-width-metric}} tiddlerWidthStart={{$:/state/sidebar/resizing!!start-tiddler-width}} tiddlerWidthStartPixels={{{ [match[%]thenmultiplydivide[100]] ~[convert.to.pixels] }}} - tiddlerWidth={{{ [add] }}} + tiddlerWidthClampedDiff={{{ [add[84]addaddsubtractcompare:number:gt[0]] ~0 }}} + tiddlerWidth={{{ [addsubtract] }}} tiddlerWidthDiff={{{ [subtract] }}} tiddlerMinWidth={{{ [match[%]then] ~[subtract] }}} tiddlerMaxWidth={{{ [match[%]then] ~[subtract] }}} From 8ad849661d87e5f5cb5ee8d969e7d104bc216e67 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Wed, 9 Oct 2024 10:13:59 +0200 Subject: [PATCH 053/147] tiddlerwidth min-width 0px makes sense --- themes/tiddlywiki/vanilla/base.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index d196d3cd811..cd53f917fa3 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1157,7 +1157,7 @@ button.tc-btn-invisible.tc-remove-tag-button { @media (min-width: <>) { .tc-tiddler-frame { padding: 28px 42px 42px 42px; - width: min({{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}},100%); + width: clamp(0px,{{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}},100%); border-radius: 2px; } From c2ae885cc3a64115db0095d3e09110990c4f3a6b Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Wed, 9 Oct 2024 13:20:52 +0200 Subject: [PATCH 054/147] fix another edgecase --- core/wiki/macros/sidebar-resizer.tid | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index ba9ee6d8ec1..6f419c020bb 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -125,7 +125,9 @@ title: $:/core/macros/sidebar-resizer sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} storyLeft={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} storyMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] }}} - sidebarMaxWidth={{{ [subtractsubtract] }}}> + sidebarMaxWidth={{{ [subtractsubtract] }}} + clampedDiff={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} + sidebarWidth={{{ [subtract] }}}> <$vars sidebarWidthConverted={{{ [function[convert.to.result],,] }}} From b33be0663bbb0336678b264b8ead51084dbb98c4 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Wed, 9 Oct 2024 13:40:46 +0200 Subject: [PATCH 055/147] more clamping --- themes/tiddlywiki/vanilla/base.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index cd53f917fa3..fbdb2b3f1bc 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1481,7 +1481,7 @@ html body.tc-body.tc-single-tiddler-window { width: auto; left: 0; margin-left: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); - margin-right: max({{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}); + margin-right: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); } .tc-tiddler-frame { From 1d9a4c4a94987fd52149ebf532ed19acd8475070 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Thu, 10 Oct 2024 05:18:55 +0200 Subject: [PATCH 056/147] wip: make it work cross-theme (tight) --- core/wiki/macros/sidebar-resizer.tid | 12 +++++++--- themes/tiddlywiki/centralised/metrics.multids | 2 ++ themes/tiddlywiki/centralised/styles.tid | 4 ++++ .../tiddlywiki/tight-heavier/metrics.multids | 4 ++++ themes/tiddlywiki/tight/base.tid | 23 ++++++++++++++++++- themes/tiddlywiki/tight/metrics.multids | 4 ++++ themes/tiddlywiki/vanilla/ThemeTweaks.tid | 4 ++++ themes/tiddlywiki/vanilla/base.tid | 2 +- themes/tiddlywiki/vanilla/metrics.multids | 2 ++ themes/tiddlywiki/vanilla/sidebar-resizer.tid | 20 +++++----------- 10 files changed, 58 insertions(+), 19 deletions(-) create mode 100644 themes/tiddlywiki/tight-heavier/metrics.multids create mode 100644 themes/tiddlywiki/tight/metrics.multids diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 6f419c020bb..d524f5313a1 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -60,26 +60,32 @@ title: $:/core/macros/sidebar-resizer <$action-deletetiddler $tiddler="$:/state/sidebar/resizing"/> \end +\function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] + \procedure set-storywidth-storyright-actions() <$let storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyWidthStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-width}] }}} storyMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] }}} sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} + storyPaddingLeft={{{ [get.theme.metric[metrics/storypaddingleft]] }}} + storyPaddingLeft={{{ [convert.to.pixels] }}} + storyPaddingRight={{{ [get.theme.metric[metrics/storypaddingright]] }}} + storyPaddingRight={{{ [convert.to.pixels] }}} storyLeft={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} clampedDiff={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} storyWidthStart={{{ [subtract] }}} storyRightStart={{{ [subtract] }}} storyWidth={{{ [add] }}} - innerStoryWidth={{{ [subtract[84]] }}} - innerStoryWidthStart={{{ [subtract[84]] }}} + innerStoryWidth={{{ [subtractsubtract] }}} + innerStoryWidthStart={{{ [subtractsubtract] }}} storyMinWidthAddLeft={{{ [add] }}} storyRiverLimit={{{ [subtract] }}} storyMaxWidth={{{ [subtract] }}} tiddlerWidthMetric={{$:/state/sidebar/resizing!!tiddler-width-metric}} tiddlerWidthStart={{$:/state/sidebar/resizing!!start-tiddler-width}} tiddlerWidthStartPixels={{{ [match[%]thenmultiplydivide[100]] ~[convert.to.pixels] }}} - tiddlerWidthClampedDiff={{{ [add[84]addaddsubtractcompare:number:gt[0]] ~0 }}} + tiddlerWidthClampedDiff={{{ [addaddaddaddsubtractcompare:number:gt[0]] ~0 }}} tiddlerWidth={{{ [addsubtract] }}} tiddlerWidthDiff={{{ [subtract] }}} tiddlerMinWidth={{{ [match[%]then] ~[subtract] }}} diff --git a/themes/tiddlywiki/centralised/metrics.multids b/themes/tiddlywiki/centralised/metrics.multids index 7b3f96a8673..21c8764a5d6 100644 --- a/themes/tiddlywiki/centralised/metrics.multids +++ b/themes/tiddlywiki/centralised/metrics.multids @@ -2,4 +2,6 @@ title: $:/themes/tiddlywiki/centralised/metrics/ sidebarminwidth: 350px storyminwidth: 350px +storypaddingleft: 42px +storypaddingright: 42px storywidth: 770px \ No newline at end of file diff --git a/themes/tiddlywiki/centralised/styles.tid b/themes/tiddlywiki/centralised/styles.tid index 8efa9ed9743..40599d993a2 100644 --- a/themes/tiddlywiki/centralised/styles.tid +++ b/themes/tiddlywiki/centralised/styles.tid @@ -28,4 +28,8 @@ tags: [[$:/tags/Stylesheet]] html .tc-tiddler-frame { width: 100%; } + + html .tc-sidebar-resizer { + left: min(calc(50% + ({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2) - (2 * {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}} / 3))); + } } diff --git a/themes/tiddlywiki/tight-heavier/metrics.multids b/themes/tiddlywiki/tight-heavier/metrics.multids new file mode 100644 index 00000000000..b01e9e647f9 --- /dev/null +++ b/themes/tiddlywiki/tight-heavier/metrics.multids @@ -0,0 +1,4 @@ +title: $:/themes/tiddlywiki/tight-heavier/metrics/ + +storypaddingleft: 0px +storypaddingright: 0px \ No newline at end of file diff --git a/themes/tiddlywiki/tight/base.tid b/themes/tiddlywiki/tight/base.tid index 7d1b8572ee4..c58be041426 100644 --- a/themes/tiddlywiki/tight/base.tid +++ b/themes/tiddlywiki/tight/base.tid @@ -1,7 +1,7 @@ title: $:/themes/tiddlywiki/tight/base tags: [[$:/tags/Stylesheet]] -\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline +\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline conditional @media (max-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) { } @@ -38,6 +38,14 @@ tags: [[$:/tags/Stylesheet]] padding: 12px 0 12px 12px; } + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> + + html body.tc-body div.tc-sidebar-scrollable { + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); + } + + <% endif %> + html body.tc-body .tc-tiddler-frame .tc-subtitle { font-size: 0.7em; font-weight: 700; @@ -95,4 +103,17 @@ tags: [[$:/tags/Stylesheet]] margin-top: -4px; } + html .tc-sidebar-resizer { + width: 12px; + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}}),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}}),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + } + + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]] %> + + html .tc-sidebar-resizer { + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + } + + <% endif %> + } diff --git a/themes/tiddlywiki/tight/metrics.multids b/themes/tiddlywiki/tight/metrics.multids new file mode 100644 index 00000000000..b93807beb64 --- /dev/null +++ b/themes/tiddlywiki/tight/metrics.multids @@ -0,0 +1,4 @@ +title: $:/themes/tiddlywiki/tight/metrics/ + +storypaddingleft: 0px +storypaddingright: 0px \ No newline at end of file diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid index c688239d35a..464eb9c0b00 100644 --- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid +++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid @@ -77,6 +77,8 @@ caption: {{$:/language/ThemeTweaks/ThemeTweaks}} |<$link to="$:/themes/tiddlywiki/vanilla/metrics/storyright"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/storywidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/storyminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyminwidth" default="" tag="input"/> | +|<$link to="$:/themes/tiddlywiki/vanilla/metrics/storypaddingleft"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storypaddingleft" default="" tag="input"/> | +|<$link to="$:/themes/tiddlywiki/vanilla/metrics/storypaddingright"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storypaddingright" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth"><>
//<>//
|^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" default="" tag="input"/> | @@ -86,6 +88,8 @@ caption: {{$:/language/ThemeTweaks/ThemeTweaks}} |<$link to="$:/themes/tiddlywiki/centralised/metrics/storywidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/storywidth" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/centralised/metrics/storyminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/storyminwidth" default="" tag="input"/> | +|<$link to="$:/themes/tiddlywiki/centralised/metrics/storypaddingleft"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/storypaddingleft" default="" tag="input"/> | +|<$link to="$:/themes/tiddlywiki/centralised/metrics/storypaddingright"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/storypaddingright" default="" tag="input"/> | |<$link to="$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth" default="" tag="input"/> | <% endif %> diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index fbdb2b3f1bc..aaeb07e3b93 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1047,7 +1047,7 @@ button.tc-btn-invisible.tc-remove-tag-button { left: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/storywidth}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); - padding: 42px 42px 42px 42px; + padding: 42px {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} 42px {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingleft}}; } < - <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> - - .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - 28px),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - 28px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - 28px)),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - 28px)); - } - - <%elseif [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> - - .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 14px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + 14px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 14px)); - } + .tc-sidebar-resizer { + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + } - <%elseif [{$:/theme}match[$:/themes/tiddlywiki/centralised]] %> + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]] %> .tc-sidebar-resizer { - left: min(calc(50% + ({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2) - 28px),calc(100% - {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}} - 28px)); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); } <% endif %> From 7c2e05e215536296b886c8a257320c5a35ca0fd4 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Thu, 10 Oct 2024 05:45:38 +0200 Subject: [PATCH 057/147] make it respect the metrics of the current theme --- core/wiki/macros/sidebar-resizer.tid | 47 +++++++++++++++------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index d524f5313a1..d761cfcfb94 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -32,27 +32,34 @@ title: $:/core/macros/sidebar-resizer \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.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] + \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]] %> - <$action-setfield $tiddler="$:/state/sidebar/resizing" - text="yes" - widget-node-width=<> - start-posx=<> - start-story-left={{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - story-left-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} - start-story-right={{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - story-right-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/storyright}] }}} - start-sidebar-width={{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} - sidebar-width-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}] }}} - start-tiddler-width={{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}} - tiddler-width-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] }}} - start-story-width={{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - story-width-metric={{{ [get.value.metric{$:/themes/tiddlywiki/vanilla/metrics/storywidth}] }}} - start-centralised-story-width={{$:/themes/tiddlywiki/centralised/metrics/storywidth}} - centralised-story-width-metric={{{ [get.value.metric{$:/themes/tiddlywiki/centralised/metrics/storywidth}] }}} - /> + <$vars + startStoryLeft={{{ [get.theme.metric[metrics/storyleft]] }}} + startStoryRight={{{ [get.theme.metric[metrics/storyright]] }}} + startSidebarWidth={{{ [get.theme.metric[metrics/sidebarwidth]] }}} + startTiddlerWidth={{{ [get.theme.metric[metrics/tiddlerwidth]] }}} + startStoryWidth={{{ [get.theme.metric[metrics/storywidth]] }}}> + <$action-setfield $tiddler="$:/state/sidebar/resizing" + text="yes" + widget-node-width=<> + start-posx=<> + start-story-left=<> + story-left-metric={{{ [get.value.metric] }}} + start-story-right=<> + story-right-metric={{{ [get.value.metric] }}} + start-sidebar-width=<> + sidebar-width-metric={{{ [get.value.metric] }}} + start-tiddler-width=<> + tiddler-width-metric={{{ [get.value.metric] }}} + start-story-width=<> + story-width-metric={{{ [get.value.metric] }}} + /> + <% endif %> \end @@ -60,8 +67,6 @@ title: $:/core/macros/sidebar-resizer <$action-deletetiddler $tiddler="$:/state/sidebar/resizing"/> \end -\function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] - \procedure set-storywidth-storyright-actions() <$let storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} @@ -148,7 +153,7 @@ title: $:/core/macros/sidebar-resizer \procedure set-centralised-actions() <$let storyMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/centralised/metrics/storyminwidth}] }}} - storyWidthStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-centralised-story-width}] }}} + storyWidthStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-width}] }}} sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}] }}} storyMaxWidth={{{ [subtractsubtract] }}} dragDiffMultiplied={{{ [multiply[2]] }}} @@ -157,7 +162,7 @@ title: $:/core/macros/sidebar-resizer storyWidth={{{ [subtract] }}}> <$let - storyWidthMetric={{$:/state/sidebar/resizing!!centralised-story-width-metric}} + storyWidthMetric={{$:/state/sidebar/resizing!!story-width-metric}} storyWidthConverted={{{ [function[convert.to.result],,] }}} storyMinWidthConverted={{{ [function[convert.to.result],,] }}} storyMaxWidthConverted={{{ [function[convert.to.result],,] }}}> From 7fc223993dae536816464d177d14f223bbdb6db9 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Thu, 10 Oct 2024 05:55:43 +0200 Subject: [PATCH 058/147] get metrics by currently selected theme --- core/wiki/macros/sidebar-resizer.tid | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index d761cfcfb94..e48dfa04b56 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -71,13 +71,13 @@ title: $:/core/macros/sidebar-resizer <$let storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyWidthStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-width}] }}} - storyMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] }}} - sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}] }}} + storyMinWidth={{{ [convert.to.pixels] }}} + sidebarMinWidth={{{ [convert.to.pixels] }}} storyPaddingLeft={{{ [get.theme.metric[metrics/storypaddingleft]] }}} storyPaddingLeft={{{ [convert.to.pixels] }}} storyPaddingRight={{{ [get.theme.metric[metrics/storypaddingright]] }}} storyPaddingRight={{{ [convert.to.pixels] }}} - storyLeft={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} + storyLeft={{{ [convert.to.pixels] }}} clampedDiff={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} storyWidthStart={{{ [subtract] }}} storyRightStart={{{ [subtract] }}} @@ -108,7 +108,7 @@ title: $:/core/macros/sidebar-resizer storyWidthResult={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}} - tiddlerWidthResult={{{ [match[%]thencompare:number:ltthen{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}compare:number:gteq[0]then{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] ~[match[%]thencompare:number:gtthen{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}] ~[!match[%]thencompare:number:ltthenaddsuffix] ~[!match[%]thencompare:number:gteqthenaddsuffix] ~[compare:number:lt[0]then[0]addsuffix] ~[addsuffix] }}}> + tiddlerWidthResult={{{ [match[%]thencompare:number:ltthencompare:number:gteq[0]then] ~[match[%]thencompare:number:gtthen] ~[!match[%]thencompare:number:ltthenaddsuffix] ~[!match[%]thencompare:number:gteqthenaddsuffix] ~[compare:number:lt[0]then[0]addsuffix] ~[addsuffix] }}}> <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth" text=<>/> <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" text=<>/> @@ -133,9 +133,9 @@ 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}] }}} - storyLeft={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyleft}] }}} - storyMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}] }}} + sidebarMinWidth={{{ [convert.to.pixels] }}} + storyLeft={{{ [convert.to.pixels] }}} + storyMinWidth={{{ [convert.to.pixels] }}} sidebarMaxWidth={{{ [subtractsubtract] }}} clampedDiff={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} sidebarWidth={{{ [subtract] }}}> From 0b48093829c48340a64bd7e5b3077897947038f0 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Thu, 10 Oct 2024 06:01:30 +0200 Subject: [PATCH 059/147] add some ThemeTweak language strings --- core/language/en-GB/ThemeTweaks.multids | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/language/en-GB/ThemeTweaks.multids b/core/language/en-GB/ThemeTweaks.multids index fe0bc0867c5..034b2731030 100644 --- a/core/language/en-GB/ThemeTweaks.multids +++ b/core/language/en-GB/ThemeTweaks.multids @@ -4,6 +4,10 @@ Centralised/Metrics/SidebarMinWidth: Centralised Minimum Sidebar Width Centralised/Metrics/SidebarMinWidth/Hint: the minimum width of the sidebar in the centralised theme Centralised/Metrics/StoryMinWidth: Centralised Minimum Story Width Centralised/Metrics/StoryMinWidth/Hint: the minimum width of the story river in the centralised theme +Centralised/Metrics/StoryPaddingLeft: Centralised Story Padding Left +Centralised/Metrics/StoryPaddingLeft/Hint: the left padding of the story river in the centralised theme +Centralised/Metrics/StoryPaddingRight: Centralised Story Padding Right +Centralised/Metrics/StoryPaddingRight/Hint: the right padding of the story river in the centralised theme Centralised/Metrics/StoryWidth: Centralised Story Width Centralised/Metrics/StoryWidth/Hint: the overall width of the story river in the centralised theme ThemeTweaks: Theme Tweaks @@ -37,6 +41,10 @@ Metrics/StoryLeft: Story left position Metrics/StoryLeft/Hint: how far the left margin of the story river
(tiddler area) is from the left of the page Metrics/StoryMinWidth: Minimum Story width Metrics/StoryMinWidth/Hint: the minimun width of the story river +Metrics/StoryPaddingLeft: Story Padding Left +Metrics/StoryPaddingLeft/Hint: the left padding of the story river +Metrics/StoryPaddingRight: Story Padding Right +Metrics/StoryPaddingRight/Hint: the right padding of the story river Metrics/StoryTop: Story top position Metrics/StoryTop/Hint: how far the top margin of the story river
is from the top of the page Metrics/StoryRight: Story right From ea1ff26bc52e4c7486b2bf5bbc86647a784dc368 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Thu, 10 Oct 2024 06:20:29 +0200 Subject: [PATCH 060/147] make ThemeTweaks flexible based on currently selected theme --- themes/tiddlywiki/vanilla/ThemeTweaks.tid | 44 +++++++++-------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid index 464eb9c0b00..02d4f40bca8 100644 --- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid +++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid @@ -4,6 +4,8 @@ caption: {{$:/language/ThemeTweaks/ThemeTweaks}} \define lingo-base() $:/language/ThemeTweaks/ +\function get.theme(metric) [{$:/theme}addsuffix[/]addsuffix] ~[[$:/themes/tiddlywiki/vanilla/]addsuffix] + \define replacement-text() [img[$(imageTitle)$]] \end @@ -66,30 +68,18 @@ caption: {{$:/language/ThemeTweaks/ThemeTweaks}} <> -<%if [{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> - -|<$link to="$:/themes/tiddlywiki/vanilla/metrics/fontsize"><> |<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/fontsize" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/vanilla/metrics/lineheight"><> |<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/lineheight" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize"><> |<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/vanilla/metrics/bodylineheight"><> |<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/bodylineheight" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/vanilla/metrics/storyleft"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyleft" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/vanilla/metrics/storytop"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storytop" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/vanilla/metrics/storyright"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/vanilla/metrics/storywidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/vanilla/metrics/storyminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyminwidth" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/vanilla/metrics/storypaddingleft"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storypaddingleft" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/vanilla/metrics/storypaddingright"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/storypaddingright" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth"><>
//<>//
|^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth" default="" tag="input"/> | - -<% else %> - -|<$link to="$:/themes/tiddlywiki/centralised/metrics/storywidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/storywidth" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/centralised/metrics/storyminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/storyminwidth" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/centralised/metrics/storypaddingleft"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/storypaddingleft" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/centralised/metrics/storypaddingright"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/storypaddingright" default="" tag="input"/> | -|<$link to="$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth"><>
//<>// |^<$edit-text tiddler="$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth" default="" tag="input"/> | - -<% endif %> +|<$link to=<>><> |<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><> |<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><> |<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><> |<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>//
|^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | From 247f5ebeca92d1b8006de08ef338aed798dc3b49 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Thu, 10 Oct 2024 06:21:18 +0200 Subject: [PATCH 061/147] remove centralised language themetweaks --- core/language/en-GB/ThemeTweaks.multids | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/core/language/en-GB/ThemeTweaks.multids b/core/language/en-GB/ThemeTweaks.multids index 034b2731030..c4512c1df74 100644 --- a/core/language/en-GB/ThemeTweaks.multids +++ b/core/language/en-GB/ThemeTweaks.multids @@ -1,15 +1,5 @@ title: $:/language/ThemeTweaks/ -Centralised/Metrics/SidebarMinWidth: Centralised Minimum Sidebar Width -Centralised/Metrics/SidebarMinWidth/Hint: the minimum width of the sidebar in the centralised theme -Centralised/Metrics/StoryMinWidth: Centralised Minimum Story Width -Centralised/Metrics/StoryMinWidth/Hint: the minimum width of the story river in the centralised theme -Centralised/Metrics/StoryPaddingLeft: Centralised Story Padding Left -Centralised/Metrics/StoryPaddingLeft/Hint: the left padding of the story river in the centralised theme -Centralised/Metrics/StoryPaddingRight: Centralised Story Padding Right -Centralised/Metrics/StoryPaddingRight/Hint: the right padding of the story river in the centralised theme -Centralised/Metrics/StoryWidth: Centralised Story Width -Centralised/Metrics/StoryWidth/Hint: the overall width of the story river in the centralised theme ThemeTweaks: Theme Tweaks ThemeTweaks/Hint: You can tweak certain aspects of the ''Vanilla'' theme. Options: Options From f171a0b6cacbc680d768c0c5b28d7b95d78c36bd Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Thu, 10 Oct 2024 06:28:42 +0200 Subject: [PATCH 062/147] fix themetweaks --- themes/tiddlywiki/vanilla/ThemeTweaks.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid index 02d4f40bca8..2d88dc5f2ce 100644 --- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid +++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid @@ -4,7 +4,7 @@ caption: {{$:/language/ThemeTweaks/ThemeTweaks}} \define lingo-base() $:/language/ThemeTweaks/ -\function get.theme(metric) [{$:/theme}addsuffix[/]addsuffix] ~[[$:/themes/tiddlywiki/vanilla/]addsuffix] +\function get.theme(metric) [{$:/theme}addsuffix[/]addsuffix!is[missing]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffix] \define replacement-text() [img[$(imageTitle)$]] From e96ff3f48e623f3bf4c184a971747eb2063aa9b3 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Thu, 10 Oct 2024 09:39:30 +0200 Subject: [PATCH 063/147] correctly check if theme tiddler exists --- themes/tiddlywiki/vanilla/ThemeTweaks.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid index 2d88dc5f2ce..22a99f0f050 100644 --- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid +++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid @@ -4,7 +4,7 @@ caption: {{$:/language/ThemeTweaks/ThemeTweaks}} \define lingo-base() $:/language/ThemeTweaks/ -\function get.theme(metric) [{$:/theme}addsuffix[/]addsuffix!is[missing]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffix] +\function get.theme(metric) [{$:/theme}addsuffix[/]addsuffix!is[missing]] ~[{$:/theme}addsuffix[/]addsuffixis[shadow]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffix] \define replacement-text() [img[$(imageTitle)$]] From 11cb571f533f8912a1753bd1a384508b2b22c65e Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Thu, 10 Oct 2024 11:27:37 +0200 Subject: [PATCH 064/147] fix padding in centralised theme --- themes/tiddlywiki/centralised/styles.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/tiddlywiki/centralised/styles.tid b/themes/tiddlywiki/centralised/styles.tid index 40599d993a2..410a97c23ad 100644 --- a/themes/tiddlywiki/centralised/styles.tid +++ b/themes/tiddlywiki/centralised/styles.tid @@ -12,7 +12,7 @@ tags: [[$:/tags/Stylesheet]] html .tc-story-river { position: relative; width: min({{$:/themes/tiddlywiki/centralised/metrics/storywidth}},calc(100% - (2 * {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}}))); - padding: 42px; + padding: 42px {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}} 42px {{$:/themes/tiddlywiki/centralised/metrics/storypaddingleft}}; margin: 0 auto; text-align: left; } From 23f8af34b87d2c9a474c40e63404b2a3a8d868dd Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Thu, 10 Oct 2024 11:49:15 +0200 Subject: [PATCH 065/147] fix resizer positioning --- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index 71d5f7d1e35..d63c47501cb 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -6,6 +6,8 @@ code-body: yes \function sidebarbreakpoint-minus-one() [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}removesuffix[px]subtract[1]addsuffix[px]] ~[{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] +\function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] + \rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock conditional @media (min-width: <>) { @@ -14,7 +16,7 @@ code-body: yes position: fixed; top: 0; height: 100%; - width: min(calc({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 2),21px); + width: min(calc(<> / 2),21px); transition: opacity 100ms; opacity: 0.1; cursor: ew-resize; From db683e249d0bd1fa6875c0294c23327a57d8ca54 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Thu, 10 Oct 2024 12:48:00 +0200 Subject: [PATCH 066/147] add hint for story-right-padding --- core/language/en-GB/ThemeTweaks.multids | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/language/en-GB/ThemeTweaks.multids b/core/language/en-GB/ThemeTweaks.multids index c4512c1df74..9d023932ec0 100644 --- a/core/language/en-GB/ThemeTweaks.multids +++ b/core/language/en-GB/ThemeTweaks.multids @@ -34,7 +34,7 @@ Metrics/StoryMinWidth/Hint: the minimun width of the story river Metrics/StoryPaddingLeft: Story Padding Left Metrics/StoryPaddingLeft/Hint: the left padding of the story river Metrics/StoryPaddingRight: Story Padding Right -Metrics/StoryPaddingRight/Hint: the right padding of the story river +Metrics/StoryPaddingRight/Hint: the right padding of the story river, also controls the width and positioning of the resizer Metrics/StoryTop: Story top position Metrics/StoryTop/Hint: how far the top margin of the story river
is from the top of the page Metrics/StoryRight: Story right From d399543438c543f8fc3dae5921df526d9a6637c4 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Thu, 10 Oct 2024 13:00:57 +0200 Subject: [PATCH 067/147] update tight theme padding --- themes/tiddlywiki/tight/base.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/tiddlywiki/tight/base.tid b/themes/tiddlywiki/tight/base.tid index c58be041426..a39d1d93055 100644 --- a/themes/tiddlywiki/tight/base.tid +++ b/themes/tiddlywiki/tight/base.tid @@ -27,7 +27,7 @@ tags: [[$:/tags/Stylesheet]] } html body.tc-body section.tc-story-river { - padding: 0px; + padding: 0px {{$:/themes/tiddlywiki/tight/metrics/storypaddingright}} 0px {{$:/themes/tiddlywiki/tight/metrics/storypaddingleft}}; } html body.tc-body div.tc-tiddler-frame { From 054d63034a94fcd5c5fbd8b9f4afe117cff93431 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Thu, 10 Oct 2024 13:04:07 +0200 Subject: [PATCH 068/147] update vanilla base --- themes/tiddlywiki/tight/metrics.multids | 3 ++- themes/tiddlywiki/vanilla/base.tid | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/themes/tiddlywiki/tight/metrics.multids b/themes/tiddlywiki/tight/metrics.multids index b93807beb64..8f9b2368dd5 100644 --- a/themes/tiddlywiki/tight/metrics.multids +++ b/themes/tiddlywiki/tight/metrics.multids @@ -1,4 +1,5 @@ title: $:/themes/tiddlywiki/tight/metrics/ storypaddingleft: 0px -storypaddingright: 0px \ No newline at end of file +storypaddingright: 0px +tiddlerwidth: 770px \ No newline at end of file diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index aaeb07e3b93..6254ea310a5 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -3,6 +3,8 @@ tags: [[$:/tags/Stylesheet]] list-before: code-body: yes +\function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] + \define custom-background-datauri() <$set name="background" value={{$:/themes/tiddlywiki/vanilla/settings/backgroundimage}}> <$list filter="[is[image]]"> @@ -1157,7 +1159,7 @@ button.tc-btn-invisible.tc-remove-tag-button { @media (min-width: <>) { .tc-tiddler-frame { padding: 28px 42px 42px 42px; - width: clamp(0px,{{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}},100%); + width: clamp(0px,<>,100%); border-radius: 2px; } From 48ed5dcc95b3199b25ce7f8720d86f8fad2ff4d1 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Thu, 10 Oct 2024 13:42:29 +0200 Subject: [PATCH 069/147] update vanilla base --- core/wiki/macros/sidebar-resizer.tid | 10 ++++++---- themes/tiddlywiki/centralised/metrics.multids | 2 +- themes/tiddlywiki/tight-heavier/metrics.multids | 6 +++++- themes/tiddlywiki/tight/metrics.multids | 5 ++++- themes/tiddlywiki/vanilla/base.tid | 10 +++++----- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index e48dfa04b56..9fcdc01cb63 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -34,6 +34,8 @@ title: $:/core/macros/sidebar-resizer \function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] +\function set.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixis[shadow]] ~[{$:/theme}addsuffix[/]addsuffixis[shadow]!is[missing]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffix] + \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() @@ -110,8 +112,8 @@ title: $:/core/macros/sidebar-resizer tiddlerWidthResult={{{ [match[%]thencompare:number:ltthencompare:number:gteq[0]then] ~[match[%]thencompare:number:gtthen] ~[!match[%]thencompare:number:ltthenaddsuffix] ~[!match[%]thencompare:number:gteqthenaddsuffix] ~[compare:number:lt[0]then[0]addsuffix] ~[addsuffix] }}}> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth" text=<>/> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" text=<>/> + <$action-setfield $tiddler=<> text=<>/> + <$action-setfield $tiddler=<> text=<>/> @@ -123,7 +125,7 @@ title: $:/core/macros/sidebar-resizer result={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}> - <$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text=<>/> + <$action-setfield $tiddler=<> text=<>/> @@ -145,7 +147,7 @@ title: $:/core/macros/sidebar-resizer 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=<> text={{{ [compare:number:gteqthenaddsuffix] ~[compare:number:ltthenaddsuffix] ~[addsuffix] }}}/> \end diff --git a/themes/tiddlywiki/centralised/metrics.multids b/themes/tiddlywiki/centralised/metrics.multids index 21c8764a5d6..78eed8d476d 100644 --- a/themes/tiddlywiki/centralised/metrics.multids +++ b/themes/tiddlywiki/centralised/metrics.multids @@ -4,4 +4,4 @@ sidebarminwidth: 350px storyminwidth: 350px storypaddingleft: 42px storypaddingright: 42px -storywidth: 770px \ No newline at end of file +storywidth: 770px diff --git a/themes/tiddlywiki/tight-heavier/metrics.multids b/themes/tiddlywiki/tight-heavier/metrics.multids index b01e9e647f9..b4b9019d9c2 100644 --- a/themes/tiddlywiki/tight-heavier/metrics.multids +++ b/themes/tiddlywiki/tight-heavier/metrics.multids @@ -1,4 +1,8 @@ title: $:/themes/tiddlywiki/tight-heavier/metrics/ +sidebarwidth: 350px storypaddingleft: 0px -storypaddingright: 0px \ No newline at end of file +storypaddingright: 0px +storyright: 770px +storywidth: 770px +tiddlerwidth: 770px diff --git a/themes/tiddlywiki/tight/metrics.multids b/themes/tiddlywiki/tight/metrics.multids index 8f9b2368dd5..b8728f17b83 100644 --- a/themes/tiddlywiki/tight/metrics.multids +++ b/themes/tiddlywiki/tight/metrics.multids @@ -1,5 +1,8 @@ title: $:/themes/tiddlywiki/tight/metrics/ +sidebarwidth: 350px storypaddingleft: 0px storypaddingright: 0px -tiddlerwidth: 770px \ No newline at end of file +storyright: 770px +storywidth: 770px +tiddlerwidth: 770px diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 6254ea310a5..fce5e2275b5 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1029,7 +1029,7 @@ button.tc-btn-invisible.tc-remove-tag-button { .tc-sidebar-scrollable { position: fixed; top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),{{$:/themes/tiddlywiki/vanilla/metrics/storyright}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); bottom: 0; right: 0; overflow-y: auto; @@ -1041,14 +1041,14 @@ button.tc-btn-invisible.tc-remove-tag-button { html[dir="rtl"] .tc-sidebar-scrollable { left: auto; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),{{$:/themes/tiddlywiki/vanilla/metrics/storyright}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } .tc-story-river { position: relative; left: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; - width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/storywidth}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); padding: 42px {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} 42px {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingleft}}; } @@ -1483,7 +1483,7 @@ html body.tc-body.tc-single-tiddler-window { width: auto; left: 0; margin-left: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); - margin-right: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); + margin-right: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); } .tc-tiddler-frame { @@ -1494,7 +1494,7 @@ html body.tc-body.tc-single-tiddler-window { left: auto; bottom: 0; right: 0; - width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}},(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}})); + width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},<>,(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}})); } body.tc-body .tc-page-container.tc-page-view-zoomin .tc-tiddler-frame { From 7dde829c8dba60e4544f1cc12d2c9d180466a0d3 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Thu, 10 Oct 2024 13:44:49 +0200 Subject: [PATCH 070/147] update tight base --- themes/tiddlywiki/tight/base.tid | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/tiddlywiki/tight/base.tid b/themes/tiddlywiki/tight/base.tid index a39d1d93055..e65673392a7 100644 --- a/themes/tiddlywiki/tight/base.tid +++ b/themes/tiddlywiki/tight/base.tid @@ -105,13 +105,13 @@ tags: [[$:/tags/Stylesheet]] html .tc-sidebar-resizer { width: 12px; - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}}),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}}),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc({{$:/themes/tiddlywiki/tight/metrics/storywidth}}),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/tight/metrics/storywidth}}),calc({{$:/themes/tiddlywiki/tight/metrics/storyright}})),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/tight/metrics/storywidth}} - {{$:/themes/tiddlywiki/tight/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]] %> html .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - {{$:/themes/tiddlywiki/tight/metrics/sidebarwidth}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } <% endif %> From a3a5d6510495e81cafd0a96099283d6c9a0ad1c1 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Thu, 10 Oct 2024 14:10:46 +0200 Subject: [PATCH 071/147] fix --- themes/tiddlywiki/tight/base.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/tiddlywiki/tight/base.tid b/themes/tiddlywiki/tight/base.tid index e65673392a7..c17dea392b6 100644 --- a/themes/tiddlywiki/tight/base.tid +++ b/themes/tiddlywiki/tight/base.tid @@ -41,7 +41,7 @@ tags: [[$:/tags/Stylesheet]] <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> html body.tc-body div.tc-sidebar-scrollable { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc({{$:/themes/tiddlywiki/tight/metrics/storyright}} + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); } <% endif %> From 902a91e667de805a63ab05c179edbaa58d315ae8 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 13 Oct 2024 17:27:20 +0200 Subject: [PATCH 072/147] add refresh throttling to config tiddlers --- core/wiki/macros/sidebar-resizer.tid | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 9fcdc01cb63..2e4cdf2d018 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -32,15 +32,25 @@ title: $:/core/macros/sidebar-resizer \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.theme(metric) [{$:/theme}addsuffix[/]addsuffix!is[missing]] ~[{$:/theme}addsuffix[/]addsuffixis[shadow]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffix] + \function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] \function set.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixis[shadow]] ~[{$:/theme}addsuffix[/]addsuffixis[shadow]!is[missing]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffix] \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 set_theme_throttling(metric) +<$set name="metricsTiddler" value={{{ [function[get.theme],] }}}> + <%if [!has[throttle.refresh]] %> + <$action-setfield $tiddler=<> throttle.refresh="yes"/> + <% endif %> + +\end + \procedure sidebar-resizer-pointerdown-actions() <%if [[$:/state/sidebar/resizing]is[missing]thenmatch[left]] %> - <$vars + <$let startStoryLeft={{{ [get.theme.metric[metrics/storyleft]] }}} startStoryRight={{{ [get.theme.metric[metrics/storyright]] }}} startSidebarWidth={{{ [get.theme.metric[metrics/sidebarwidth]] }}} @@ -61,7 +71,7 @@ title: $:/core/macros/sidebar-resizer start-story-width=<> story-width-metric={{{ [get.value.metric] }}} /> - + <% endif %> \end @@ -142,13 +152,13 @@ title: $:/core/macros/sidebar-resizer clampedDiff={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} sidebarWidth={{{ [subtract] }}}> - <$vars + <$let sidebarWidthConverted={{{ [function[convert.to.result],,] }}} sidebarMaxWidthConverted={{{ [function[convert.to.result],,] }}} sidebarMinWidthConverted={{{ [function[convert.to.result],,] }}}> <$action-setfield $tiddler=<> text={{{ [compare:number:gteqthenaddsuffix] ~[compare:number:ltthenaddsuffix] ~[addsuffix] }}}/> - + \end @@ -180,10 +190,15 @@ title: $:/core/macros/sidebar-resizer <%if [[$:/state/sidebar/resizing]!is[missing]] %> <$let widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}} dragDiff={{{ [subtract{$:/state/sidebar/resizing!!start-posx}] }}} startStoryRight={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyRiverWidth={{{ [add] }}} startSidebarWidth={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-sidebar-width}] }}} sidebarWidth={{{ [subtract] }}}> <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> + <> + <> + <> <> <%elseif [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> + <> <> <%elseif [{$:/theme}match[$:/themes/tiddlywiki/centralised]] %> + <> <> <% endif %> From 4d60f9179387eabaf6774de935743f346cec90a3 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 19 Oct 2024 08:09:39 +0200 Subject: [PATCH 073/147] adjustments for html dir=rtl --- core/modules/widgets/eventcatcher.js | 1 + core/wiki/macros/sidebar-resizer.tid | 32 +++++++++---------- themes/tiddlywiki/vanilla/base.tid | 17 ++++++++++ themes/tiddlywiki/vanilla/sidebar-resizer.tid | 10 ++++++ 4 files changed, 44 insertions(+), 16 deletions(-) diff --git a/core/modules/widgets/eventcatcher.js b/core/modules/widgets/eventcatcher.js index dad9503c69f..75595e2e2fd 100644 --- a/core/modules/widgets/eventcatcher.js +++ b/core/modules/widgets/eventcatcher.js @@ -79,6 +79,7 @@ EventWidget.prototype.render = function(parent,nextSibling) { if(actions) { // Add a variable for the modifier key variables.modifier = $tw.keyboardManager.getEventModifierKeyDescriptor(event); + variables["html-direction"] = domNode.ownerDocument.getElementsByTagName("html")[0].getAttribute("dir") || "ltr"; // Add a variable for the mouse button if("button" in event) { if(event.button === 0) { diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 2e4cdf2d018..f75141eabd8 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -32,13 +32,13 @@ title: $:/core/macros/sidebar-resizer \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.theme(metric) [{$:/theme}addsuffix[/]addsuffix!is[missing]] ~[{$:/theme}addsuffix[/]addsuffixis[shadow]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffix] +\function get.theme(metric) [{$:/theme}addsuffix[/]addsuffix!is[missing]] :else[{$:/theme}addsuffix[/]addsuffixis[shadow]] :else[[$:/themes/tiddlywiki/vanilla/]addsuffix] -\function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] +\function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] :else[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] -\function set.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixis[shadow]] ~[{$:/theme}addsuffix[/]addsuffixis[shadow]!is[missing]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffix] +\function set.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixis[shadow]] :else[{$:/theme}addsuffix[/]addsuffixis[shadow]!is[missing]] :else[[$:/themes/tiddlywiki/vanilla/]addsuffix] -\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]] +\function get.value.metric(value) [suffix[px]then[px]] :else[suffix[%]then[%]] :else[suffix[cm]then[cm]] :else[suffix[mm]then[mm]] :else[suffix[Q]then[Q]] :else[suffix[in]then[in]] :else[suffix[pc]then[pc]] :else[suffix[pt]then[pt]] :else[suffix[em]then[em]] \procedure set_theme_throttling(metric) <$set name="metricsTiddler" value={{{ [function[get.theme],] }}}> @@ -101,12 +101,12 @@ title: $:/core/macros/sidebar-resizer storyMaxWidth={{{ [subtract] }}} tiddlerWidthMetric={{$:/state/sidebar/resizing!!tiddler-width-metric}} tiddlerWidthStart={{$:/state/sidebar/resizing!!start-tiddler-width}} - tiddlerWidthStartPixels={{{ [match[%]thenmultiplydivide[100]] ~[convert.to.pixels] }}} + tiddlerWidthStartPixels={{{ [match[%]thenmultiplydivide[100]] :else[convert.to.pixels] }}} tiddlerWidthClampedDiff={{{ [addaddaddaddsubtractcompare:number:gt[0]] ~0 }}} tiddlerWidth={{{ [addsubtract] }}} tiddlerWidthDiff={{{ [subtract] }}} - tiddlerMinWidth={{{ [match[%]then] ~[subtract] }}} - tiddlerMaxWidth={{{ [match[%]then] ~[subtract] }}} + tiddlerMinWidth={{{ [match[%]then] :else[subtract] }}} + tiddlerMaxWidth={{{ [match[%]then] :else[subtract] }}} storyRiverWidth={{{ [subtract] }}}> <$let @@ -114,13 +114,13 @@ title: $:/core/macros/sidebar-resizer storyWidthConverted={{{ [function[convert.to.result],,] }}} storyMinWidthConverted={{{ [function[convert.to.result],,] }}} storyMaxWidthConverted={{{ [function[convert.to.result],,] }}} - tiddlerWidthConverted={{{ [match[%]thenmultiply[100]divide] ~[function[convert.to.result],,] }}} - tiddlerMinWidthConverted={{{ [match[%]thenmultiply[100]divide] ~[function[convert.to.result],,] }}} - tiddlerMaxWidthConverted={{{ [match[%]thenmultiply[100]divide] ~[function[convert.to.result],,] }}} + tiddlerWidthConverted={{{ [match[%]thenmultiply[100]divide] :else[function[convert.to.result],,] }}} + tiddlerMinWidthConverted={{{ [match[%]thenmultiply[100]divide] :else[function[convert.to.result],,] }}} + tiddlerMaxWidthConverted={{{ [match[%]thenmultiply[100]divide] :else[function[convert.to.result],,] }}} - storyWidthResult={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}} + storyWidthResult={{{ [compare:number:ltthenaddsuffix] :else[compare:number:gteqthenaddsuffix] :else[addsuffix] }}} - tiddlerWidthResult={{{ [match[%]thencompare:number:ltthencompare:number:gteq[0]then] ~[match[%]thencompare:number:gtthen] ~[!match[%]thencompare:number:ltthenaddsuffix] ~[!match[%]thencompare:number:gteqthenaddsuffix] ~[compare:number:lt[0]then[0]addsuffix] ~[addsuffix] }}}> + tiddlerWidthResult={{{ [match[%]thencompare:number:ltthencompare:number:gteq[0]then] :else[match[%]thencompare:number:gtthen] :else[!match[%]thencompare:number:ltthenaddsuffix] :else[!match[%]thencompare:number:gteqthenaddsuffix] :else[compare:number:lt[0]then[0]addsuffix] :else[addsuffix] }}}> <$action-setfield $tiddler=<> text=<>/> <$action-setfield $tiddler=<> text=<>/> @@ -133,7 +133,7 @@ title: $:/core/macros/sidebar-resizer storyRiverLimitConverted={{{ [function[convert.to.result],,] }}} storyMinWidthAddLeftConverted={{{ [function[convert.to.result],,] }}} - result={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}> + result={{{ [compare:number:ltthenaddsuffix] :else[compare:number:gteqthenaddsuffix] :else[addsuffix] }}}> <$action-setfield $tiddler=<> text=<>/> @@ -157,7 +157,7 @@ title: $:/core/macros/sidebar-resizer sidebarMaxWidthConverted={{{ [function[convert.to.result],,] }}} sidebarMinWidthConverted={{{ [function[convert.to.result],,] }}}> - <$action-setfield $tiddler=<> text={{{ [compare:number:gteqthenaddsuffix] ~[compare:number:ltthenaddsuffix] ~[addsuffix] }}}/> + <$action-setfield $tiddler=<> text={{{ [compare:number:gteqthenaddsuffix] :else[compare:number:ltthenaddsuffix] :else[addsuffix] }}}/> \end @@ -179,7 +179,7 @@ title: $:/core/macros/sidebar-resizer storyMinWidthConverted={{{ [function[convert.to.result],,] }}} storyMaxWidthConverted={{{ [function[convert.to.result],,] }}}> - <$action-setfield $tiddler="$:/themes/tiddlywiki/centralised/metrics/storywidth" text={{{ [compare:number:ltthenaddsuffix] ~[compare:number:gteqthenaddsuffix] ~[addsuffix] }}}/> + <$action-setfield $tiddler="$:/themes/tiddlywiki/centralised/metrics/storywidth" text={{{ [compare:number:ltthenaddsuffix] :else[compare:number:gteqthenaddsuffix] :else[addsuffix] }}}/> @@ -188,7 +188,7 @@ title: $:/core/macros/sidebar-resizer \procedure sidebar-resizer-pointermove-actions() <%if [[$:/state/sidebar/resizing]!is[missing]] %> - <$let widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}} dragDiff={{{ [subtract{$:/state/sidebar/resizing!!start-posx}] }}} startStoryRight={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyRiverWidth={{{ [add] }}} startSidebarWidth={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-sidebar-width}] }}} sidebarWidth={{{ [subtract] }}}> + <$let widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}} dragDiff={{{ [!match[rtl]thensubtract{$:/state/sidebar/resizing!!start-posx}] :else[subtract{$:/state/sidebar/resizing!!start-posx}multiply[-1]] }}} startStoryRight={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyRiverWidth={{{ [add] }}} startSidebarWidth={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-sidebar-width}] }}} sidebarWidth={{{ [subtract] }}}> <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> <> <> diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index fce5e2275b5..65c2dd23676 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1052,6 +1052,11 @@ button.tc-btn-invisible.tc-remove-tag-button { padding: 42px {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} 42px {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingleft}}; } + html[dir="rtl"] .tc-story-river { + left: auto; + right: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); + } + <>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); } + html[dir="rtl"] .tc-story-river { + margin-right: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); + margin-left: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); + padding-right: <>; + padding-left: 0; + } + .tc-tiddler-frame { width: 100%; } @@ -1497,6 +1509,11 @@ html body.tc-body.tc-single-tiddler-window { width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},<>,(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}})); } + html[dir="rtl"] .tc-sidebar-scrollable { + left: 0; + right: auto; + } + body.tc-body .tc-page-container.tc-page-view-zoomin .tc-tiddler-frame { width: 100%; width: calc(100% - 42px); diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index d63c47501cb..d87aa81161f 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -86,12 +86,22 @@ code-body: yes left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); } + html[dir="rtl"] .tc-sidebar-resizer { + left: auto; + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + } + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]] %> .tc-sidebar-resizer { left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); } + html[dir="rtl"] .tc-sidebar-resizer { + left: auto; + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + } + <% endif %> <%if [{$:/state/sidebar}match[no]] %> From b9c70fe8f2c405b8e196c0403a2c1685df99ee7b Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 19 Oct 2024 08:46:57 +0200 Subject: [PATCH 074/147] more adjustments for html dir=rtl --- themes/tiddlywiki/centralised/styles.tid | 22 +++++++++++++++ themes/tiddlywiki/tight/base.tid | 15 ++++++++++ themes/tiddlywiki/vanilla/sidebar-resizer.tid | 28 +++++++++++-------- 3 files changed, 53 insertions(+), 12 deletions(-) diff --git a/themes/tiddlywiki/centralised/styles.tid b/themes/tiddlywiki/centralised/styles.tid index 410a97c23ad..3082735912a 100644 --- a/themes/tiddlywiki/centralised/styles.tid +++ b/themes/tiddlywiki/centralised/styles.tid @@ -17,6 +17,13 @@ tags: [[$:/tags/Stylesheet]] text-align: left; } + html[dir="rtl"] .tc-story-river { + text-align: right; + margin: 0 auto; + padding-right: {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}}; + padding-left: {{$:/themes/tiddlywiki/centralised/metrics/storypaddingleft}}; + } + html .tc-sidebar-scrollable { text-align: left; left: 50%; @@ -25,6 +32,16 @@ tags: [[$:/tags/Stylesheet]] width: auto; } + html[dir="rtl"] .tc-sidebar-scrollable { + text-align: right; + margin-left: 0; + right: 50%; + left: 0; + margin-right: min(calc((100% - (2 * {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}})) / 2 - 42px),calc({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2 - 42px)); + padding-right: 42px; + padding-left: 0; + } + html .tc-tiddler-frame { width: 100%; } @@ -32,4 +49,9 @@ tags: [[$:/tags/Stylesheet]] html .tc-sidebar-resizer { left: min(calc(50% + ({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2) - (2 * {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}} / 3))); } + + html[dir="rtl"] .tc-sidebar-resizer { + left: auto; + right: min(calc(50% + ({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2) - (2 * {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}} / 3))); + } } diff --git a/themes/tiddlywiki/tight/base.tid b/themes/tiddlywiki/tight/base.tid index c17dea392b6..43a950291a7 100644 --- a/themes/tiddlywiki/tight/base.tid +++ b/themes/tiddlywiki/tight/base.tid @@ -44,6 +44,11 @@ tags: [[$:/tags/Stylesheet]] left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc({{$:/themes/tiddlywiki/tight/metrics/storyright}} + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); } + html[dir="rtl"] body.tc-body div.tc-sidebar-scrollable { + left: 0; + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc({{$:/themes/tiddlywiki/tight/metrics/storyright}} + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); + } + <% endif %> html body.tc-body .tc-tiddler-frame .tc-subtitle { @@ -108,12 +113,22 @@ tags: [[$:/tags/Stylesheet]] left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc({{$:/themes/tiddlywiki/tight/metrics/storywidth}}),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/tight/metrics/storywidth}}),calc({{$:/themes/tiddlywiki/tight/metrics/storyright}})),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/tight/metrics/storywidth}} - {{$:/themes/tiddlywiki/tight/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } + html[dir="rtl"] .tc-sidebar-resizer { + left: auto; + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc({{$:/themes/tiddlywiki/tight/metrics/storywidth}}),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/tight/metrics/storywidth}}),calc({{$:/themes/tiddlywiki/tight/metrics/storyright}})),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/tight/metrics/storywidth}} - {{$:/themes/tiddlywiki/tight/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + } + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]] %> html .tc-sidebar-resizer { left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - {{$:/themes/tiddlywiki/tight/metrics/sidebarwidth}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } + html[dir="rtl"] .tc-sidebar-resizer { + left: auto; + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - {{$:/themes/tiddlywiki/tight/metrics/sidebarwidth}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + } + <% endif %> } diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index d87aa81161f..47eb59fefec 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -82,26 +82,30 @@ code-body: yes <% endif %> - .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); - } - - html[dir="rtl"] .tc-sidebar-resizer { - left: auto; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); - } - - <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]] %> + <%if [{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); } html[dir="rtl"] .tc-sidebar-resizer { left: auto; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); } + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]] %> + + .tc-sidebar-resizer { + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + } + + html[dir="rtl"] .tc-sidebar-resizer { + left: auto; + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + } + + <% endif %> + <% endif %> <%if [{$:/state/sidebar}match[no]] %> From e217b1a3ba92465442e63ad64c774d7834510f18 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 19 Oct 2024 09:17:44 +0200 Subject: [PATCH 075/147] add docs --- editions/tw5.com/tiddlers/widgets/EventCatcherWidget.tid | 1 + 1 file changed, 1 insertion(+) diff --git a/editions/tw5.com/tiddlers/widgets/EventCatcherWidget.tid b/editions/tw5.com/tiddlers/widgets/EventCatcherWidget.tid index 870f15c8a7e..a3777a2f3a5 100644 --- a/editions/tw5.com/tiddlers/widgets/EventCatcherWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/EventCatcherWidget.tid @@ -42,6 +42,7 @@ The content of the `<$eventcatcher>` widget is displayed normally. The following variables are made available to the actions: |!Variables |!Description | +|`html-direction` |<<.from-version "5.3.6">> The value of the ''dir'' attribute on the `html` element | |`dom-*` |All DOM attributes of the node matching the given selector are made available as variables, with the prefix `dom-` | |`modifier` |The [[modifier Variable]] contains the Modifier Key held during the event (can be "normal", "ctrl", "shift", "alt" or combinations thereof) | |`event-mousebutton` |The mouse button (if any) used to trigger the event (can be "left", "right" or "middle"). Note that not all event types support the mousebutton property | From a94d49617219e88ea98630d9bda398cfce7fdfd4 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 19 Oct 2024 09:36:52 +0200 Subject: [PATCH 076/147] make showing the sidebar resizer configurable and hide by default --- core/language/en-GB/ThemeTweaks.multids | 1 + core/ui/PageTemplate/sidebar-resizer.tid | 4 ++++ themes/tiddlywiki/vanilla/ThemeTweaks.tid | 1 + themes/tiddlywiki/vanilla/options.multids | 1 + 4 files changed, 7 insertions(+) diff --git a/core/language/en-GB/ThemeTweaks.multids b/core/language/en-GB/ThemeTweaks.multids index 9d023932ec0..7c7cd4bd458 100644 --- a/core/language/en-GB/ThemeTweaks.multids +++ b/core/language/en-GB/ThemeTweaks.multids @@ -21,6 +21,7 @@ Settings/BackgroundImageSize: Page background image size Settings/BackgroundImageSize/Auto: Auto Settings/BackgroundImageSize/Cover: Cover Settings/BackgroundImageSize/Contain: Contain +Settings/SidebarResizer: Sidebar resizer Metrics: Sizes Metrics/FontSize: Font size Metrics/LineHeight: Line height diff --git a/core/ui/PageTemplate/sidebar-resizer.tid b/core/ui/PageTemplate/sidebar-resizer.tid index efe0ac56dda..6034826b4f9 100644 --- a/core/ui/PageTemplate/sidebar-resizer.tid +++ b/core/ui/PageTemplate/sidebar-resizer.tid @@ -5,6 +5,8 @@ list-after: $:/core/ui/PageTemplate/story \import $:/core/macros/sidebar-resizer \whitespace trim +<%if [{$:/themes/tiddlywiki/vanilla/options/sidebarresizer}match[show]] %> + <$eventcatcher tag="div" class="tc-sidebar-resizer-pointerdown-eventcatcher" selector=".tc-sidebar-resizer" matchSelector=".tc-sidebar-resizer" $pointerdown=<> $pointerup=<>> <%if [{$:/state/sidebar}!match[no]] %> @@ -24,3 +26,5 @@ list-after: $:/core/ui/PageTemplate/story <% endif %> + +<% endif %> diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid index 22a99f0f050..27d3d65374e 100644 --- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid +++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid @@ -54,6 +54,7 @@ caption: {{$:/language/ThemeTweaks/ThemeTweaks}} |<$link to="$:/themes/tiddlywiki/vanilla/options/sidebarlayout"><> |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/sidebarlayout"> | |<$link to="$:/themes/tiddlywiki/vanilla/options/stickytitles"><>
//<>// |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/stickytitles"> | |<$link to="$:/themes/tiddlywiki/vanilla/options/codewrapping"><> |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/codewrapping"> | +|<$link to="$:/themes/tiddlywiki/vanilla/options/sidebarresizer"><> |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/sidebarresizer"> | ! <> diff --git a/themes/tiddlywiki/vanilla/options.multids b/themes/tiddlywiki/vanilla/options.multids index c0b49d96110..361546a81ae 100644 --- a/themes/tiddlywiki/vanilla/options.multids +++ b/themes/tiddlywiki/vanilla/options.multids @@ -2,4 +2,5 @@ title: $:/themes/tiddlywiki/vanilla/options/ stickytitles: no sidebarlayout: fixed-fluid +sidebarresizer: hide codewrapping: pre-wrap From 0bf23494a051a44e188b4351d8edbae72fd1951b Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 20 Oct 2024 17:19:40 +0200 Subject: [PATCH 077/147] more adjustments for html dir=rtl + show sidebar on the left (configurable) --- core/language/en-GB/Misc.multids | 2 + core/language/en-GB/ThemeTweaks.multids | 3 +- core/ui/PageTemplateClassFilters.tid | 4 ++ core/wiki/macros/sidebar-resizer.tid | 4 +- themes/tiddlywiki/centralised/styles.tid | 12 +++-- themes/tiddlywiki/tight/base.tid | 10 ++-- themes/tiddlywiki/vanilla/ThemeTweaks.tid | 3 +- themes/tiddlywiki/vanilla/base.tid | 51 ++++++++++++++++--- themes/tiddlywiki/vanilla/options.multids | 5 +- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 4 +- 10 files changed, 74 insertions(+), 24 deletions(-) create mode 100644 core/ui/PageTemplateClassFilters.tid diff --git a/core/language/en-GB/Misc.multids b/core/language/en-GB/Misc.multids index d8c0913750d..eb295000c11 100644 --- a/core/language/en-GB/Misc.multids +++ b/core/language/en-GB/Misc.multids @@ -47,6 +47,7 @@ InternalJavaScriptError/Title: Internal JavaScript Error InternalJavaScriptError/Hint: Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser LayoutSwitcher/Description: Open the layout switcher LazyLoadingWarning:

Trying to load external content from ''<$text text={{!!_canonical_uri}}/>''

If this message doesn't disappear, either the tiddler content type doesn't match the type of the external content, or you may be using a browser that doesn't support external content for wikis loaded as standalone files. See https://tiddlywiki.com/#ExternalText

+Left: Left LoginToTiddlySpace: Login to TiddlySpace Manager/Controls/FilterByTag/None: (none) Manager/Controls/FilterByTag/Prompt: Filter by tag: @@ -73,6 +74,7 @@ PageTemplate/Description: the default ~TiddlyWiki layout PageTemplate/Name: Standard Layout PluginReloadWarning: Please save {{$:/core/ui/Buttons/save-wiki}} and reload {{$:/core/ui/Buttons/refresh}} to allow changes to ~JavaScript plugins to take effect RecentChanges/DateFormat: DDth MMM YYYY +Right: Right Shortcuts/Input/AdvancedSearch/Hint: Open the ~AdvancedSearch panel from within the sidebar search field Shortcuts/Input/Accept/Hint: Accept the selected item Shortcuts/Input/AcceptVariant/Hint: Accept the selected item (variant) diff --git a/core/language/en-GB/ThemeTweaks.multids b/core/language/en-GB/ThemeTweaks.multids index 7c7cd4bd458..249fb7f3d55 100644 --- a/core/language/en-GB/ThemeTweaks.multids +++ b/core/language/en-GB/ThemeTweaks.multids @@ -6,6 +6,8 @@ Options: Options Options/SidebarLayout: Sidebar layout Options/SidebarLayout/Fixed-Fluid: Fixed story, fluid sidebar Options/SidebarLayout/Fluid-Fixed: Fluid story, fixed sidebar +Options/SidebarPosition: Sidebar position +Options/SidebarResizer: Sidebar resizer Options/StickyTitles: Sticky titles Options/StickyTitles/Hint: Causes tiddler titles to "stick" to the top of the browser window Options/CodeWrapping: Wrap long lines in code blocks @@ -21,7 +23,6 @@ Settings/BackgroundImageSize: Page background image size Settings/BackgroundImageSize/Auto: Auto Settings/BackgroundImageSize/Cover: Cover Settings/BackgroundImageSize/Contain: Contain -Settings/SidebarResizer: Sidebar resizer Metrics: Sizes Metrics/FontSize: Font size Metrics/LineHeight: Line height diff --git a/core/ui/PageTemplateClassFilters.tid b/core/ui/PageTemplateClassFilters.tid new file mode 100644 index 00000000000..fbe2660cdfc --- /dev/null +++ b/core/ui/PageTemplateClassFilters.tid @@ -0,0 +1,4 @@ +title: $:/core/ui/PageTemplateClassFilters +tags: $:/tags/ClassFilters/PageTemplate + +[{$:/themes/tiddlywiki/vanilla/options/sidebarposition}match[left]then[tc-sidebar-left]] \ No newline at end of file diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index f75141eabd8..7b0bd918a4b 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -186,9 +186,11 @@ title: $:/core/macros/sidebar-resizer \end +\function get.drag.diff() [subtract{$:/state/sidebar/resizing!!start-posx}] :map[{$:/themes/tiddlywiki/vanilla/options/sidebarposition}match[left]thenmultiply[-1]else] + \procedure sidebar-resizer-pointermove-actions() <%if [[$:/state/sidebar/resizing]!is[missing]] %> - <$let widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}} dragDiff={{{ [!match[rtl]thensubtract{$:/state/sidebar/resizing!!start-posx}] :else[subtract{$:/state/sidebar/resizing!!start-posx}multiply[-1]] }}} startStoryRight={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyRiverWidth={{{ [add] }}} startSidebarWidth={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-sidebar-width}] }}} sidebarWidth={{{ [subtract] }}}> + <$let widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}} dragDiff=<> startStoryRight={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyRiverWidth={{{ [add] }}} startSidebarWidth={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-sidebar-width}] }}} sidebarWidth={{{ [subtract] }}}> <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> <> <> diff --git a/themes/tiddlywiki/centralised/styles.tid b/themes/tiddlywiki/centralised/styles.tid index 3082735912a..eeb35cafab1 100644 --- a/themes/tiddlywiki/centralised/styles.tid +++ b/themes/tiddlywiki/centralised/styles.tid @@ -17,13 +17,16 @@ tags: [[$:/tags/Stylesheet]] text-align: left; } - html[dir="rtl"] .tc-story-river { - text-align: right; + html body.tc-body .tc-sidebar-left .tc-story-river { margin: 0 auto; padding-right: {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}}; padding-left: {{$:/themes/tiddlywiki/centralised/metrics/storypaddingleft}}; } + html[dir="rtl"] .tc-story-river, html[dir="rtl"] .tc-sidebar-scrollable { + text-align: right; + } + html .tc-sidebar-scrollable { text-align: left; left: 50%; @@ -32,8 +35,7 @@ tags: [[$:/tags/Stylesheet]] width: auto; } - html[dir="rtl"] .tc-sidebar-scrollable { - text-align: right; + body.tc-body .tc-sidebar-left .tc-sidebar-scrollable { margin-left: 0; right: 50%; left: 0; @@ -50,7 +52,7 @@ tags: [[$:/tags/Stylesheet]] left: min(calc(50% + ({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2) - (2 * {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}} / 3))); } - html[dir="rtl"] .tc-sidebar-resizer { + html body.tc-body .tc-sidebar-left .tc-sidebar-resizer { left: auto; right: min(calc(50% + ({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2) - (2 * {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}} / 3))); } diff --git a/themes/tiddlywiki/tight/base.tid b/themes/tiddlywiki/tight/base.tid index 43a950291a7..38c5e993330 100644 --- a/themes/tiddlywiki/tight/base.tid +++ b/themes/tiddlywiki/tight/base.tid @@ -44,7 +44,7 @@ tags: [[$:/tags/Stylesheet]] left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc({{$:/themes/tiddlywiki/tight/metrics/storyright}} + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); } - html[dir="rtl"] body.tc-body div.tc-sidebar-scrollable { + html body.tc-body .tc-sidebar-left div.tc-sidebar-scrollable { left: 0; right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc({{$:/themes/tiddlywiki/tight/metrics/storyright}} + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); } @@ -108,23 +108,23 @@ tags: [[$:/tags/Stylesheet]] margin-top: -4px; } - html .tc-sidebar-resizer { + html body.tc-body .tc-sidebar-resizer { width: 12px; left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc({{$:/themes/tiddlywiki/tight/metrics/storywidth}}),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/tight/metrics/storywidth}}),calc({{$:/themes/tiddlywiki/tight/metrics/storyright}})),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/tight/metrics/storywidth}} - {{$:/themes/tiddlywiki/tight/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } - html[dir="rtl"] .tc-sidebar-resizer { + html body.tc-body .tc-sidebar-left .tc-sidebar-resizer { left: auto; right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc({{$:/themes/tiddlywiki/tight/metrics/storywidth}}),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/tight/metrics/storywidth}}),calc({{$:/themes/tiddlywiki/tight/metrics/storyright}})),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/tight/metrics/storywidth}} - {{$:/themes/tiddlywiki/tight/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]] %> - html .tc-sidebar-resizer { + html body.tc-body .tc-sidebar-resizer { left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - {{$:/themes/tiddlywiki/tight/metrics/sidebarwidth}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } - html[dir="rtl"] .tc-sidebar-resizer { + html body.tc-body .tc-sidebar-left .tc-sidebar-resizer { left: auto; right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - {{$:/themes/tiddlywiki/tight/metrics/sidebarwidth}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid index 27d3d65374e..ccaff266c73 100644 --- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid +++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid @@ -54,7 +54,8 @@ caption: {{$:/language/ThemeTweaks/ThemeTweaks}} |<$link to="$:/themes/tiddlywiki/vanilla/options/sidebarlayout"><> |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/sidebarlayout"> | |<$link to="$:/themes/tiddlywiki/vanilla/options/stickytitles"><>
//<>// |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/stickytitles"> | |<$link to="$:/themes/tiddlywiki/vanilla/options/codewrapping"><> |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/codewrapping"> | -|<$link to="$:/themes/tiddlywiki/vanilla/options/sidebarresizer"><> |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/sidebarresizer"> | +|<$link to="$:/themes/tiddlywiki/vanilla/options/sidebarposition"><> |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/sidebarposition"> | +|<$link to="$:/themes/tiddlywiki/vanilla/options/sidebarresizer"><> |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/sidebarresizer"> | ! <> diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 65c2dd23676..f7f954d1cad 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1039,24 +1039,38 @@ button.tc-btn-invisible.tc-remove-tag-button { padding: 71px 0 28px 42px; } - html[dir="rtl"] .tc-sidebar-scrollable { - left: auto; + .tc-sidebar-left .tc-sidebar-scrollable { + left: 0; right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + margin: 0 0 0 0; + } + + html[dir="rtl"] .tc-sidebar-scrollable { + padding-left: 0; + } + + html[dir="rtl"] .tc-sidebar-scrollable:not(.tc-sidebar-left .tc-sidebar-scrollable) { + padding-right: 42px; + padding-left: 0; } .tc-story-river { - position: relative; left: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}),calc(100% - <> - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); padding: 42px {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} 42px {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingleft}}; } - html[dir="rtl"] .tc-story-river { - left: auto; + .tc-sidebar-left .tc-story-river { + left: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},calc(100% - <> - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); right: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); } + html[dir="rtl"] .tc-story-river:not(.tc-sidebar-left .tc-story-river) { + + } + <> @@ -1491,13 +1512,20 @@ html body.tc-body.tc-single-tiddler-window { margin-right: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); } - html[dir="rtl"] .tc-story-river { + .tc-sidebar-left .tc-story-river { margin-right: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); margin-left: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); + left: auto; + right: 0; padding-right: <>; padding-left: 0; } + html[dir="rtl"] .tc-story-river:not(.tc-sidebar-left .tc-story-river) { + left: auto; + right: 0; + } + .tc-tiddler-frame { width: 100%; } @@ -1509,11 +1537,20 @@ html body.tc-body.tc-single-tiddler-window { width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},<>,(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}})); } - html[dir="rtl"] .tc-sidebar-scrollable { + .tc-sidebar-left .tc-sidebar-scrollable { left: 0; right: auto; } + html[dir="rtl"] .tc-sidebar-left .tc-sidebar-scrollable { + padding-right: 42px; + } + + html[dir="rtl"] .tc-sidebar-scrollable:not(.tc-sidebar-left .tc-sidebar-scrollable) { + padding-right: 42px; + padding-left: 0; + } + body.tc-body .tc-page-container.tc-page-view-zoomin .tc-tiddler-frame { width: 100%; width: calc(100% - 42px); diff --git a/themes/tiddlywiki/vanilla/options.multids b/themes/tiddlywiki/vanilla/options.multids index 361546a81ae..cfcd41ca8e3 100644 --- a/themes/tiddlywiki/vanilla/options.multids +++ b/themes/tiddlywiki/vanilla/options.multids @@ -1,6 +1,7 @@ title: $:/themes/tiddlywiki/vanilla/options/ -stickytitles: no +codewrapping: pre-wrap sidebarlayout: fixed-fluid +sidebarposition: right sidebarresizer: hide -codewrapping: pre-wrap +stickytitles: no diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index 47eb59fefec..142887e89ac 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -88,7 +88,7 @@ code-body: yes left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); } - html[dir="rtl"] .tc-sidebar-resizer { + .tc-sidebar-left .tc-sidebar-resizer { left: auto; right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); } @@ -99,7 +99,7 @@ code-body: yes left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); } - html[dir="rtl"] .tc-sidebar-resizer { + .tc-sidebar-left .tc-sidebar-resizer { left: auto; right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); } From 140d43500b574235d7dd4a1c5f4f8624bff54680 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 20 Oct 2024 17:41:19 +0200 Subject: [PATCH 078/147] further adjustments for rtl and sidebar left --- themes/tiddlywiki/tight/base.tid | 8 +++++++- themes/tiddlywiki/vanilla/base.tid | 30 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/themes/tiddlywiki/tight/base.tid b/themes/tiddlywiki/tight/base.tid index 38c5e993330..7a8e4350643 100644 --- a/themes/tiddlywiki/tight/base.tid +++ b/themes/tiddlywiki/tight/base.tid @@ -34,10 +34,14 @@ tags: [[$:/tags/Stylesheet]] padding: 12px; } - html body.tc-body div.tc-sidebar-scrollable { + html body.tc-body div.tc-sidebar-scrollable, html[dir="rtl"] body.tc-body div.tc-sidebar-scrollable { padding: 12px 0 12px 12px; } + html body.tc-body .tc-sidebar-left div.tc-sidebar-scrollable, html[dir="rtl"] body.tc-body .tc-sidebar-left div.tc-sidebar-scrollable { + padding: 12px 12px 12px 0; + } + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> html body.tc-body div.tc-sidebar-scrollable { @@ -110,6 +114,7 @@ tags: [[$:/tags/Stylesheet]] html body.tc-body .tc-sidebar-resizer { width: 12px; + right: auto; left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc({{$:/themes/tiddlywiki/tight/metrics/storywidth}}),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/tight/metrics/storywidth}}),calc({{$:/themes/tiddlywiki/tight/metrics/storyright}})),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/tight/metrics/storywidth}} - {{$:/themes/tiddlywiki/tight/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } @@ -122,6 +127,7 @@ tags: [[$:/tags/Stylesheet]] html body.tc-body .tc-sidebar-resizer { left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - {{$:/themes/tiddlywiki/tight/metrics/sidebarwidth}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + right: auto; } html body.tc-body .tc-sidebar-left .tc-sidebar-resizer { diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index f7f954d1cad..2af741965aa 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -3615,6 +3615,36 @@ span.tc-translink > a:first-child { word-break: break-all; } +html[dir="rtl"] .tc-tiny-gap-left { + margin-right: .25em; + margin-left: auto; +} + +html[dir="rtl"] .tc-tiny-gap-right { + margin-left: .25em; + margin-right: auto; +} + +html[dir="rtl"] .tc-small-gap-left { + margin-right: .5em; + margin-left: auto; +} + +html[dir="rtl"] .tc-small-gap-right { + margin-left: .5em; + margin-right: auto; +} + +html[dir="rtl"] .tc-big-gap-left { + margin-right: 1em; + margin-left: auto; +} + +html[dir="rtl"] .tc-big-gap-right { + margin-left: 1em; + margin-right: auto; +} + /* Vertical gaps */ .tc-tiny-v-gap-bottom { From fa42e6c10abc58dedeb80dad7e38a0b038015cfb Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 20 Oct 2024 19:24:02 +0200 Subject: [PATCH 079/147] fixes for sidebar hidden --- themes/tiddlywiki/centralised/styles.tid | 13 +++++++++---- themes/tiddlywiki/vanilla/base.tid | 24 ++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/themes/tiddlywiki/centralised/styles.tid b/themes/tiddlywiki/centralised/styles.tid index eeb35cafab1..72a80e8c608 100644 --- a/themes/tiddlywiki/centralised/styles.tid +++ b/themes/tiddlywiki/centralised/styles.tid @@ -23,10 +23,6 @@ tags: [[$:/tags/Stylesheet]] padding-left: {{$:/themes/tiddlywiki/centralised/metrics/storypaddingleft}}; } - html[dir="rtl"] .tc-story-river, html[dir="rtl"] .tc-sidebar-scrollable { - text-align: right; - } - html .tc-sidebar-scrollable { text-align: left; left: 50%; @@ -40,10 +36,19 @@ tags: [[$:/tags/Stylesheet]] right: 50%; left: 0; margin-right: min(calc((100% - (2 * {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}})) / 2 - 42px),calc({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2 - 42px)); + padding-right: 0px; + padding-left: 42px; + } + + html[dir="rtl"] .tc-sidebar-left .tc-sidebar-scrollable { padding-right: 42px; padding-left: 0; } + html[dir="rtl"] .tc-story-river, html[dir="rtl"] .tc-sidebar-scrollable { + text-align: right; + } + html .tc-tiddler-frame { width: 100%; } diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 2af741965aa..2184de39c54 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1071,13 +1071,23 @@ button.tc-btn-invisible.tc-remove-tag-button { } -<> + .tc-sidebar-left .tc-story-river { + left: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); + right: 0; + } + + html[dir="rtl"] .tc-sidebar-left .tc-story-river { + left: 0; + right: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); + } + +""">> .tc-story-river.tc-static-story-river { margin-right: 0; @@ -1563,6 +1573,16 @@ html body.tc-body.tc-single-tiddler-window { margin-right: 0; } + .tc-sidebar-left .tc-story-river { + margin-left: max(<>,calc(<> + {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}})); + margin-right: 0; + } + + html[dir="rtl"] .tc-sidebar-left .tc-story-river { + margin-left: 0; + margin-right: max(<>,calc(<> + {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}})); + } + body.tc-body .tc-page-container.tc-page-view-zoomin .tc-tiddler-frame { width: 100%; width: calc(100% - 84px); From 4d864936375e3592b093f4a463909c9f0eae466d Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 20 Oct 2024 19:55:11 +0200 Subject: [PATCH 080/147] remove unused html-direction variable --- core/modules/widgets/eventcatcher.js | 1 - editions/tw5.com/tiddlers/widgets/EventCatcherWidget.tid | 1 - 2 files changed, 2 deletions(-) diff --git a/core/modules/widgets/eventcatcher.js b/core/modules/widgets/eventcatcher.js index 75595e2e2fd..dad9503c69f 100644 --- a/core/modules/widgets/eventcatcher.js +++ b/core/modules/widgets/eventcatcher.js @@ -79,7 +79,6 @@ EventWidget.prototype.render = function(parent,nextSibling) { if(actions) { // Add a variable for the modifier key variables.modifier = $tw.keyboardManager.getEventModifierKeyDescriptor(event); - variables["html-direction"] = domNode.ownerDocument.getElementsByTagName("html")[0].getAttribute("dir") || "ltr"; // Add a variable for the mouse button if("button" in event) { if(event.button === 0) { diff --git a/editions/tw5.com/tiddlers/widgets/EventCatcherWidget.tid b/editions/tw5.com/tiddlers/widgets/EventCatcherWidget.tid index a3777a2f3a5..870f15c8a7e 100644 --- a/editions/tw5.com/tiddlers/widgets/EventCatcherWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/EventCatcherWidget.tid @@ -42,7 +42,6 @@ The content of the `<$eventcatcher>` widget is displayed normally. The following variables are made available to the actions: |!Variables |!Description | -|`html-direction` |<<.from-version "5.3.6">> The value of the ''dir'' attribute on the `html` element | |`dom-*` |All DOM attributes of the node matching the given selector are made available as variables, with the prefix `dom-` | |`modifier` |The [[modifier Variable]] contains the Modifier Key held during the event (can be "normal", "ctrl", "shift", "alt" or combinations thereof) | |`event-mousebutton` |The mouse button (if any) used to trigger the event (can be "left", "right" or "middle"). Note that not all event types support the mousebutton property | From 89623ddb1f8099fcdab3792dfa430c6e727b2638 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Mon, 21 Oct 2024 05:30:32 +0200 Subject: [PATCH 081/147] small css fix for tight theme --- themes/tiddlywiki/tight/base.tid | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/themes/tiddlywiki/tight/base.tid b/themes/tiddlywiki/tight/base.tid index 7a8e4350643..b5bcc6dfa08 100644 --- a/themes/tiddlywiki/tight/base.tid +++ b/themes/tiddlywiki/tight/base.tid @@ -34,11 +34,15 @@ tags: [[$:/tags/Stylesheet]] padding: 12px; } - html body.tc-body div.tc-sidebar-scrollable, html[dir="rtl"] body.tc-body div.tc-sidebar-scrollable { + html body.tc-body div.tc-sidebar-scrollable { padding: 12px 0 12px 12px; } - html body.tc-body .tc-sidebar-left div.tc-sidebar-scrollable, html[dir="rtl"] body.tc-body .tc-sidebar-left div.tc-sidebar-scrollable { + html body.tc-body .tc-sidebar-left div.tc-sidebar-scrollable { + padding: 12px 12px 12px 12px; + } + + html[dir="rtl"] body.tc-body .tc-sidebar-left div.tc-sidebar-scrollable { padding: 12px 12px 12px 0; } From de653df54979a05baa9baa4d08a5a13340ec137d Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Fri, 25 Oct 2024 04:52:05 +0200 Subject: [PATCH 082/147] cleanup --- core/ui/PageTemplate/sidebar-resizer.tid | 61 ++++++++++++++++-------- 1 file changed, 42 insertions(+), 19 deletions(-) diff --git a/core/ui/PageTemplate/sidebar-resizer.tid b/core/ui/PageTemplate/sidebar-resizer.tid index 6034826b4f9..79c99078e19 100644 --- a/core/ui/PageTemplate/sidebar-resizer.tid +++ b/core/ui/PageTemplate/sidebar-resizer.tid @@ -7,24 +7,47 @@ list-after: $:/core/ui/PageTemplate/story <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarresizer}match[show]] %> -<$eventcatcher tag="div" class="tc-sidebar-resizer-pointerdown-eventcatcher" selector=".tc-sidebar-resizer" matchSelector=".tc-sidebar-resizer" $pointerdown=<> $pointerup=<>> - -<%if [{$:/state/sidebar}!match[no]] %> - -<$eventcatcher tag="div" class="tc-sidebar-resizer-pointermove-eventcatcher-wrapper" selector=".tc-sidebar-resizer" matchSelector=".tc-sidebar-resizer" $pointerup={{{ [[$:/state/sidebar/resizing]!is[missing]then] }}}> - -<$eventcatcher tag="div" selector=".tc-sidebar-resizer-pointermove" matchSelector=".tc-sidebar-resizer-pointermove" class="tc-sidebar-resizer-pointermove-eventcatcher" $pointerup=<> $pointerleave=<> $pointerout=<> $pointercancel=<> $pointerdown=<> $touchstart=<> $pointermove=<> $contextmenu=<>> - -
- - - -
- - - -<% endif %> - - + <$eventcatcher + tag="div" + class="tc-sidebar-resizer-pointerdown-eventcatcher" + selector=".tc-sidebar-resizer" + matchSelector=".tc-sidebar-resizer" + $pointerdown=<> + $pointerup=<>> + + <%if [{$:/state/sidebar}!match[no]] %> + + <$eventcatcher + tag="div" + class="tc-sidebar-resizer-pointermove-eventcatcher-wrapper" + selector=".tc-sidebar-resizer" + matchSelector=".tc-sidebar-resizer" + $pointerup={{{ [[$:/state/sidebar/resizing]!is[missing]then] }}}> + + <$eventcatcher + tag="div" + selector=".tc-sidebar-resizer-pointermove" + matchSelector=".tc-sidebar-resizer-pointermove" + class="tc-sidebar-resizer-pointermove-eventcatcher" + $pointerup=<> + $pointerleave=<> + $pointerout=<> + $pointercancel=<> + $pointerdown=<> + $touchstart=<> + $pointermove=<> + $contextmenu=<>> + +
+ + + +
+ + + + <% endif %> + + <% endif %> From 0c132c96be58179dc7fbe8112c4db94237c8bd1c Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Fri, 25 Oct 2024 06:19:28 +0200 Subject: [PATCH 083/147] make it more generic --- core/ui/PageTemplate/sidebar-resizer.tid | 53 ---- core/wiki/macros/sidebar-resizer.tid | 99 +++++-- .../centralised/sidebar-resizer-ui.tid | 20 ++ .../tiddlywiki/vanilla/sidebar-resizer-ui.tid | 20 ++ themes/tiddlywiki/vanilla/sidebar-resizer.tid | 252 +++++++++--------- 5 files changed, 243 insertions(+), 201 deletions(-) delete mode 100644 core/ui/PageTemplate/sidebar-resizer.tid create mode 100644 themes/tiddlywiki/centralised/sidebar-resizer-ui.tid create mode 100644 themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid diff --git a/core/ui/PageTemplate/sidebar-resizer.tid b/core/ui/PageTemplate/sidebar-resizer.tid deleted file mode 100644 index 79c99078e19..00000000000 --- a/core/ui/PageTemplate/sidebar-resizer.tid +++ /dev/null @@ -1,53 +0,0 @@ -title: $:/core/ui/PageTemplate/sidebar-resizer -tags: $:/tags/PageTemplate -list-after: $:/core/ui/PageTemplate/story - -\import $:/core/macros/sidebar-resizer -\whitespace trim - -<%if [{$:/themes/tiddlywiki/vanilla/options/sidebarresizer}match[show]] %> - - <$eventcatcher - tag="div" - class="tc-sidebar-resizer-pointerdown-eventcatcher" - selector=".tc-sidebar-resizer" - matchSelector=".tc-sidebar-resizer" - $pointerdown=<> - $pointerup=<>> - - <%if [{$:/state/sidebar}!match[no]] %> - - <$eventcatcher - tag="div" - class="tc-sidebar-resizer-pointermove-eventcatcher-wrapper" - selector=".tc-sidebar-resizer" - matchSelector=".tc-sidebar-resizer" - $pointerup={{{ [[$:/state/sidebar/resizing]!is[missing]then] }}}> - - <$eventcatcher - tag="div" - selector=".tc-sidebar-resizer-pointermove" - matchSelector=".tc-sidebar-resizer-pointermove" - class="tc-sidebar-resizer-pointermove-eventcatcher" - $pointerup=<> - $pointerleave=<> - $pointerout=<> - $pointercancel=<> - $pointerdown=<> - $touchstart=<> - $pointermove=<> - $contextmenu=<>> - -
- - - -
- - - - <% endif %> - - - -<% endif %> diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 7b0bd918a4b..cfe387fb75f 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -51,11 +51,11 @@ title: $:/core/macros/sidebar-resizer \procedure sidebar-resizer-pointerdown-actions() <%if [[$:/state/sidebar/resizing]is[missing]thenmatch[left]] %> <$let - startStoryLeft={{{ [get.theme.metric[metrics/storyleft]] }}} - startStoryRight={{{ [get.theme.metric[metrics/storyright]] }}} - startSidebarWidth={{{ [get.theme.metric[metrics/sidebarwidth]] }}} - startTiddlerWidth={{{ [get.theme.metric[metrics/tiddlerwidth]] }}} - startStoryWidth={{{ [get.theme.metric[metrics/storywidth]] }}}> + startStoryLeft={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/storyleft]] }}} + startStoryRight={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/storyright]] }}} + startSidebarWidth={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/sidebarwidth]] }}} + startTiddlerWidth={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/tiddlerwidth]] }}} + startStoryWidth={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/storywidth]] }}}> <$action-setfield $tiddler="$:/state/sidebar/resizing" text="yes" widget-node-width=<> @@ -83,13 +83,16 @@ title: $:/core/macros/sidebar-resizer <$let storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyWidthStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-width}] }}} - storyMinWidth={{{ [convert.to.pixels] }}} - sidebarMinWidth={{{ [convert.to.pixels] }}} - storyPaddingLeft={{{ [get.theme.metric[metrics/storypaddingleft]] }}} - storyPaddingLeft={{{ [convert.to.pixels] }}} - storyPaddingRight={{{ [get.theme.metric[metrics/storypaddingright]] }}} - storyPaddingRight={{{ [convert.to.pixels] }}} - storyLeft={{{ [convert.to.pixels] }}} + storyMinWidthValue={{{ [!is[blank]get[text]] :else[] }}} + storyMinWidth={{{ [convert.to.pixels] }}} + sidebarMinWidthValue={{{ [!is[blank]get[text]] :else[] }}} + sidebarMinWidth={{{ [convert.to.pixels] }}} + storyPaddingLeftValue={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/storypaddingleft]] }}} + storyPaddingLeft={{{ [convert.to.pixels] }}} + storyPaddingRightValue={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/storypaddingright]] }}} + storyPaddingRight={{{ [convert.to.pixels] }}} + storyLeftValue={{{ [!is[blank]get[text]] :else[] }}} + storyLeft={{{ [convert.to.pixels] }}} clampedDiff={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} storyWidthStart={{{ [subtract] }}} storyRightStart={{{ [subtract] }}} @@ -120,7 +123,7 @@ title: $:/core/macros/sidebar-resizer storyWidthResult={{{ [compare:number:ltthenaddsuffix] :else[compare:number:gteqthenaddsuffix] :else[addsuffix] }}} - tiddlerWidthResult={{{ [match[%]thencompare:number:ltthencompare:number:gteq[0]then] :else[match[%]thencompare:number:gtthen] :else[!match[%]thencompare:number:ltthenaddsuffix] :else[!match[%]thencompare:number:gteqthenaddsuffix] :else[compare:number:lt[0]then[0]addsuffix] :else[addsuffix] }}}> + tiddlerWidthResult={{{ [match[%]thencompare:number:ltthencompare:number:gteq[0]then] :else[match[%]thencompare:number:gtthen] :else[!match[%]thencompare:number:ltthenaddsuffix] :else[!match[%]thencompare:number:gteqthenaddsuffix] :else[compare:number:lt[0]then[0]addsuffix] :else[addsuffix] }}}> <$action-setfield $tiddler=<> text=<>/> <$action-setfield $tiddler=<> text=<>/> @@ -144,10 +147,13 @@ title: $:/core/macros/sidebar-resizer \procedure set-sidebarwidth-actions() <$let + sidebarMinWidthValue={{{ [!is[blank]get[text]] :else[] }}} sidebarWidthMetric={{$:/state/sidebar/resizing!!sidebar-width-metric}} - sidebarMinWidth={{{ [convert.to.pixels] }}} - storyLeft={{{ [convert.to.pixels] }}} - storyMinWidth={{{ [convert.to.pixels] }}} + sidebarMinWidth={{{ [convert.to.pixels] }}} + storyLeftValue={{{ [!is[blank]get[text]] :else[] }}} + storyLeft={{{ [convert.to.pixels] }}} + storyMinWidthValue={{{ [!is[blank]get[text]] :else[] }}} + storyMinWidth={{{ [convert.to.pixels] }}} sidebarMaxWidth={{{ [subtractsubtract] }}} clampedDiff={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} sidebarWidth={{{ [subtract] }}}> @@ -164,9 +170,11 @@ title: $:/core/macros/sidebar-resizer \procedure set-centralised-actions() <$let - storyMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/centralised/metrics/storyminwidth}] }}} + storyMinWidthValue={{{ [!is[blank]get[text]] :else[{$:/themes/tiddlywiki/centralised/metrics/storyminwidth}] }}} + storyMinWidth={{{ [convert.to.pixels] }}} storyWidthStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-width}] }}} - sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}] }}} + sidebarMinWidthValue={{{ [!is[blank]get[text]] :else[{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}] }}} + sidebarMinWidth={{{ [convert.to.pixels] }}} storyMaxWidth={{{ [subtractsubtract] }}} dragDiffMultiplied={{{ [multiply[2]] }}} storyWidthClamped={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} @@ -179,7 +187,7 @@ title: $:/core/macros/sidebar-resizer storyMinWidthConverted={{{ [function[convert.to.result],,] }}} storyMaxWidthConverted={{{ [function[convert.to.result],,] }}}> - <$action-setfield $tiddler="$:/themes/tiddlywiki/centralised/metrics/storywidth" text={{{ [compare:number:ltthenaddsuffix] :else[compare:number:gteqthenaddsuffix] :else[addsuffix] }}}/> + <$action-setfield $tiddler=<> text={{{ [compare:number:ltthenaddsuffix] :else[compare:number:gteqthenaddsuffix] :else[addsuffix] }}}/> @@ -191,18 +199,65 @@ title: $:/core/macros/sidebar-resizer \procedure sidebar-resizer-pointermove-actions() <%if [[$:/state/sidebar/resizing]!is[missing]] %> <$let widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}} dragDiff=<> startStoryRight={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyRiverWidth={{{ [add] }}} startSidebarWidth={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-sidebar-width}] }}} sidebarWidth={{{ [subtract] }}}> - <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> + <%if [match[yes]] %> <> <> <> <> - <%elseif [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> + <% endif %> + <%if [match[yes]] %> <> <> - <%elseif [{$:/theme}match[$:/themes/tiddlywiki/centralised]] %> + <% endif %> + <%if [match[yes]] %> <> <> <% endif %> <% endif %> \end + +\procedure sidebar-resizer() +<$eventcatcher + tag="div" + class="tc-sidebar-resizer-pointerdown-eventcatcher" + selector=".tc-sidebar-resizer" + matchSelector=".tc-sidebar-resizer" + $pointerdown=<> + $pointerup=<>> + + <%if [{$:/state/sidebar}!match[no]] %> + + <$eventcatcher + tag="div" + class="tc-sidebar-resizer-pointermove-eventcatcher-wrapper" + selector=".tc-sidebar-resizer" + matchSelector=".tc-sidebar-resizer" + $pointerup={{{ [[$:/state/sidebar/resizing]!is[missing]then] }}}> + + <$eventcatcher + tag="div" + selector=".tc-sidebar-resizer-pointermove" + matchSelector=".tc-sidebar-resizer-pointermove" + class="tc-sidebar-resizer-pointermove-eventcatcher" + $pointerup=<> + $pointerleave=<> + $pointerout=<> + $pointercancel=<> + $pointerdown=<> + $touchstart=<> + $pointermove=<> + $contextmenu=<>> + +
+ + + +
+ + + + <% endif %> + + +\end diff --git a/themes/tiddlywiki/centralised/sidebar-resizer-ui.tid b/themes/tiddlywiki/centralised/sidebar-resizer-ui.tid new file mode 100644 index 00000000000..6b487fdd872 --- /dev/null +++ b/themes/tiddlywiki/centralised/sidebar-resizer-ui.tid @@ -0,0 +1,20 @@ +title: $:/core/ui/PageTemplate/sidebar-resizer +tags: $:/tags/PageTemplate +list-after: $:/core/ui/PageTemplate/story + +\import $:/core/macros/sidebar-resizer +\whitespace trim + +<%if [{$:/themes/tiddlywiki/vanilla/options/sidebarresizer}match[show]] %> + + <$let + tv-set-storywidth-storyright="no" + tv-set-sidebarwidth="no" + tv-set-centralised="yes" + > + + <$transclude $variable="sidebar-resizer"/> + + + +<% endif %> diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid b/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid new file mode 100644 index 00000000000..60f685a07d3 --- /dev/null +++ b/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid @@ -0,0 +1,20 @@ +title: $:/core/ui/PageTemplate/sidebar-resizer +tags: $:/tags/PageTemplate +list-after: $:/core/ui/PageTemplate/story + +\import $:/core/macros/sidebar-resizer +\whitespace trim + +<%if [{$:/themes/tiddlywiki/vanilla/options/sidebarresizer}match[show]] %> + + <$let + tv-set-storywidth-storyright={{{ [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then[yes]] :else[[no]] }}} + tv-set-sidebarwidth={{{ [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then[yes]] :else[[no]] }}} + tv-set-centralised="no" + > + + <$transclude $variable="sidebar-resizer"/> + + + +<% endif %> diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index 142887e89ac..6f40cd83b08 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -1,126 +1,126 @@ -title: $:/themes/tiddlywiki/vanilla/sidebar-resizer -tags: [[$:/tags/Stylesheet]] -code-body: yes - -\function sidebarbreakpoint() [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] - -\function sidebarbreakpoint-minus-one() [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}removesuffix[px]subtract[1]addsuffix[px]] ~[{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] - -\function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] - -\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock conditional - -@media (min-width: <>) { - - .tc-sidebar-resizer { - position: fixed; - top: 0; - height: 100%; - width: min(calc(<> / 2),21px); - transition: opacity 100ms; - opacity: 0.1; - cursor: ew-resize; - background: linear-gradient(<>, <>) no-repeat center/2px 100%; - } - - .tc-sidebar-resizer:hover { - opacity: 0.6; - } - - @media (pointer: coarse) { - - .tc-sidebar-resizer { - background: <>; - } - - .tc-sidebar-resizer:hover { - opacity: 0.1; - } - } - - .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove { - position: absolute; - top: 0; - left: 0; - right: 0; - width: 100%; - height: 100%; - min-height: 100%; - z-index: -1; - } - - .tc-sidebar-resizer, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove { - touch-action: none; - user-select: none; - } - - <%if [[$:/state/sidebar/resizing]!is[missing]] %> - - .tc-sidebar-resizer-pointermove-eventcatcher-wrapper { - z-index: 801; - } - - .tc-sidebar-resizer-pointermove-eventcatcher { - z-index: 802; - } - - .tc-sidebar-resizer-pointermove { - z-index: 803; - cursor: ew-resize; - } - - .tc-sidebar-resizer { - opacity: 0.6; - } - - @media (pointer: coarse) { - - .tc-sidebar-resizer { - opacity: 0.25; - } - } - - <% endif %> - - <%if [{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> - - .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); - } - - .tc-sidebar-left .tc-sidebar-resizer { - left: auto; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); - } - - <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]] %> - - .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); - } - - .tc-sidebar-left .tc-sidebar-resizer { - left: auto; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); - } - - <% endif %> - - <% endif %> - - <%if [{$:/state/sidebar}match[no]] %> - - .tc-sidebar-resizer-pointerdown-eventcatcher, .tc-sidebar-resizer-pointermove-eventcatcher-wrapper, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove, .tc-sidebar-resizer { - display: none; - } - - <% endif %> - -} - -@media (max-width: <>) { - - .tc-sidebar-resizer-pointerdown-eventcatcher, .tc-sidebar-resizer-pointermove-eventcatcher-wrapper, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove, .tc-sidebar-resizer { - display: none; - } -} +title: $:/themes/tiddlywiki/vanilla/sidebar-resizer +tags: [[$:/tags/Stylesheet]] +code-body: yes + +\function sidebarbreakpoint() [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] + +\function sidebarbreakpoint-minus-one() [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}removesuffix[px]subtract[1]addsuffix[px]] ~[{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] + +\function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] + +\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock conditional + +@media (min-width: <>) { + + .tc-sidebar-resizer { + position: fixed; + top: 0; + height: 100%; + width: min(calc(<> / 2),21px); + transition: opacity 100ms; + opacity: 0.1; + cursor: ew-resize; + background: linear-gradient(<>, <>) no-repeat center/2px 100%; + } + + .tc-sidebar-resizer:hover { + opacity: 0.6; + } + + @media (pointer: coarse) { + + .tc-sidebar-resizer { + background: <>; + } + + .tc-sidebar-resizer:hover { + opacity: 0.1; + } + } + + .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove { + position: absolute; + top: 0; + left: 0; + right: 0; + width: 100%; + height: 100%; + min-height: 100%; + z-index: -1; + } + + .tc-sidebar-resizer, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove { + touch-action: none; + user-select: none; + } + + <%if [[$:/state/sidebar/resizing]!is[missing]] %> + + .tc-sidebar-resizer-pointermove-eventcatcher-wrapper { + z-index: 801; + } + + .tc-sidebar-resizer-pointermove-eventcatcher { + z-index: 802; + } + + .tc-sidebar-resizer-pointermove { + z-index: 803; + cursor: ew-resize; + } + + .tc-sidebar-resizer { + opacity: 0.6; + } + + @media (pointer: coarse) { + + .tc-sidebar-resizer { + opacity: 0.25; + } + } + + <% endif %> + + <%if [{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> + + .tc-sidebar-resizer { + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + } + + .tc-sidebar-left .tc-sidebar-resizer { + left: auto; + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + } + + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]] %> + + .tc-sidebar-resizer { + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + } + + .tc-sidebar-left .tc-sidebar-resizer { + left: auto; + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + } + + <% endif %> + + <% endif %> + + <%if [{$:/state/sidebar}match[no]] %> + + .tc-sidebar-resizer-pointerdown-eventcatcher, .tc-sidebar-resizer-pointermove-eventcatcher-wrapper, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove, .tc-sidebar-resizer { + display: none; + } + + <% endif %> + +} + +@media (max-width: <>) { + + .tc-sidebar-resizer-pointerdown-eventcatcher, .tc-sidebar-resizer-pointermove-eventcatcher-wrapper, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove, .tc-sidebar-resizer { + display: none; + } +} From b5a5bf84da563f7bad4a5f2ac84b0cd0a6f56654 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Fri, 25 Oct 2024 13:58:22 +0200 Subject: [PATCH 084/147] more generic adjustments --- core/wiki/macros/sidebar-resizer.tid | 19 ++++++++++++------- .../centralised/sidebar-resizer-ui.tid | 8 ++------ .../tiddlywiki/vanilla/sidebar-resizer-ui.tid | 1 - 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index cfe387fb75f..5b9817f9ff1 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -120,13 +120,15 @@ title: $:/core/macros/sidebar-resizer tiddlerWidthConverted={{{ [match[%]thenmultiply[100]divide] :else[function[convert.to.result],,] }}} tiddlerMinWidthConverted={{{ [match[%]thenmultiply[100]divide] :else[function[convert.to.result],,] }}} tiddlerMaxWidthConverted={{{ [match[%]thenmultiply[100]divide] :else[function[convert.to.result],,] }}} + storyWidthSetTiddler={{{ [!is[blank]] :else[] }}} + tiddlerWidthSetTiddler={{{ [!is[blank]] :else[] }}} storyWidthResult={{{ [compare:number:ltthenaddsuffix] :else[compare:number:gteqthenaddsuffix] :else[addsuffix] }}} tiddlerWidthResult={{{ [match[%]thencompare:number:ltthencompare:number:gteq[0]then] :else[match[%]thencompare:number:gtthen] :else[!match[%]thencompare:number:ltthenaddsuffix] :else[!match[%]thencompare:number:gteqthenaddsuffix] :else[compare:number:lt[0]then[0]addsuffix] :else[addsuffix] }}}> - <$action-setfield $tiddler=<> text=<>/> - <$action-setfield $tiddler=<> text=<>/> + <$action-setfield $tiddler=<> text=<>/> + <$action-setfield $tiddler=<> text=<>/> @@ -135,10 +137,11 @@ title: $:/core/macros/sidebar-resizer storyRiverWidthConverted={{{ [function[convert.to.result],,] }}} storyRiverLimitConverted={{{ [function[convert.to.result],,] }}} storyMinWidthAddLeftConverted={{{ [function[convert.to.result],,] }}} + storyRightSetTiddler={{{ [!is[blank]] :else[] }}} result={{{ [compare:number:ltthenaddsuffix] :else[compare:number:gteqthenaddsuffix] :else[addsuffix] }}}> - <$action-setfield $tiddler=<> text=<>/> + <$action-setfield $tiddler=<> text=<>/> @@ -161,9 +164,10 @@ title: $:/core/macros/sidebar-resizer <$let sidebarWidthConverted={{{ [function[convert.to.result],,] }}} sidebarMaxWidthConverted={{{ [function[convert.to.result],,] }}} - sidebarMinWidthConverted={{{ [function[convert.to.result],,] }}}> + sidebarMinWidthConverted={{{ [function[convert.to.result],,] }}} + sidebarWidthSetTiddler={{{ [!is[blank]] :else[] }}}> - <$action-setfield $tiddler=<> text={{{ [compare:number:gteqthenaddsuffix] :else[compare:number:ltthenaddsuffix] :else[addsuffix] }}}/> + <$action-setfield $tiddler=<> text={{{ [compare:number:gteqthenaddsuffix] :else[compare:number:ltthenaddsuffix] :else[addsuffix] }}}/> \end @@ -185,9 +189,10 @@ title: $:/core/macros/sidebar-resizer storyWidthMetric={{$:/state/sidebar/resizing!!story-width-metric}} storyWidthConverted={{{ [function[convert.to.result],,] }}} storyMinWidthConverted={{{ [function[convert.to.result],,] }}} - storyMaxWidthConverted={{{ [function[convert.to.result],,] }}}> + storyMaxWidthConverted={{{ [function[convert.to.result],,] }}} + storyWidthSetTiddler={{{ [!is[blank]] :else[] }}}> - <$action-setfield $tiddler=<> text={{{ [compare:number:ltthenaddsuffix] :else[compare:number:gteqthenaddsuffix] :else[addsuffix] }}}/> + <$action-setfield $tiddler=<> text={{{ [compare:number:ltthenaddsuffix] :else[compare:number:gteqthenaddsuffix] :else[addsuffix] }}}/> diff --git a/themes/tiddlywiki/centralised/sidebar-resizer-ui.tid b/themes/tiddlywiki/centralised/sidebar-resizer-ui.tid index 6b487fdd872..ba937fcb394 100644 --- a/themes/tiddlywiki/centralised/sidebar-resizer-ui.tid +++ b/themes/tiddlywiki/centralised/sidebar-resizer-ui.tid @@ -7,14 +7,10 @@ list-after: $:/core/ui/PageTemplate/story <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarresizer}match[show]] %> - <$let - tv-set-storywidth-storyright="no" - tv-set-sidebarwidth="no" - tv-set-centralised="yes" - > + <$set name="tv-set-centralised" value="yes"> <$transclude $variable="sidebar-resizer"/> - + <% endif %> diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid b/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid index 60f685a07d3..841baada144 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid @@ -10,7 +10,6 @@ list-after: $:/core/ui/PageTemplate/story <$let tv-set-storywidth-storyright={{{ [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then[yes]] :else[[no]] }}} tv-set-sidebarwidth={{{ [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then[yes]] :else[[no]] }}} - tv-set-centralised="no" > <$transclude $variable="sidebar-resizer"/> From 70b759c852ecb1c609133b544df228f47257a612 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Fri, 25 Oct 2024 19:11:52 +0200 Subject: [PATCH 085/147] make it more generic --- themes/tiddlywiki/tight/base.tid | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/themes/tiddlywiki/tight/base.tid b/themes/tiddlywiki/tight/base.tid index b5bcc6dfa08..1236597c594 100644 --- a/themes/tiddlywiki/tight/base.tid +++ b/themes/tiddlywiki/tight/base.tid @@ -1,6 +1,8 @@ title: $:/themes/tiddlywiki/tight/base tags: [[$:/tags/Stylesheet]] +\function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] + \rules only filteredtranscludeinline transcludeinline macrodef macrocallinline conditional @media (max-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) { @@ -27,7 +29,7 @@ tags: [[$:/tags/Stylesheet]] } html body.tc-body section.tc-story-river { - padding: 0px {{$:/themes/tiddlywiki/tight/metrics/storypaddingright}} 0px {{$:/themes/tiddlywiki/tight/metrics/storypaddingleft}}; + padding: 0px <> 0px <>; } html body.tc-body div.tc-tiddler-frame { @@ -49,12 +51,12 @@ tags: [[$:/tags/Stylesheet]] <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> html body.tc-body div.tc-sidebar-scrollable { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc({{$:/themes/tiddlywiki/tight/metrics/storyright}} + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc(<> + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); } html body.tc-body .tc-sidebar-left div.tc-sidebar-scrollable { left: 0; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc({{$:/themes/tiddlywiki/tight/metrics/storyright}} + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc(<> + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); } <% endif %> @@ -119,24 +121,24 @@ tags: [[$:/tags/Stylesheet]] html body.tc-body .tc-sidebar-resizer { width: 12px; right: auto; - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc({{$:/themes/tiddlywiki/tight/metrics/storywidth}}),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/tight/metrics/storywidth}}),calc({{$:/themes/tiddlywiki/tight/metrics/storyright}})),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/tight/metrics/storywidth}} - {{$:/themes/tiddlywiki/tight/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc(<>),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <>),calc(<>)),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <> - <>)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } html body.tc-body .tc-sidebar-left .tc-sidebar-resizer { left: auto; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc({{$:/themes/tiddlywiki/tight/metrics/storywidth}}),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/tight/metrics/storywidth}}),calc({{$:/themes/tiddlywiki/tight/metrics/storyright}})),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/tight/metrics/storywidth}} - {{$:/themes/tiddlywiki/tight/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc(<>),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <>),calc(<>)),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <> - <>)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]] %> html body.tc-body .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - {{$:/themes/tiddlywiki/tight/metrics/sidebarwidth}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - <>),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); right: auto; } html body.tc-body .tc-sidebar-left .tc-sidebar-resizer { left: auto; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - {{$:/themes/tiddlywiki/tight/metrics/sidebarwidth}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - <>),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } <% endif %> From 4f9a2fa8c5590b3891805f48c7910e591de7a442 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Fri, 25 Oct 2024 19:57:04 +0200 Subject: [PATCH 086/147] make it more generic --- themes/tiddlywiki/centralised/functions.tid | 5 +++++ .../centralised/sidebar-resizer-ui.tid | 16 ---------------- themes/tiddlywiki/vanilla/functions.tid | 5 +++++ themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid | 9 +++++---- 4 files changed, 15 insertions(+), 20 deletions(-) create mode 100644 themes/tiddlywiki/centralised/functions.tid delete mode 100644 themes/tiddlywiki/centralised/sidebar-resizer-ui.tid create mode 100644 themes/tiddlywiki/vanilla/functions.tid diff --git a/themes/tiddlywiki/centralised/functions.tid b/themes/tiddlywiki/centralised/functions.tid new file mode 100644 index 00000000000..dae942c8765 --- /dev/null +++ b/themes/tiddlywiki/centralised/functions.tid @@ -0,0 +1,5 @@ +title: $:/themes/tiddlywiki/centralised/functions + +\function set.centralised() yes +\function set.storywidth.storyright() no +\function set.sidebarwidth() no \ No newline at end of file diff --git a/themes/tiddlywiki/centralised/sidebar-resizer-ui.tid b/themes/tiddlywiki/centralised/sidebar-resizer-ui.tid deleted file mode 100644 index ba937fcb394..00000000000 --- a/themes/tiddlywiki/centralised/sidebar-resizer-ui.tid +++ /dev/null @@ -1,16 +0,0 @@ -title: $:/core/ui/PageTemplate/sidebar-resizer -tags: $:/tags/PageTemplate -list-after: $:/core/ui/PageTemplate/story - -\import $:/core/macros/sidebar-resizer -\whitespace trim - -<%if [{$:/themes/tiddlywiki/vanilla/options/sidebarresizer}match[show]] %> - - <$set name="tv-set-centralised" value="yes"> - - <$transclude $variable="sidebar-resizer"/> - - - -<% endif %> diff --git a/themes/tiddlywiki/vanilla/functions.tid b/themes/tiddlywiki/vanilla/functions.tid new file mode 100644 index 00000000000..2896975a8e7 --- /dev/null +++ b/themes/tiddlywiki/vanilla/functions.tid @@ -0,0 +1,5 @@ +title: $:/themes/tiddlywiki/vanilla/functions + +\function set.centralised() no +\function set.storywidth.storyright() [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then[yes]] :else[[no]] +\function set.sidebarwidth() [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then[yes]] :else[[no]] \ No newline at end of file diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid b/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid index 841baada144..6b8ecf0efb8 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid @@ -1,15 +1,16 @@ -title: $:/core/ui/PageTemplate/sidebar-resizer +title: $:/themes/tiddlywiki/vanilla/ui/sidebar-resizer tags: $:/tags/PageTemplate list-after: $:/core/ui/PageTemplate/story -\import $:/core/macros/sidebar-resizer +\import [{$:/theme}addsuffix[/functions]!is[missing]else{$:/theme}addsuffix[/functions]is[shadow]else[$:/themes/tiddlywiki/vanilla/functions]] [[$:/core/macros/sidebar-resizer]] \whitespace trim <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarresizer}match[show]] %> <$let - tv-set-storywidth-storyright={{{ [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then[yes]] :else[[no]] }}} - tv-set-sidebarwidth={{{ [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then[yes]] :else[[no]] }}} + tv-set-storywidth-storyright=<> + tv-set-sidebarwidth=<> + tv-set-centralised=<> > <$transclude $variable="sidebar-resizer"/> From 279441388ed8f66aef07bf99f76977d67e8e299a Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 26 Oct 2024 06:52:23 +0200 Subject: [PATCH 087/147] make everything even more generic --- core/wiki/functions/themes.tid | 19 +++++++ core/wiki/macros/sidebar-resizer.tid | 50 ++++++++----------- themes/tiddlywiki/centralised/functions.tid | 5 +- themes/tiddlywiki/centralised/styles.tid | 8 --- .../tiddlywiki/tight-heavier/metrics.multids | 8 --- themes/tiddlywiki/tight/base.tid | 16 +++--- themes/tiddlywiki/tight/functions.tid | 8 +++ themes/tiddlywiki/vanilla/ThemeTweaks.tid | 32 ++++++------ themes/tiddlywiki/vanilla/base.tid | 26 +++++----- themes/tiddlywiki/vanilla/functions.tid | 5 +- .../tiddlywiki/vanilla/sidebar-resizer-ui.tid | 2 +- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 43 ++++++++++------ 12 files changed, 120 insertions(+), 102 deletions(-) create mode 100644 core/wiki/functions/themes.tid delete mode 100644 themes/tiddlywiki/tight-heavier/metrics.multids create mode 100644 themes/tiddlywiki/tight/functions.tid diff --git a/core/wiki/functions/themes.tid b/core/wiki/functions/themes.tid new file mode 100644 index 00000000000..a9a51d1cab7 --- /dev/null +++ b/core/wiki/functions/themes.tid @@ -0,0 +1,19 @@ +title: $:/core/functions/themes +tags: $:/tags/Global + +\function get.base.theme.metric.recursive(theme,metric) [get[dependents]enlist-input[]] :map[function[get.base.theme.metric],,] + +\function get.base.theme.metric(theme,metric) [addsuffix[/metrics/]addsuffix!is[missing]] :else[addsuffix[/metrics/]addsuffixis[shadow]] :else[function[get.base.theme.metric.recursive],,] + +\function get.base.theme(theme,metric) [function[get.base.theme.metric],,removesuffixremovesuffix[/metrics/]] + +\function get.theme.metric(metric) [function[get.base.theme.metric],{$:/theme},first[]get[text]] + +\function get.theme(metric) [function[get.base.theme],{$:/theme},addsuffix[/metrics/]addsuffix!is[missing]] :else[function[get.base.theme],{$:/theme},addsuffix[/metrics/]addsuffixis[shadow]] :else[[$:/themes/tiddlywiki/vanilla/metrics/]addsuffix] + +\function set.theme.metric(metric) [function[get.base.theme.metric],{$:/theme},is[shadow]] :else[function[get.base.theme.metric],{$:/theme},!is[shadow]!is[missing]] :else[[$:/themes/tiddlywiki/vanilla/metrics/]addsuffix] + +\function get.base.functions.theme.recursive(theme) [get[dependents]enlist-input[]] :map[function[get.base.functions.theme],] + +\function get.base.functions.theme(theme) [addsufix[/functions]!is[missing]] :else[addsuffix[/functions]is[shadow]] :else[function[get.base.functions.theme.recursive],] + diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 5b9817f9ff1..4af1fe8dfd1 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -32,12 +32,6 @@ title: $:/core/macros/sidebar-resizer \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.theme(metric) [{$:/theme}addsuffix[/]addsuffix!is[missing]] :else[{$:/theme}addsuffix[/]addsuffixis[shadow]] :else[[$:/themes/tiddlywiki/vanilla/]addsuffix] - -\function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] :else[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] - -\function set.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixis[shadow]] :else[{$:/theme}addsuffix[/]addsuffixis[shadow]!is[missing]] :else[[$:/themes/tiddlywiki/vanilla/]addsuffix] - \function get.value.metric(value) [suffix[px]then[px]] :else[suffix[%]then[%]] :else[suffix[cm]then[cm]] :else[suffix[mm]then[mm]] :else[suffix[Q]then[Q]] :else[suffix[in]then[in]] :else[suffix[pc]then[pc]] :else[suffix[pt]then[pt]] :else[suffix[em]then[em]] \procedure set_theme_throttling(metric) @@ -51,11 +45,11 @@ title: $:/core/macros/sidebar-resizer \procedure sidebar-resizer-pointerdown-actions() <%if [[$:/state/sidebar/resizing]is[missing]thenmatch[left]] %> <$let - startStoryLeft={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/storyleft]] }}} - startStoryRight={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/storyright]] }}} - startSidebarWidth={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/sidebarwidth]] }}} - startTiddlerWidth={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/tiddlerwidth]] }}} - startStoryWidth={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/storywidth]] }}}> + startStoryLeft={{{ [!is[blank]get[text]] :else[get.theme.metric[storyleft]] }}} + startStoryRight={{{ [!is[blank]get[text]] :else[get.theme.metric[storyright]] }}} + startSidebarWidth={{{ [!is[blank]get[text]] :else[get.theme.metric[sidebarwidth]] }}} + startTiddlerWidth={{{ [!is[blank]get[text]] :else[get.theme.metric[tiddlerwidth]] }}} + startStoryWidth={{{ [!is[blank]get[text]] :else[get.theme.metric[storywidth]] }}}> <$action-setfield $tiddler="$:/state/sidebar/resizing" text="yes" widget-node-width=<> @@ -83,15 +77,15 @@ title: $:/core/macros/sidebar-resizer <$let storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyWidthStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-width}] }}} - storyMinWidthValue={{{ [!is[blank]get[text]] :else[] }}} + storyMinWidthValue={{{ [!is[blank]get[text]] :else[] }}} storyMinWidth={{{ [convert.to.pixels] }}} - sidebarMinWidthValue={{{ [!is[blank]get[text]] :else[] }}} + sidebarMinWidthValue={{{ [!is[blank]get[text]] :else[] }}} sidebarMinWidth={{{ [convert.to.pixels] }}} storyPaddingLeftValue={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/storypaddingleft]] }}} storyPaddingLeft={{{ [convert.to.pixels] }}} storyPaddingRightValue={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/storypaddingright]] }}} storyPaddingRight={{{ [convert.to.pixels] }}} - storyLeftValue={{{ [!is[blank]get[text]] :else[] }}} + storyLeftValue={{{ [!is[blank]get[text]] :else[] }}} storyLeft={{{ [convert.to.pixels] }}} clampedDiff={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} storyWidthStart={{{ [subtract] }}} @@ -120,12 +114,12 @@ title: $:/core/macros/sidebar-resizer tiddlerWidthConverted={{{ [match[%]thenmultiply[100]divide] :else[function[convert.to.result],,] }}} tiddlerMinWidthConverted={{{ [match[%]thenmultiply[100]divide] :else[function[convert.to.result],,] }}} tiddlerMaxWidthConverted={{{ [match[%]thenmultiply[100]divide] :else[function[convert.to.result],,] }}} - storyWidthSetTiddler={{{ [!is[blank]] :else[] }}} - tiddlerWidthSetTiddler={{{ [!is[blank]] :else[] }}} + storyWidthSetTiddler={{{ [!is[blank]] :else[] }}} + tiddlerWidthSetTiddler={{{ [!is[blank]] :else[] }}} storyWidthResult={{{ [compare:number:ltthenaddsuffix] :else[compare:number:gteqthenaddsuffix] :else[addsuffix] }}} - tiddlerWidthResult={{{ [match[%]thencompare:number:ltthencompare:number:gteq[0]then] :else[match[%]thencompare:number:gtthen] :else[!match[%]thencompare:number:ltthenaddsuffix] :else[!match[%]thencompare:number:gteqthenaddsuffix] :else[compare:number:lt[0]then[0]addsuffix] :else[addsuffix] }}}> + tiddlerWidthResult={{{ [match[%]thencompare:number:ltthencompare:number:gteq[0]then] :else[match[%]thencompare:number:gtthen] :else[!match[%]thencompare:number:ltthenaddsuffix] :else[!match[%]thencompare:number:gteqthenaddsuffix] :else[compare:number:lt[0]then[0]addsuffix] :else[addsuffix] }}}> <$action-setfield $tiddler=<> text=<>/> <$action-setfield $tiddler=<> text=<>/> @@ -137,7 +131,7 @@ title: $:/core/macros/sidebar-resizer storyRiverWidthConverted={{{ [function[convert.to.result],,] }}} storyRiverLimitConverted={{{ [function[convert.to.result],,] }}} storyMinWidthAddLeftConverted={{{ [function[convert.to.result],,] }}} - storyRightSetTiddler={{{ [!is[blank]] :else[] }}} + storyRightSetTiddler={{{ [!is[blank]] :else[] }}} result={{{ [compare:number:ltthenaddsuffix] :else[compare:number:gteqthenaddsuffix] :else[addsuffix] }}}> @@ -150,12 +144,12 @@ title: $:/core/macros/sidebar-resizer \procedure set-sidebarwidth-actions() <$let - sidebarMinWidthValue={{{ [!is[blank]get[text]] :else[] }}} + sidebarMinWidthValue={{{ [!is[blank]get[text]] :else[] }}} sidebarWidthMetric={{$:/state/sidebar/resizing!!sidebar-width-metric}} sidebarMinWidth={{{ [convert.to.pixels] }}} - storyLeftValue={{{ [!is[blank]get[text]] :else[] }}} + storyLeftValue={{{ [!is[blank]get[text]] :else[] }}} storyLeft={{{ [convert.to.pixels] }}} - storyMinWidthValue={{{ [!is[blank]get[text]] :else[] }}} + storyMinWidthValue={{{ [!is[blank]get[text]] :else[] }}} storyMinWidth={{{ [convert.to.pixels] }}} sidebarMaxWidth={{{ [subtractsubtract] }}} clampedDiff={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} @@ -165,7 +159,7 @@ title: $:/core/macros/sidebar-resizer sidebarWidthConverted={{{ [function[convert.to.result],,] }}} sidebarMaxWidthConverted={{{ [function[convert.to.result],,] }}} sidebarMinWidthConverted={{{ [function[convert.to.result],,] }}} - sidebarWidthSetTiddler={{{ [!is[blank]] :else[] }}}> + sidebarWidthSetTiddler={{{ [!is[blank]] :else[] }}}> <$action-setfield $tiddler=<> text={{{ [compare:number:gteqthenaddsuffix] :else[compare:number:ltthenaddsuffix] :else[addsuffix] }}}/> @@ -190,7 +184,7 @@ title: $:/core/macros/sidebar-resizer storyWidthConverted={{{ [function[convert.to.result],,] }}} storyMinWidthConverted={{{ [function[convert.to.result],,] }}} storyMaxWidthConverted={{{ [function[convert.to.result],,] }}} - storyWidthSetTiddler={{{ [!is[blank]] :else[] }}}> + storyWidthSetTiddler={{{ [!is[blank]] :else[] }}}> <$action-setfield $tiddler=<> text={{{ [compare:number:ltthenaddsuffix] :else[compare:number:gteqthenaddsuffix] :else[addsuffix] }}}/> @@ -205,17 +199,17 @@ title: $:/core/macros/sidebar-resizer <%if [[$:/state/sidebar/resizing]!is[missing]] %> <$let widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}} dragDiff=<> startStoryRight={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyRiverWidth={{{ [add] }}} startSidebarWidth={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-sidebar-width}] }}} sidebarWidth={{{ [subtract] }}}> <%if [match[yes]] %> - <> - <> - <> + <> + <> + <> <> <% endif %> <%if [match[yes]] %> - <> + <> <> <% endif %> <%if [match[yes]] %> - <> + <> <> <% endif %> diff --git a/themes/tiddlywiki/centralised/functions.tid b/themes/tiddlywiki/centralised/functions.tid index dae942c8765..fb26e00de01 100644 --- a/themes/tiddlywiki/centralised/functions.tid +++ b/themes/tiddlywiki/centralised/functions.tid @@ -2,4 +2,7 @@ title: $:/themes/tiddlywiki/centralised/functions \function set.centralised() yes \function set.storywidth.storyright() no -\function set.sidebarwidth() no \ No newline at end of file +\function set.sidebarwidth() no + +\function sidebar.resizer.maxwidth() 21px +\function sidebar.resizer.width() [[min(calc(]addsuffixaddsuffix[ / 2),]addsuffixaddsuffix[)]] diff --git a/themes/tiddlywiki/centralised/styles.tid b/themes/tiddlywiki/centralised/styles.tid index 72a80e8c608..0271a512a49 100644 --- a/themes/tiddlywiki/centralised/styles.tid +++ b/themes/tiddlywiki/centralised/styles.tid @@ -53,12 +53,4 @@ tags: [[$:/tags/Stylesheet]] width: 100%; } - html .tc-sidebar-resizer { - left: min(calc(50% + ({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2) - (2 * {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}} / 3))); - } - - html body.tc-body .tc-sidebar-left .tc-sidebar-resizer { - left: auto; - right: min(calc(50% + ({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2) - (2 * {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}} / 3))); - } } diff --git a/themes/tiddlywiki/tight-heavier/metrics.multids b/themes/tiddlywiki/tight-heavier/metrics.multids deleted file mode 100644 index b4b9019d9c2..00000000000 --- a/themes/tiddlywiki/tight-heavier/metrics.multids +++ /dev/null @@ -1,8 +0,0 @@ -title: $:/themes/tiddlywiki/tight-heavier/metrics/ - -sidebarwidth: 350px -storypaddingleft: 0px -storypaddingright: 0px -storyright: 770px -storywidth: 770px -tiddlerwidth: 770px diff --git a/themes/tiddlywiki/tight/base.tid b/themes/tiddlywiki/tight/base.tid index 1236597c594..5e8ff337ae0 100644 --- a/themes/tiddlywiki/tight/base.tid +++ b/themes/tiddlywiki/tight/base.tid @@ -1,8 +1,6 @@ title: $:/themes/tiddlywiki/tight/base tags: [[$:/tags/Stylesheet]] -\function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] - \rules only filteredtranscludeinline transcludeinline macrodef macrocallinline conditional @media (max-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) { @@ -29,7 +27,7 @@ tags: [[$:/tags/Stylesheet]] } html body.tc-body section.tc-story-river { - padding: 0px <> 0px <>; + padding: 0px <> 0px <>; } html body.tc-body div.tc-tiddler-frame { @@ -51,12 +49,12 @@ tags: [[$:/tags/Stylesheet]] <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> html body.tc-body div.tc-sidebar-scrollable { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc(<> + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc(<> + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); } html body.tc-body .tc-sidebar-left div.tc-sidebar-scrollable { left: 0; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc(<> + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc(<> + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); } <% endif %> @@ -121,24 +119,24 @@ tags: [[$:/tags/Stylesheet]] html body.tc-body .tc-sidebar-resizer { width: 12px; right: auto; - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc(<>),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <>),calc(<>)),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <> - <>)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc(<>),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <>),calc(<>)),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <> - <>)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } html body.tc-body .tc-sidebar-left .tc-sidebar-resizer { left: auto; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc(<>),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <>),calc(<>)),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <> - <>)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc(<>),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <>),calc(<>)),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <> - <>)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]] %> html body.tc-body .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - <>),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - <>),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); right: auto; } html body.tc-body .tc-sidebar-left .tc-sidebar-resizer { left: auto; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - <>),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - <>),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); } <% endif %> diff --git a/themes/tiddlywiki/tight/functions.tid b/themes/tiddlywiki/tight/functions.tid new file mode 100644 index 00000000000..d01adc7ecad --- /dev/null +++ b/themes/tiddlywiki/tight/functions.tid @@ -0,0 +1,8 @@ +title: $:/themes/tiddlywiki/tight/functions + +\function set.centralised() no +\function set.storywidth.storyright() [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then[yes]] :else[[no]] +\function set.sidebarwidth() [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then[yes]] :else[[no]] + +\function sidebar.resizer.maxwidth() 12px +\function sidebar.resizer.width() <> diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid index ccaff266c73..6ea3c4a959c 100644 --- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid +++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid @@ -4,8 +4,6 @@ caption: {{$:/language/ThemeTweaks/ThemeTweaks}} \define lingo-base() $:/language/ThemeTweaks/ -\function get.theme(metric) [{$:/theme}addsuffix[/]addsuffix!is[missing]] ~[{$:/theme}addsuffix[/]addsuffixis[shadow]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffix] - \define replacement-text() [img[$(imageTitle)$]] \end @@ -70,18 +68,18 @@ caption: {{$:/language/ThemeTweaks/ThemeTweaks}} <> -|<$link to=<>><> |<$edit-text tiddler=<> default="" tag="input"/> | -|<$link to=<>><> |<$edit-text tiddler=<> default="" tag="input"/> | -|<$link to=<>><> |<$edit-text tiddler=<> default="" tag="input"/> | -|<$link to=<>><> |<$edit-text tiddler=<> default="" tag="input"/> | -|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | -|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | -|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | -|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | -|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | -|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | -|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | -|<$link to=<>><>
//<>//
|^<$edit-text tiddler=<> default="" tag="input"/> | -|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | -|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | -|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><> |<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><> |<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><> |<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><> |<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>//
|^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | +|<$link to=<>><>
//<>// |^<$edit-text tiddler=<> default="" tag="input"/> | diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 747d650a0d0..f6df2ffbd64 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -3,8 +3,6 @@ tags: [[$:/tags/Stylesheet]] list-before: code-body: yes -\function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] - \define custom-background-datauri() <$set name="background" value={{$:/themes/tiddlywiki/vanilla/settings/backgroundimage}}> <$list filter="[is[image]]"> @@ -1029,7 +1027,7 @@ button.tc-btn-invisible.tc-remove-tag-button { .tc-sidebar-scrollable { position: fixed; top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); bottom: 0; right: 0; overflow-y: auto; @@ -1041,7 +1039,7 @@ button.tc-btn-invisible.tc-remove-tag-button { .tc-sidebar-left .tc-sidebar-scrollable { left: 0; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); margin: 0 0 0 0; } @@ -1056,14 +1054,14 @@ button.tc-btn-invisible.tc-remove-tag-button { .tc-story-river { left: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}),calc(100% - <> - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}),calc(100% - <> - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}}; - width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); + width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); padding: 42px {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} 42px {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingleft}}; } .tc-sidebar-left .tc-story-river { - left: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},calc(100% - <> - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); + left: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},calc(100% - <> - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); right: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); } @@ -1188,7 +1186,7 @@ button.tc-btn-invisible.tc-remove-tag-button { @media (min-width: <>) { .tc-tiddler-frame { padding: 28px 42px 42px 42px; - width: clamp(0px,<>,100%); + width: clamp(0px,<>,100%); border-radius: 2px; } @@ -1519,15 +1517,15 @@ html body.tc-body.tc-single-tiddler-window { width: auto; left: 0; margin-left: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); - margin-right: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); + margin-right: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); } .tc-sidebar-left .tc-story-river { margin-right: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}); - margin-left: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); + margin-left: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}})); left: auto; right: 0; - padding-right: <>; + padding-right: <>; padding-left: 0; } @@ -1544,7 +1542,7 @@ html body.tc-body.tc-single-tiddler-window { left: auto; bottom: 0; right: 0; - width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},<>,(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}})); + width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},<>,(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}})); } .tc-sidebar-left .tc-sidebar-scrollable { @@ -1574,13 +1572,13 @@ html body.tc-body.tc-single-tiddler-window { } .tc-sidebar-left .tc-story-river { - margin-left: max(<>,calc(<> + {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}})); + margin-left: max(<>,calc(<> + {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}})); margin-right: 0; } html[dir="rtl"] .tc-sidebar-left .tc-story-river { margin-left: 0; - margin-right: max(<>,calc(<> + {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}})); + margin-right: max(<>,calc(<> + {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}})); } body.tc-body .tc-page-container.tc-page-view-zoomin .tc-tiddler-frame { diff --git a/themes/tiddlywiki/vanilla/functions.tid b/themes/tiddlywiki/vanilla/functions.tid index 2896975a8e7..de016d10909 100644 --- a/themes/tiddlywiki/vanilla/functions.tid +++ b/themes/tiddlywiki/vanilla/functions.tid @@ -2,4 +2,7 @@ title: $:/themes/tiddlywiki/vanilla/functions \function set.centralised() no \function set.storywidth.storyright() [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then[yes]] :else[[no]] -\function set.sidebarwidth() [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then[yes]] :else[[no]] \ No newline at end of file +\function set.sidebarwidth() [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then[yes]] :else[[no]] + +\function sidebar.resizer.maxwidth() 21px +\function sidebar.resizer.width() [[min(calc(]addsuffixaddsuffix[ / 2),]addsuffixaddsuffix[)]] diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid b/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid index 6b8ecf0efb8..adf1d0256f5 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid @@ -2,7 +2,7 @@ title: $:/themes/tiddlywiki/vanilla/ui/sidebar-resizer tags: $:/tags/PageTemplate list-after: $:/core/ui/PageTemplate/story -\import [{$:/theme}addsuffix[/functions]!is[missing]else{$:/theme}addsuffix[/functions]is[shadow]else[$:/themes/tiddlywiki/vanilla/functions]] [[$:/core/macros/sidebar-resizer]] +\import [function[get.base.functions.theme],{$:/theme}!is[missing]] :else[function[get.base.functions.theme],{$:/theme}is[shadow]] :else[[$:/themes/tiddlywiki/vanilla/functions]] [[$:/core/macros/sidebar-resizer]] \whitespace trim <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarresizer}match[show]] %> diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index 6f40cd83b08..e9e2db85314 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -2,12 +2,12 @@ title: $:/themes/tiddlywiki/vanilla/sidebar-resizer tags: [[$:/tags/Stylesheet]] code-body: yes +\import [function[get.base.functions.theme],{$:/theme}!is[missing]] :else[function[get.base.functions.theme],{$:/theme}is[shadow]] :else[[$:/themes/tiddlywiki/vanilla/functions]] + \function sidebarbreakpoint() [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] \function sidebarbreakpoint-minus-one() [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}removesuffix[px]subtract[1]addsuffix[px]] ~[{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] -\function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] - \rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock conditional @media (min-width: <>) { @@ -16,7 +16,7 @@ code-body: yes position: fixed; top: 0; height: 100%; - width: min(calc(<> / 2),21px); + width: <>; transition: opacity 100ms; opacity: 0.1; cursor: ew-resize; @@ -82,29 +82,42 @@ code-body: yes <% endif %> - <%if [{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> + <%if [match[yes]] %> .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + left: clamp(calc(<> + <> - (2 * <> / 3)),clamp(calc(<> - (2 * <> / 3)),max(calc(<> + <> - (2 * <> / 3)),calc(<> - (2 * <> / 3))),max(calc(100% - <> - (2 * <> / 3) + (<> + <> - <>)),calc(100% - <> - (2 * <> / 3)))),calc(100% - <> - (2 * <> / 3))); } .tc-sidebar-left .tc-sidebar-resizer { left: auto; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + right: clamp(calc(<> + <> - (2 * <> / 3)),clamp(calc(<> - (2 * <> / 3)),max(calc(<> + <> - (2 * <> / 3)),calc(<> - (2 * <> / 3))),max(calc(100% - <> - (2 * <> / 3) + (<> + <> - <>)),calc(100% - <> - (2 * <> / 3)))),calc(100% - <> - (2 * <> / 3))); } - <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]] %> + <% endif %> - .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); - } + <%if [match[yes]] %> - .tc-sidebar-left .tc-sidebar-resizer { - left: auto; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); - } + .tc-sidebar-resizer { + left: clamp(calc(<> + <> + (<> / 3)),calc(100% - <> + (<> / 3)),calc(100% - <> + (<> / 3))); + } - <% endif %> + .tc-sidebar-left .tc-sidebar-resizer { + left: auto; + right: clamp(calc(<> + <> + (<> / 3)),calc(100% - <> + (<> / 3)),calc(100% - <> + (<> / 3))); + } + + <% endif %> + + <%if [match[yes]] %> + + .tc-sidebar-resizer { + left: min(calc(50% + (<> / 2) - (2 * <> / 3)),calc(100% - <> - (2 * <> / 3))); + } + + .tc-sidebar-left .tc-sidebar-resizer { + left: auto; + right: min(calc(50% + (<> / 2) - (2 * <> / 3)),calc(100% - <> - (2 * <> / 3))); + } <% endif %> From ae28506abbc0c6085c5e16f9abe8f21d107df127 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 26 Oct 2024 07:17:01 +0200 Subject: [PATCH 088/147] make everything even more generic --- themes/tiddlywiki/centralised/styles.tid | 12 +++++----- themes/tiddlywiki/tight/base.tid | 29 ++---------------------- themes/tiddlywiki/tight/functions.tid | 2 +- 3 files changed, 9 insertions(+), 34 deletions(-) diff --git a/themes/tiddlywiki/centralised/styles.tid b/themes/tiddlywiki/centralised/styles.tid index 0271a512a49..30116b29a95 100644 --- a/themes/tiddlywiki/centralised/styles.tid +++ b/themes/tiddlywiki/centralised/styles.tid @@ -11,23 +11,23 @@ tags: [[$:/tags/Stylesheet]] html .tc-story-river { position: relative; - width: min({{$:/themes/tiddlywiki/centralised/metrics/storywidth}},calc(100% - (2 * {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}}))); - padding: 42px {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}} 42px {{$:/themes/tiddlywiki/centralised/metrics/storypaddingleft}}; + width: min(<>,calc(100% - (2 * <>))); + padding: 42px <> 42px <>; margin: 0 auto; text-align: left; } html body.tc-body .tc-sidebar-left .tc-story-river { margin: 0 auto; - padding-right: {{$:/themes/tiddlywiki/centralised/metrics/storypaddingright}}; - padding-left: {{$:/themes/tiddlywiki/centralised/metrics/storypaddingleft}}; + padding-right: <>; + padding-left: <>; } html .tc-sidebar-scrollable { text-align: left; left: 50%; right: 0; - margin-left: min(calc((100% - (2 * {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}})) / 2 - 42px),calc({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2 - 42px)); + margin-left: min(calc((100% - (2 * <>)) / 2 - 42px),calc(<> / 2 - 42px)); width: auto; } @@ -35,7 +35,7 @@ tags: [[$:/tags/Stylesheet]] margin-left: 0; right: 50%; left: 0; - margin-right: min(calc((100% - (2 * {{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}})) / 2 - 42px),calc({{$:/themes/tiddlywiki/centralised/metrics/storywidth}} / 2 - 42px)); + margin-right: min(calc((100% - (2 * <>)) / 2 - 42px),calc(<> / 2 - 42px)); padding-right: 0px; padding-left: 42px; } diff --git a/themes/tiddlywiki/tight/base.tid b/themes/tiddlywiki/tight/base.tid index 5e8ff337ae0..10968f4098d 100644 --- a/themes/tiddlywiki/tight/base.tid +++ b/themes/tiddlywiki/tight/base.tid @@ -49,12 +49,12 @@ tags: [[$:/tags/Stylesheet]] <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]] %> html body.tc-body div.tc-sidebar-scrollable { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc(<> + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); + left: clamp(calc(<> + <> + 42px),calc(<> + 42px),calc(100% - <> + 42px)); } html body.tc-body .tc-sidebar-left div.tc-sidebar-scrollable { left: 0; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + 42px),calc(<> + 42px),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + 42px)); + right: clamp(calc(<> + <> + 42px),calc(<> + 42px),calc(100% - <> + 42px)); } <% endif %> @@ -116,29 +116,4 @@ tags: [[$:/tags/Stylesheet]] margin-top: -4px; } - html body.tc-body .tc-sidebar-resizer { - width: 12px; - right: auto; - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc(<>),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <>),calc(<>)),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <> - <>)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); - } - - html body.tc-body .tc-sidebar-left .tc-sidebar-resizer { - left: auto; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),clamp(calc(<>),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <>),calc(<>)),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <> - <>)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); - } - - <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]] %> - - html body.tc-body .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - <>),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); - right: auto; - } - - html body.tc-body .tc-sidebar-left .tc-sidebar-resizer { - left: auto; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),calc(100% - <>),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}})); - } - - <% endif %> - } diff --git a/themes/tiddlywiki/tight/functions.tid b/themes/tiddlywiki/tight/functions.tid index d01adc7ecad..17f1e0c9c47 100644 --- a/themes/tiddlywiki/tight/functions.tid +++ b/themes/tiddlywiki/tight/functions.tid @@ -5,4 +5,4 @@ title: $:/themes/tiddlywiki/tight/functions \function set.sidebarwidth() [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then[yes]] :else[[no]] \function sidebar.resizer.maxwidth() 12px -\function sidebar.resizer.width() <> +\function sidebar.resizer.width() [] From 743b465025088085e0685399d7c1e98d549a06bd Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 26 Oct 2024 08:13:14 +0200 Subject: [PATCH 089/147] make everything even more generic --- core/ui/PageTemplateClassFilters.tid | 2 +- core/wiki/functions/themes.tid | 6 ++++++ themes/tiddlywiki/vanilla/ThemeTweaks.tid | 4 ++-- themes/tiddlywiki/vanilla/options.multids | 2 +- themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/core/ui/PageTemplateClassFilters.tid b/core/ui/PageTemplateClassFilters.tid index fbe2660cdfc..e1babac4b3f 100644 --- a/core/ui/PageTemplateClassFilters.tid +++ b/core/ui/PageTemplateClassFilters.tid @@ -1,4 +1,4 @@ title: $:/core/ui/PageTemplateClassFilters tags: $:/tags/ClassFilters/PageTemplate -[{$:/themes/tiddlywiki/vanilla/options/sidebarposition}match[left]then[tc-sidebar-left]] \ No newline at end of file +[match[left]then[tc-sidebar-left]] \ No newline at end of file diff --git a/core/wiki/functions/themes.tid b/core/wiki/functions/themes.tid index a9a51d1cab7..b395c715e9c 100644 --- a/core/wiki/functions/themes.tid +++ b/core/wiki/functions/themes.tid @@ -9,6 +9,12 @@ tags: $:/tags/Global \function get.theme.metric(metric) [function[get.base.theme.metric],{$:/theme},first[]get[text]] +\function get.base.theme.option.recursive(theme,option) [get[dependents]enlist-input[]] :map[function[get.base.theme.option],,