Thanks, I have already done that though. My point is that with the Sidebar closed, ie not in view, when you use the buttons to open functions of the Sidebar, you cannot close them.
This effectively makes those buttons useless. Because you then have to show the Sidebar in order to close the Side Panel. So you need to have the Sidebar always open if you want to use those functions. Which then makes hiding it pointless.
This is why each of those buttons really needs a Toggle function if you wish to use them and hide the Sidebar.
I hope that makes sense to you.
Live for an ideal and leave no place in the mind for anything else.
1. Create a new button for the command [cmd_ShowSidePanelAndSyntaxTree = 2547] I called it SideTree as an example.
2. Go to Menu/View/ToggleSideBar so that it isn't visible.
3. Click the new SideTree button to show the code tree.
4. Now try to hide the code tree!
You can't, unless you open the SideBar and click the Code Tree button on it. This invalidates the purpose of a single operation button, ie, open tree but not close.
If there is a second button contained within CudaText to close the tree, then that's a solution, but then creates unnecessary clutter when it's more efficient to have one button to toggle a function such as this.
So the order of operation to use this SideTree button is:
1. Click SideTree button to open the Tree.
2. Go to Menu/View/ToggleSideBar to show the SideBar. I have it hidden by default to provide a more distraction free environment.
3. Click the Code Tree button to Hide the SidePanel.
4. Then go to Menu/View/ToggleSideBar to hide it, as that is my requirement.
Live for an ideal and leave no place in the mind for anything else.
Ok, I see that now. But If you're going to use hotkeys, which I don't, then what's the point of buttons in the first place?
I'm not fan of trying to remember a thousand hotkeys for all the apps I use. Maybe it's because I'm not a programmer?
This toggle SidePanel works and is what I'm using, I'm just trying to point out a small flaw in the buttons. If you create a button, it should be able to toggle. I just see no purpose for a button to show something but not hide it? Sorry if I sound harsh, it's not meant that way.
Live for an ideal and leave no place in the mind for anything else.
You do not sound harsh. it is ok wish. The point is that a user must have all actions in the Cmd Palette.
And plugin allows all commands.
Why action "show side panel and codetree" must TOGGLE?
For Toggle we have "ui: toggle side panel"
This action "show side panel and codetree" must ONLY SHOW, so that any plugin can be sure that action shows the tree (it calls the action w/o detecting show state). If plugin wants to TOGGLE, it can call "toggle side panel" action or use the API.