From fe31cd38665f4a1d1e913a888f47b05b63357447 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 10 Nov 2024 11:45:53 +0100 Subject: [PATCH] take into account that story-padding left and story-padding right changes sidebar maxwidth, storyright min --- core/ui/PageTemplate/sidebar-resizer.tid | 1 - core/wiki/functions/themes.tid | 4 ++++ core/wiki/macros/sidebar-resizer.tid | 15 ++++++++------- themes/tiddlywiki/vanilla/base.tid | 19 ++++++++++--------- themes/tiddlywiki/vanilla/sidebar-resizer.tid | 8 ++++---- 5 files changed, 26 insertions(+), 21 deletions(-) diff --git a/core/ui/PageTemplate/sidebar-resizer.tid b/core/ui/PageTemplate/sidebar-resizer.tid index 2ff8b4b13..ceca2da6b 100644 --- a/core/ui/PageTemplate/sidebar-resizer.tid +++ b/core/ui/PageTemplate/sidebar-resizer.tid @@ -8,7 +8,6 @@ code-body: yes \function resizer.state() [{$:/state/sidebar}] \function resizer.class() tc-main-sidebar-resizer \function set.throttling() yes -\function get.story-sidebar.offset() 42px \whitespace trim <%if [match[show]] %> diff --git a/core/wiki/functions/themes.tid b/core/wiki/functions/themes.tid index 152d234de..0672c2000 100644 --- a/core/wiki/functions/themes.tid +++ b/core/wiki/functions/themes.tid @@ -109,3 +109,7 @@ code-body: yes \function get.current.theme() [{$:/theme}!is[blank]] :else[all[tiddlers+shadows]plugin-type[theme]plugin-priority[0]first[]] \function get.theme.storywidthoverlap() [[calc(abs(]addsuffixaddsuffix[ - ]addsuffixaddsuffix[ - ]addsuffixaddsuffix[))]] + +\function get.theme.storyleftpadding.excess() [[calc(]addsuffixaddsuffix[ - ]addsuffixaddsuffix[)]] + +\function get.theme.storyrightpadding.excess() [[calc(]addsuffixaddsuffix[ - ]addsuffixaddsuffix[)]] diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 5020dd626..fae2bff9c 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -200,12 +200,13 @@ title: $:/core/procedures/sidebar-resizer storyLeftValue={{{ [!is[blank]is[tiddler]get[text]] :else[!is[blank]is[missing]then] :else[] }}} storyLeft={{{ [convert.to.pixels.locally] }}} sidebarMinWidth={{{ [convert.to.pixels.locally] }}} - storySidebarOffset={{{ [convert.to.pixels.locally] :else[[0]] }}} + storySidebarOffset={{{ [convert.to.pixels.locally] :else[[0]] }}} + storyPaddingLeftExcess={{{ [subtract] }}} + storyPaddingRightExcess={{{ [subtract] }}} sidebarMinWidthWithoutOffset={{{ [subtract] }}} tiddlerWidthMetric={{{ [get[tiddler-width-metric]] }}} tiddlerWidthStart={{{ [get[start-tiddler-width]] }}} - - intermediateStoryWidthStart={{{ [] }}} + storyMinWidth={{{ [addadd] }}} intermediateStoryWidth={{{ [add] }}} intermediateStoryRight={{{ [add] }}} @@ -266,14 +267,14 @@ title: $:/core/procedures/sidebar-resizer sidebarMinWidthValue={{{ [!is[blank]is[tiddler]get[text]] :else[!is[blank]is[missing]then] :else[] }}} sidebarWidthMetric={{{ [get[sidebar-width-metric]] }}} sidebarMinWidth={{{ [convert.to.pixels.locally] }}} - sidebarPaddingValue={{{ [!is[blank]is[tiddler]get[text]] :else[!is[blank]is[missing]then] :else[] }}} - sidebarPadding={{{ [convert.to.pixels.locally] }}} storyLeftValue={{{ [!is[blank]is[tiddler]get[text]] :else[!is[blank]is[missing]then] :else[] }}} storyLeft={{{ [convert.to.pixels.locally] }}} storyMinWidthValue={{{ [!is[blank]is[tiddler]get[text]] :else[!is[blank]is[missing]then] :else[] }}} storyMinWidth={{{ [convert.to.pixels.locally] }}} - storySidebarOffset={{{ [convert.to.pixels.locally] :else[[0]] }}} - sidebarMaxWidth={{{ [subtractsubtractadd] }}} + storySidebarOffset={{{ [convert.to.pixels.locally] :else[[0]] }}} + storyPaddingLeftExcess={{{ [subtract] }}} + storyPaddingRightExcess={{{ [subtract] }}} + sidebarMaxWidth={{{ [subtractsubtractaddsubtractsubtract] }}} clampedDiff={{{ [addaddsubtractsubtractcompare:number:gt[0]] :else[[0]] }}} sidebarWidth={{{ [subtract] }}} storyWidth={{{ [subtractsubtract] }}} diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 316af0437..3d2b97aa6 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1046,34 +1046,34 @@ button.tc-btn-invisible.tc-remove-tag-button { } .tc-sidebar-scrollable { - left: clamp(calc(<> + <> - <>),<>,calc(100% - <> + 42px)); + left: clamp(calc(<> + <> - <> + <> + <>),<>,calc(100% - <> + <>)); } html[dir="rtl"] .tc-sidebar-left .tc-sidebar-scrollable, .tc-sidebar-left .tc-sidebar-scrollable { - right: clamp(calc(<> + <> - <>),<>,calc(100% - <> + 42px)); + right: clamp(calc(<> + <> - <> + <> + <>),<>,calc(100% - <> + <>)); } html[dir="rtl"] .tc-sidebar-scrollable:not(.tc-sidebar-left .tc-sidebar-scrollable) { - left: clamp(calc(<> + <> - <>),<>,calc(100% - <> + 42px)); + left: clamp(calc(<> + <> - <> + <> + <>),<>,calc(100% - <> + <>)); } .tc-story-river { left: max(0px,<>); - right: clamp(calc(<> - <> - 42px),calc(100% - <> - <>),calc(100% - <> - <>)); - width: clamp(<>,<>,calc(100% - <> + 42px - <> + <>)); + right: clamp(calc(<> - <> - <>),calc(100% - <> - <>),calc(100% - <> - <>)); + width: clamp(<>,<>,calc(100% - <> + <> - <> + <>)); } .tc-sidebar-left .tc-story-river { display: flex; align-items: flex-end; flex-direction: column; - left: clamp(calc(<> - <> - 42px),calc(100% - <> - <>),calc(100% - <> - <>)); + left: clamp(calc(<> - <> - <>),calc(100% - <> - <>),calc(100% - <> - <>)); right: max(0px,<>); } html[dir="rtl"] .tc-sidebar-left .tc-story-river { align-items: flex-start; - left: clamp(calc(<> - <> - 42px),calc(100% - <> - <>),calc(100% - <> - <>)); + left: clamp(calc(<> - <> - <>),calc(100% - <> - <>),calc(100% - <> - <>)); right: max(0px,<>); } @@ -1081,7 +1081,7 @@ button.tc-btn-invisible.tc-remove-tag-button { display: flex; align-items: flex-end; flex-direction: column; - right: clamp(calc(<> - <> - 42px),calc(100% - <> - <>),calc(100% - <> - <>)); + right: clamp(calc(<> - <> - <>),calc(100% - <> - <>),calc(100% - <> - <>)); } <>,<>,(100% - <> - <> + <>)); + width: clamp(<>,<>,(100% - <> - <> + <> - <> - <>)); } .tc-sidebar-left .tc-sidebar-scrollable { left: 0; right: auto; + width: clamp(<>,<>,(100% - <> - <> + <> - <> - <>)); } html[dir="rtl"] .tc-sidebar-left .tc-sidebar-scrollable { diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index bf2c01f82..6eaf92625 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -112,12 +112,12 @@ code-body: yes <%if [match[yes]] %> .tc-sidebar-resizer.tc-main-sidebar-resizer { - left: clamp(calc(<> + <> - (2 * <> / 3)),calc(<> + <> - (2 * <> / 3)),calc(100% - <> + <> + <>) - (2 * <> / 3)); + left: clamp(calc(<> + <> + <> + <> - (2 * <> / 3)),calc(<> + <> - (2 * <> / 3)),calc(100% - <> + <> + <>) - (2 * <> / 3)); } .tc-sidebar-left .tc-sidebar-resizer.tc-main-sidebar-resizer { left: auto; - right: clamp(calc(<> + <> - (2 * <> / 3)),calc(<> + <> - (2 * <> / 3)),calc(100% - <> + <> + <>) - (2 * <> / 3)); + right: clamp(calc(<> + <> + <> + <> - (2 * <> / 3)),calc(<> + <> - (2 * <> / 3)),calc(100% - <> + <> + <>) - (2 * <> / 3)); } <% endif %> @@ -125,12 +125,12 @@ code-body: yes <%if [match[yes]] %> .tc-sidebar-resizer.tc-main-sidebar-resizer { - left: clamp(calc(<> + <> - <> + (<> / 3)),calc(100% - <> + (<> / 3)),calc(100% - <> + (<> / 3))); + left: clamp(calc(<> + <> + <> + <> - <> + (<> / 3)),calc(100% - <> + (<> / 3)),calc(100% - <> + (<> / 3))); } .tc-sidebar-left .tc-sidebar-resizer.tc-main-sidebar-resizer { left: auto; - right: clamp(calc(<> + <> - <> + (<> / 3)),calc(100% - <> + (<> / 3)),calc(100% - <> + (<> / 3))); + right: clamp(calc(<> + <> + <> + <> - <> + (<> / 3)),calc(100% - <> + (<> / 3)),calc(100% - <> + (<> / 3))); } <% endif %>