From bbcfba75aa750ba499fb457e5dc71477120154c0 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Fri, 1 Nov 2024 16:10:56 +0100 Subject: [PATCH] updates --- core/wiki/macros/sidebar-resizer.tid | 11 +++++--- themes/tiddlywiki/centralised/functions.tid | 2 +- themes/tiddlywiki/vanilla/base.tid | 26 +++++++++---------- themes/tiddlywiki/vanilla/functions.tid | 2 +- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 4 +-- 5 files changed, 24 insertions(+), 21 deletions(-) diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 9b3a9b2e9..a868e47b0 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -122,6 +122,11 @@ title: $:/core/procedures/sidebar-resizer :else[addsuffix] \end +\function get.story-sidebar.padding() +[match[left]then] +:else[] +\end + \procedure set-storywidth-storyright-actions() <$let storyRightStart={{{ [get[start-story-right]] }}} @@ -131,11 +136,11 @@ title: $:/core/procedures/sidebar-resizer storyMinWidthValue={{{ [!is[blank]is[tiddler]get[text]] :else[!is[blank]is[missing]then] :else[] }}} storyMinWidth={{{ [convert.to.pixels.locally] }}} sidebarMinWidthValue={{{ [!is[blank]is[tiddler]get[text]] :else[!is[blank]is[missing]then] :else[] }}} - sidebarMinWidth={{{ [convert.to.pixels.locally] }}} - storyPaddingLeftValue={{{ [!is[blank]is[tiddler]get[text]] :else[!is[blank]is[missing]then[0px]] :else[get.theme.metric[storypaddingleft]] }}} + storyPaddingLeftValue={{{ [!is[blank]is[tiddler]get[text]] :else[!is[blank]is[missing]then[0px]] :else[] }}} storyPaddingLeft={{{ [convert.to.pixels.locally] }}} - storyPaddingRightValue={{{ [!is[blank]is[tiddler]get[text]] :else[!is[blank]is[missing]then[0px]] :else[get.theme.metric[storypaddingright]] }}} + storyPaddingRightValue={{{ [!is[blank]is[tiddler]get[text]] :else[!is[blank]is[missing]then[0px]] :else[] }}} storyPaddingRight={{{ [convert.to.pixels.locally] }}} + sidebarMinWidth={{{ [convert.to.pixels.locallysubtract] }}} storyLeftValue={{{ [!is[blank]get[text]] :else[] }}} storyLeft={{{ [convert.to.pixels.locally] }}} clampedDiff={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} diff --git a/themes/tiddlywiki/centralised/functions.tid b/themes/tiddlywiki/centralised/functions.tid index fb26e00de..713b23cf1 100644 --- a/themes/tiddlywiki/centralised/functions.tid +++ b/themes/tiddlywiki/centralised/functions.tid @@ -5,4 +5,4 @@ title: $:/themes/tiddlywiki/centralised/functions \function set.sidebarwidth() no \function sidebar.resizer.maxwidth() 21px -\function sidebar.resizer.width() [[min(calc(]addsuffixaddsuffix[ / 2),]addsuffixaddsuffix[)]] +\function sidebar.resizer.width() [!match[left]then[min(calc(]addsuffixaddsuffix[ / 2),]addsuffixaddsuffix[)]] :else[[min(calc(]addsuffixaddsuffix[ / 2),]addsuffixaddsuffix[)]] diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 0391c6e7a..978da8d66 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1019,7 +1019,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(<> + <>),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; @@ -1031,31 +1031,32 @@ 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(<>),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; } html[dir="rtl"] .tc-sidebar-scrollable { - padding-right: 42px; + padding-right: <>; padding-left: 0; } html[dir="rtl"] .tc-sidebar-scrollable:not(.tc-sidebar-left .tc-sidebar-scrollable) { - padding-right: 42px; + padding-right: <>; padding-left: 0; } .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(<> + <>),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + <>)); - padding: 42px {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} 42px {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingleft}}; + width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + <>)); + padding: 42px <> 42px <>; } .tc-sidebar-left .tc-story-river { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - <>),calc(100% - <> - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - <>),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - <>)); - right: max(0px,calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + <>)); + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}),calc(100% - <> - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + <>)); + width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},<>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + <>)); + right: max(0px,calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}})); } html[dir="rtl"] .tc-sidebar-left .tc-story-river { @@ -1184,16 +1185,13 @@ button.tc-btn-invisible.tc-remove-tag-button { @media (min-width: <>) { .tc-tiddler-frame { padding: 28px 42px 42px 42px; - width: clamp(0px,calc(<> + <>),100%); + width: clamp(0px,calc(<>),100%); border-radius: 2px; } - .tc-sidebar-left .tc-tiddler-frame { - width: clamp(0px,calc(<> + <>),100%); - } - .tc-sidebar-left .tc-tiddler-frame { left: auto; + width: clamp(0px,calc(<>),100%); right: 0; } diff --git a/themes/tiddlywiki/vanilla/functions.tid b/themes/tiddlywiki/vanilla/functions.tid index de016d109..48ffdaa30 100644 --- a/themes/tiddlywiki/vanilla/functions.tid +++ b/themes/tiddlywiki/vanilla/functions.tid @@ -5,4 +5,4 @@ title: $:/themes/tiddlywiki/vanilla/functions \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[)]] +\function sidebar.resizer.width() [!match[left]then[min(calc(]addsuffixaddsuffix[ / 2),]addsuffixaddsuffix[)]] :else[[min(calc(]addsuffixaddsuffix[ / 2),]addsuffixaddsuffix[)]] diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index c9446f430..a4bc3f571 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -108,12 +108,12 @@ code-body: yes <%if [match[yes]] %> .tc-sidebar-resizer.tc-main-sidebar-resizer { - 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))); + 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.tc-main-sidebar-resizer { left: auto; - 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))); + 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))); } <% endif %>