Replies: 5 comments 6 replies
-
@rr-tw5 thanks for the suggestion. I'll add a new tiddler for toggling the sidebar, without overriding |
Beta Was this translation helpful? Give feedback.
-
@rr-tw5 can you check commit c51b513 and tell me if that suits your needs? |
Beta Was this translation helpful? Give feedback.
-
Many thanks. The code looks good to me. I hadn't thought of that solution, so by sharing the 'key' field we can call more than one action from one keyboard shortcut? As I said I'm new to GitHub: How do you suggest I test it? |
Beta Was this translation helpful? Give feedback.
-
So I just went ahead and created the tiddler manually. Although it works well in notebook, the shortcut no longer works in vanilla theme. I remember I noticed the same thing happens with search in sidebar 'ctrl-shift-F'. If I'm right, then it would be better to write reveals into both/all the shortcut codes you've made, so that depending on the theme it acts appropriately (differently but consistently). Seems once you override/duplicate a keyboard shortcut (either with the keystroke, or maybe also with the key field), it otherwise stops working. So my suggestion is to add this code to the tiddler: <$reveal state="$:/theme" type="nomatch" text="$:/themes/nico/notebook"> |
Beta Was this translation helpful? Give feedback.
-
One last comment (I hope). I do find that there is an inability to use ctrl-shift-F for opening the search bar in both vanilla and notebook themes. Only the first one to use establish it seems to be able to continue to use it. |
Beta Was this translation helpful? Give feedback.
-
For those of us who are keyboard driven, that can be a great help.
I've made a toggle-notebook-sidebar series of shortcuts. Even though it's really obvious, here's the code.
Title: $:/core/ui/KeyboardShortcuts/toggle-notebook-sidebar
<$list filter="[[$:/state/notebook-sidebar]is[missing]] [{$:/state/notebook-sidebar}removeprefix[yes]]" emptyMessage="""$tiddler="$ :/state/notebook-sidebar" text="yes"/>$tiddler="$ :/state/notebook-sidebar" text="no"/>
<$action-setfield
""">
<$action-setfield
</$list>
Field:
key: ((toggle-notebook-sidebar))
Then I changed the default sidebar key
But thinking aloud, as I wrote before about hiding the other sidebar (perhaps incorrectly as an issue––as I also wrote there I'm learning GitHub etiquette): perhaps adding a 'reveal' to $:/core/ui/KeyboardShortcuts/toggle-sidebar would be helpful to share the same code according which theme is presently selected.
This works for me, if you're happy to overwrite another element of the core with your theme…
Title: $:/core/ui/KeyboardShortcuts/toggle-sidebar
<$reveal state="$:/theme" type="nomatch" text="$:/themes/nico/notebook">$tiddler="$ :/state/sidebar" text="yes"/>$tiddler="$ :/state/sidebar" text="no"/>$tiddler="$ :/state/notebook-sidebar" text="yes"/>$tiddler="$ :/state/notebook-sidebar" text="no"/>
<$list filter="[[$:/state/sidebar]is[missing]] [{$:/state/sidebar}removeprefix[yes]]" emptyMessage="""
<$action-setfield
""">
<$action-setfield
</$list>
</$reveal>
<$reveal state="$:/theme" type="match" text="$:/themes/nico/notebook">
<$list filter="[[$:/state/notebook-sidebar]is[missing]] [{$:/state/notebook-sidebar}removeprefix[yes]]" emptyMessage="""
<$action-setfield
""">
<$action-setfield
</$list>
</$reveal>
Beta Was this translation helpful? Give feedback.
All reactions