1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-10 17:30:26 +00:00

make minwidths configurable

This commit is contained in:
BurningTreeC 2024-10-30 14:18:38 +01:00
parent 669fd60ec5
commit bb673fc807
2 changed files with 11 additions and 7 deletions

View File

@ -128,9 +128,9 @@ title: $:/core/procedures/sidebar-resizer
storyWidthStart={{{ [<get.resizer.state>get[start-story-width]] }}} storyWidthStart={{{ [<get.resizer.state>get[start-story-width]] }}}
storyRightStart={{{ [convert.to.pixels.locally<storyRightStart>] }}} storyRightStart={{{ [convert.to.pixels.locally<storyRightStart>] }}}
storyWidthStart={{{ [convert.to.pixels.locally<storyWidthStart>] }}} storyWidthStart={{{ [convert.to.pixels.locally<storyWidthStart>] }}}
storyMinWidthValue={{{ [<storyMinWidthTiddler>!is[blank]!is[missing]get[text]] :else[<storyMinWidthTiddler>!is[blank]is[missing]then[10px]] :else[<get.theme.metric storyminwidth>] }}} storyMinWidthValue={{{ [<storyMinWidthTiddler>!is[blank]!is[missing]get[text]] :else[<storyMinWidthTiddler>!is[blank]is[missing]then<get.left.minwidth>] :else[<get.theme.metric storyminwidth>] }}}
storyMinWidth={{{ [convert.to.pixels.locally<storyMinWidthValue>] }}} storyMinWidth={{{ [convert.to.pixels.locally<storyMinWidthValue>] }}}
sidebarMinWidthValue={{{ [<sidebarMinWidthTiddler>!is[blank]!is[missing]get[text]] :else[<sidebarMinWidthTiddler>!is[blank]is[missing]then[10px]] :else[<get.theme.metric sidebarminwidth>] }}} sidebarMinWidthValue={{{ [<sidebarMinWidthTiddler>!is[blank]!is[missing]get[text]] :else[<sidebarMinWidthTiddler>!is[blank]is[missing]then<get.right.minwidth>] :else[<get.theme.metric sidebarminwidth>] }}}
sidebarMinWidth={{{ [convert.to.pixels.locally<sidebarMinWidthValue>] }}} sidebarMinWidth={{{ [convert.to.pixels.locally<sidebarMinWidthValue>] }}}
storyPaddingLeftValue={{{ [<storyPaddingLeftTiddler>!is[blank]!is[missing]get[text]] :else[<storyPaddingLeftTiddler>!is[blank]is[missing]then[0px]] :else[get.theme.metric[storypaddingleft]] }}} storyPaddingLeftValue={{{ [<storyPaddingLeftTiddler>!is[blank]!is[missing]get[text]] :else[<storyPaddingLeftTiddler>!is[blank]is[missing]then[0px]] :else[get.theme.metric[storypaddingleft]] }}}
storyPaddingLeft={{{ [convert.to.pixels.locally<storyPaddingLeftValue>] }}} storyPaddingLeft={{{ [convert.to.pixels.locally<storyPaddingLeftValue>] }}}
@ -195,12 +195,12 @@ title: $:/core/procedures/sidebar-resizer
\procedure set-sidebarwidth-actions() \procedure set-sidebarwidth-actions()
<$let <$let
sidebarMinWidthValue={{{ [<sidebarMinWidthTiddler>!is[blank]!is[missing]get[text]] :else[<sidebarMinWidthTiddler>!is[blank]is[missing]then[10px]] :else[<get.theme.metric sidebarminwidth>] }}} sidebarMinWidthValue={{{ [<sidebarMinWidthTiddler>!is[blank]!is[missing]get[text]] :else[<sidebarMinWidthTiddler>!is[blank]is[missing]then<get.right.minwidth>] :else[<get.theme.metric sidebarminwidth>] }}}
sidebarWidthMetric={{{ [<get.resizer.state>get[sidebar-width-metric]] }}} sidebarWidthMetric={{{ [<get.resizer.state>get[sidebar-width-metric]] }}}
sidebarMinWidth={{{ [convert.to.pixels.locally<sidebarMinWidthValue>] }}} sidebarMinWidth={{{ [convert.to.pixels.locally<sidebarMinWidthValue>] }}}
storyLeftValue={{{ [<storyLeftTiddler>!is[blank]get[text]] :else[<get.theme.metric storyleft>] }}} storyLeftValue={{{ [<storyLeftTiddler>!is[blank]get[text]] :else[<get.theme.metric storyleft>] }}}
storyLeft={{{ [convert.to.pixels.locally<storyLeftValue>] }}} storyLeft={{{ [convert.to.pixels.locally<storyLeftValue>] }}}
storyMinWidthValue={{{ [<storyMinWidthTiddler>!is[blank]!is[missing]get[text]] :else[<storyMinWidthTiddler>!is[blank]is[missing]then[10px]] :else[<get.theme.metric storyminwidth>] }}} storyMinWidthValue={{{ [<storyMinWidthTiddler>!is[blank]!is[missing]get[text]] :else[<storyMinWidthTiddler>!is[blank]is[missing]then<get.left.minwidth>] :else[<get.theme.metric storyminwidth>] }}}
storyMinWidth={{{ [convert.to.pixels.locally<storyMinWidthValue>] }}} storyMinWidth={{{ [convert.to.pixels.locally<storyMinWidthValue>] }}}
sidebarMaxWidth={{{ [<widgetNodeWidth>subtract<storyLeft>subtract<storyMinWidth>] }}} sidebarMaxWidth={{{ [<widgetNodeWidth>subtract<storyLeft>subtract<storyMinWidth>] }}}
clampedDiff={{{ [<storyLeft>add<storyMinWidth>add<startSidebarWidth>subtract<widgetNodeWidth>compare:number:gt[0]] ~0 }}} clampedDiff={{{ [<storyLeft>add<storyMinWidth>add<startSidebarWidth>subtract<widgetNodeWidth>compare:number:gt[0]] ~0 }}}
@ -230,7 +230,7 @@ title: $:/core/procedures/sidebar-resizer
storyMinWidth={{{ [convert.to.pixels.locally<storyMinWidthValue>] }}} storyMinWidth={{{ [convert.to.pixels.locally<storyMinWidthValue>] }}}
storyWidthStart={{{ [<get.resizer.state>get[start-story-width]] }}} storyWidthStart={{{ [<get.resizer.state>get[start-story-width]] }}}
storyWidthStart={{{ [convert.to.pixels.locally<storyWidthStart>] }}} storyWidthStart={{{ [convert.to.pixels.locally<storyWidthStart>] }}}
sidebarMinWidthValue={{{ [<sidebarMinWidthTiddler>!is[blank]!is[missing]get[text]] :else[<sidebarMinWidthTiddler>!is[blank]is[missing]then[10px]] :else[{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}] }}} sidebarMinWidthValue={{{ [<sidebarMinWidthTiddler>!is[blank]!is[missing]get[text]] :else[<sidebarMinWidthTiddler>!is[blank]is[missing]then<get.right.minwidth>] :else[{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}] }}}
sidebarMinWidth={{{ [convert.to.pixels.locally<sidebarMinWidthValue>] }}} sidebarMinWidth={{{ [convert.to.pixels.locally<sidebarMinWidthValue>] }}}
storyMaxWidth={{{ [<widgetNodeWidth>subtract<sidebarMinWidth>subtract<sidebarMinWidth>] }}} storyMaxWidth={{{ [<widgetNodeWidth>subtract<sidebarMinWidth>subtract<sidebarMinWidth>] }}}
dragDiffMultiplied={{{ [<dragDiff>multiply[2]] }}} dragDiffMultiplied={{{ [<dragDiff>multiply[2]] }}}

View File

@ -2,7 +2,7 @@ title: $:/core/procedures/sliders
tags: $:/tags/Global tags: $:/tags/Global
code-body: yes code-body: yes
\procedure one-cell-slider(width:"100%",minHeight:"10px",template:"",mode:"block",sliderWidth:"12px",padding:"12px",sliderCondition:"yes") \procedure one-cell-slider(width:"100%",minHeight:"10px",template:"",mode:"block",sliderWidth:"12px",padding:"12px",sliderCondition:"yes",leftMinWidth:"100px",rightMinWidth:"100px")
\import $:/core/procedures/sidebar-resizer \import $:/core/procedures/sidebar-resizer
\function get.resizer.style.position() absolute \function get.resizer.style.position() absolute
\function get.template-right.width() [<sidebarWidthTiddler>get[text]] :else[[50%]] \function get.template-right.width() [<sidebarWidthTiddler>get[text]] :else[[50%]]
@ -10,6 +10,8 @@ code-body: yes
\function get.resizer.style.width() [<sliderWidth>] \function get.resizer.style.width() [<sliderWidth>]
\function set.throttling() no \function set.throttling() no
\function get.template.left() \function get.template.left()
\function get.left.minwidth() [<leftMinWidth>]
\function get.right.minwidth() [<rightMinWidth>]
\whitespace trim \whitespace trim
<div <div
@ -52,13 +54,15 @@ code-body: yes
</div> </div>
\end \end
\procedure two-cell-slider(width:"100%",minHeight:"10px",templateLeft:"",templateRight:"",mode:"block",sliderWidth:"12px",padding:"12px",sliderCondition:"yes") \procedure two-cell-slider(width:"100%",minHeight:"10px",templateLeft:"",templateRight:"",mode:"block",sliderWidth:"12px",padding:"12px",sliderCondition:"yes",leftMinWidth:"100px",rightMinWidth:"100px")
\import $:/core/procedures/sidebar-resizer \import $:/core/procedures/sidebar-resizer
\function get.resizer.style.position() absolute \function get.resizer.style.position() absolute
\function get.template-right.width() [<sidebarWidthTiddler>get[text]] :else[[50%]] \function get.template-right.width() [<sidebarWidthTiddler>get[text]] :else[[50%]]
\function get.resizer.style.left() [[calc(100% - ]addsuffix<get.template-right.width>addsuffix[)]] \function get.resizer.style.left() [[calc(100% - ]addsuffix<get.template-right.width>addsuffix[)]]
\function get.resizer.style.width() [<sliderWidth>] \function get.resizer.style.width() [<sliderWidth>]
\function set.throttling() no \function set.throttling() no
\function get.left.minwidth() [<leftMinWidth>]
\function get.right.minwidth() [<rightMinWidth>]
\whitespace trim \whitespace trim
<div <div