PR #3911 contains preliminary work on deprecating Terry's trailblazing free_layout and nested_splitter plugins. This post is a progress report.
Goals
Scripts (@button nodes) and plugins should be able to do the following easily and intuitively:
- Detach Leo's screen components, thereby making them floating windows.
- Move Leo's screen components to other locations.
Tools
Terry's plugins contain non-trivial low-level helpers that have served as models for utilities in the PR. A higher-order gui API will support the goals above.
The gui API will use a descriptor class analogous to the caching code in Terry's plugins. This class will output JSON descriptions of actions that can persist between different runs of Leo.
Summary
This post discusses the PR's design. The PR:
- turns Terry's innovative code inside out, exposing previously private helpers.
- creates a descriptive gui API that hides implementation details.
All details are still in flux. All your questions and comments are welcome.
Edward
I'm very enthusiastic about this work. It will eventually be a real boon to users and developers, I'm sure.
I hope that existing GUI plugins that use the nested-splitter/free-layout will be able to continue working without needing to be reworked
>> I hope that existing GUI plugins that use the nested-splitter/free-layout will be able to continue working without needing to be reworked
> When True, the g.allow_nested_splitter switch enables both plugins to work as before. As noted in the PR, this switch might be on "forever."
Belay that. Leo's codebase should not contain toxic code switches. Such switches are intolerable in the long run.
I feel strongly enough about this that I am willing to convert legacy code myself. This offer extends to you, Thomas, and anyone else.
Assuming the PR succeeds, here is my present plan:
- Terry's plugins (and the switch) will be part of Leo 6.7.9.
- As part of 6.7.9, I'll convert all affected code in LeoPyRef.py.
- The 6.7.9 release notes will warn of a breaking change in Leo 6.7.10 and will offer to help with conversion.
- I'll remove the switch and the two plugins as soon as 6.7.9 goes out the door.
Summary
If PR #3911 succeeds, Leo 6.7.9 will be the last release that supports the free_layout and nested_splitter plugins.
The 6.7.9 release notes will warn of the breaking change and will offer to help convert any existing code.
Leo's long history includes removing many overly complex features. Removing all vestiges of these plugins will make Leo simpler and more maintainable.
Again, I welcome all comments.
Edward
This will be complicated enough and have a potentially big impact on existing code and users that I'd like to see a concept of operations and some requirements.
I haven't kept up with the latest progress. In my previous code, I created a textedit panel to output something.
It works. But I'm not sure, is there anything else I need to pay attention to? The original code maybe copy from Thomas, I don't remember :D I don’t have the guts to study layout yet
Thanks Edward and Thomas.Btw, do we need to put Leo's Qt Widget hierarchy Code to the doc? I believe it is very useful.
For those who haven't defined a custom menu in myLeoSettings.leo before, here is a screenshot of what I've got in my setting tree. It defines a menu named "Local", which displays just before (to the left of) Leo's standard "Help" menu. The string after the @item in each headline is the name of a minibuffer command.