From a1b356e59f1a91fa67d4e9bafbcc62065243a20a Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sun, 27 Oct 2024 05:14:47 +0100 Subject: [PATCH] update menubar plugin --- core/wiki/functions/themes.tid | 4 ++++ plugins/tiddlywiki/menubar/styles.tid | 8 -------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/core/wiki/functions/themes.tid b/core/wiki/functions/themes.tid index 5e79e6269..991062a37 100644 --- a/core/wiki/functions/themes.tid +++ b/core/wiki/functions/themes.tid @@ -27,6 +27,10 @@ tags: $:/tags/Global \function sidebarbreakpoint-minus-one() [function[subtract.one.from.sidebarbreakpoint],] :else[] +\function add.one.to.breakpoint(value) [is.pixel.valueadd[1]addsuffix[px]] :else[is.cm.valuefunction[convert.to.pixels],,[cm]add[1]divide[37.8]addsuffix[cm]] :else[is.mm.valuefunction[convert.to.pixels],,[mm]add[1]divide[37.8]multiply[10]addsuffix[mm]] :else[is.Q.valuefunction[convert.to.pixels],,[Q]add[1]divide[37.8]multiply[40]addsuffix[Q]] :else[is.in.valuefunction[convert.to.pixels],,[in]add[1]divide[96]addsuffix[in]] :else[is.pc.valuefunction[convert.to.pixels],,[pc]add[1]divide[96]multiply[6]addsuffix[pc]] :else[is.pt.valuefunction[convert.to.pixels],,[pt]add[1]divide[96]multiply[72]addsuffix[pt]] :else[is.em.valuefunction[convert.to.pixels],,[em]add[1]divide{$:/themes/tiddlywiki/vanilla/metrics/fontsize}addsuffix[em]] + +\function breakpoint-plus-one() [function[add.one.to.breakpoint],{$:/config/plugins/menubar/breakpoint}] :else[{$:/config/plugins/menubar/breakpoint}] + \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],,] diff --git a/plugins/tiddlywiki/menubar/styles.tid b/plugins/tiddlywiki/menubar/styles.tid index 26a96be01..84e6b16e7 100644 --- a/plugins/tiddlywiki/menubar/styles.tid +++ b/plugins/tiddlywiki/menubar/styles.tid @@ -1,14 +1,6 @@ title: $:/plugins/tiddlywiki/menubar/styles tags: [[$:/tags/Stylesheet]] -\define breakpoint-plus-one() -<$text text={{{ [{$:/config/plugins/menubar/breakpoint}removesuffix[px]add[1]addsuffix[px]] ~[{$:/config/plugins/menubar/breakpoint}] }}} /> -\end - -\define sidebarbreakpoint-minus-one() -<$text text={{{ [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}removesuffix[px]subtract[1]addsuffix[px]] ~[{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] }}} /> -\end - \define set-sidebar-scrollable-top-if-hamburger() <$list filter="[all[tiddlers+shadows]tag[$:/tags/MenuBar]] -[all[tiddlers+shadows]prefix[$:/config/plugins/menubar/MenuItems/Visibility/]regexp:text[hide]removeprefix[$:/config/plugins/menubar/MenuItems/Visibility/]] -[all[tiddlers+shadows]tag[$:/tags/TopLeftBar]limit[1]then[]else[$:/plugins/tiddlywiki/menubar/items/topleftbar]] -[all[tiddlers+shadows]tag[$:/tags/TopRightBar]limit[1]then[$:/plugins/tiddlywiki/menubar/items/toprightbar]] -$:/plugins/tiddlywiki/menubar/items/hamburger +[limit[1]]">