This Engineering Notebook post continues a previous 
<https://groups.google.com/g/leo-editor/c/MsfiyNpE5oU> entry concerning 
Leo's VR and free_layout plugins. I've revised my thoughts while working on 
PR #3893 <https://github.com/leo-editor/leo-editor/pull/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

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/3ad439f1-de6f-405a-9078-60048cb95015n%40googlegroups.com.

Reply via email to