ENB: More about the VR and free_layout plugins

26 views
Skip to first unread message

Edward K. Ream

unread,
May 14, 2024, 8:55:34 AM5/14/24
to leo-editor

This Engineering Notebook post continues a previous entry concerning Leo's VR and free_layout plugins. I've revised my thoughts while working on PR #3893.

The free_layout plugin

The free_layout plugin will remain for compatibility with existing plugins and scripts.

However, the plugin has several irremediable flaws:

- It is tricky to use, as Thomas can attest.

- It saves layouts to Leo's cache in a platform-dependent manner.

- It supports only widgets that contain "provider" classes.

- It limits what Qt itself can do.

Prototyping layouts

Qt provides extensive capabilities for defining layouts. Plugins and scripts may create layouts directly or load layouts (.ui files) created by Qt Designer. Scripts can do much more than what the free_layout plugin provides.

Leo's @button nodes are a straightforward way of creating and changing layouts. The only drawback is that Leo must not execute buttons on startup because of security considerations. However, it's easy to create plugins that do load layouts at startup.

Summary

The free_layout plugin must remain for compatibility, but I would like to deprecate it.

@button nodes are a straightforward way of creating per-outline layouts. If desired, plugins could change layouts when Leo loads particular outlines.

Next, I'll experiment with bespoke Qt layouts and report my experiences.

All of your questions and comments are welcome.

Edward

P.S. I've recently considered several "fancy" schemes that would load layouts at startup without being security risks. These schemes don't seem worth doing at present. I'll attempt them only as a last resort.

EKR

Reply all
Reply to author
Forward
0 new messages