TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
7.97k stars 1.18k forks source link

Make "tc-vertical" optional in $:/core/ui/SideBar/More #1674

Closed rubaboo closed 1 year ago

rubaboo commented 9 years ago

I'd like to have the tabs inside SideBar/More arranged horizontally. I'd rather have that extra width available for the tab content. There is no easy CSS to achieve that, and I'd rather not override the shadow $:/core/ui/SideBar/More to remove "tc-vertical".

Jermolene commented 9 years ago

Hi @nameanyone that's a good idea. Would you be interested in working on a pull request?

rubaboo commented 9 years ago

Sorry, I'm not that skilled yet. I've done some trivial submits before.

Jermolene commented 9 years ago

Hi @nameanyone no problem, your contributions are much appreciated as is!

tobibeer commented 8 years ago

Would it be sensibe to have an optional configuration tiddler right under that namespace, e.g.:

title: $:/core/ui/SideBar/More/horizontal

...the sheer presence of which would trigger the desired magic via conditional variable asignment?

While documented, this could be a feature that ain't in the controlpanel. Is that advisable? Maybe we can, indeed, have some "TiddlyWiki Configurator" plugin... providing all options, also currently hidden ones, perhaps as a flat list. That one can "throw it out" when done.

pmario commented 8 years ago

IMO a little bit of new CSS should be enough to achieve this behaviour. There is no need for a new configuration tiddler and conditional layout handling. ... If CSS is not enough, its a bug.

pmario commented 2 years ago

I had a closer look and I still think, it should be possible to solve it using CSS. .. But messing with the tiddler code is much easier today, than it has been 7 years ago. Today it's pretty much a 2 liner.

Creating the docs and may be a config tiddler is probably 10 times more work.

If $:/core/ui/SideBar/More is changed to the following code and $:/config/ui/SideBar/More/horizontal tiddler contains "yes" then it will show a horizontal view.

\whitespace trim
<div class={{{ [{$:/config/ui/SideBar/More/horizontal}match[yes]then[tc-sidebar-tabs]else[tc-more-sidebar]] }}}>
<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/MoreSideBar]!has[draft.of]]" default={{$:/config/DefaultMoreSidebarTab}} state="$:/state/tab/moresidebar" class={{{ [{$:/config/ui/SideBar/More/horizontal}match[yes]then[tc-sidebar-tabs-more]else[tc-vertical tc-sidebar-tabs-more]] }}} explicitState="$:/state/tab/moresidebar-1850697562"/>
</div>

This feature request is still valid.

Jermolene commented 2 years ago

I would also have expected to be able to achieve the OP with CSS, because CSS is the only difference between the implementation of vertical and horizontal tabs in TW.

pmario commented 2 years ago

The problem with the CSS is, that tc-vertical is used 6 times in vanilla/base CSS, with very complex settings. ...

https://github.com/Jermolene/TiddlyWiki5/blob/9b7edfc1a78422676c20b770e370c5de2eec0e01/themes/tiddlywiki/vanilla/base.tid#L2058

So fixing it with CSS alone will probably need 6 more CSS rules, that are similarly or even more complex. ... So the much simpler and backwards compatible solution will be the 2 liner as described above.

Jermolene commented 2 years ago

So fixing it with CSS alone will probably need 6 more CSS rules, that are similarly or even more complex. ... So the much simpler and backwards compatible solution will be the 2 liner as described above.

OK, I'm happy with that. Please do create a PR.

pmario commented 1 year ago

@Jermolene -- This one can be closed. We do have a hidden setting now see: More sidebar tabs horizontal #7063

Jermolene commented 1 year ago

Thanks @pmario