"Once this rule of thumb became clear, I saw that the "render-focused" 
layout must define its own QHBoxLayout widget. Otherwise, Qt will position 
the VR pane vertically." 

Not so. The "render-focused" layout can be achieved without any new layout 
widgets.  They would just complicate matters. How you get the layout is to 
re-parent the body frame into the main splitter at index 2, and re-parent 
VR/VRx into the secondary splitter.  Then you set the secondary splitter to 
vertical orientation. Jake has already presented a script that does just 
this. If a VR/VR3 widget doesn't exist, then one needs to be created first.

Even when you need a new container, you don't need to use a layout widget. 
You make a new splitter and insert it into an existing splitter using 
insertWidget(index, 
widget). Jake's script for his "quadrant" layout (or my minor update to it) 
does this.

How I get VR3 to overlay the body editor is to reparent it right into the 
body frame, which puts it into the body's stacked widget.  That way the 
frame can be swapped between showing the editor and showing VR3.

IOW, you can get any layout you want by reparenting widgets, re-orienting 
splitters, and if necessary creating new splitters.  That's all it takes. 
The layout descriptors I posted a few posts above captures all that 
information in a human-readable and scriptable way.  The only real 
challenge is how to represent, create, and destroy new widgets such as 
VR/VR3.

On Wednesday, July 31, 2024 at 8:34:57 AM UTC-4 Thomas Passin wrote:

> There will always be the main and secondary splitters. They should never 
> be removed.  The secondary splitter is contained in the main one.  Once I 
> realized that, things got much clearer.  Any of Leo's standard frames - 
> body editor, tree, log - can be placed into any splitter, and any of the 
> splitters can be set for vertical or horizontal orientation independent of 
> the others.  To change a layout, reparent all known widgets to their new 
> targets (inserting each according to its prescribed index), delete other 
> added widgets from their containers, then delete no-longer-used splitters.
>
> "- Don't use settings to modify layouts." Yes, but settings *can* be used 
> to create new layout script commands.
>
> Here is an example of a layout description that can be instantiated by a 
> script.  It uses composable sublayouts:
>
> SUBLAYOUTS
> ---------------------
> MAIN_SPLITTER = {'name': 'main_splitter', 'orientation': 'horizontal',
>                 'children': ((1, 'secondary_splitter'), (2, 'bodyFrame'))}
>
> SECONDARY_SPLITTER = {'name': 'secondary_splitter', 'orientation': 
> 'vertical',
>                     'children': ((1, 'outlineFrame'), (2, 'logFrame'))}
>
> Known Splitter Name Sequence (used to remove unwanted splitters)
> -----------------------------------------------------
> BASE_SPLITTERS = ('main_splitter', 'secondary_splitter')
>
> Overall Sequence Of SUBLAYOUTS
> -------------------------------
> BASE_LAYOUT = (MAIN_SPLITTER, SECONDARY_SPLITTER)
>
> A Complete Layout
> ------------------
> LAYOUT = {'sub_layouts': BASE_LAYOUT, 'known_splitters': BASE_SPLITTERS}
>
> On Wednesday, July 31, 2024 at 3:56:36 AM UTC-4 Edward K. Ream wrote:
>
> On Tue, Jul 30, 2024 at 6:53 PM Edward K. Ream <edre...@gmail.com> wrote:
>
> > Some layouts are easy to provide. Some will be much harder.
>
> I was too pessimistic.  An easy *rule of thumb* clarifies matters: *The 
> main splitter corresponds to the longest vertical or horizontal line.*
>
> For example, I was having trouble with the "render-focused" layout:
>
>         ┌────────────────┬──────────┐
>      │    outline     │          │
>      ├────────────────┤          │
>      │     body       │    vr    │
>      ├────────────────┤          │
>      │     log        │          │
>      └────────────────┴──────────┘
>
> The rule of thumb says that the main splitter splits *horizontally.* It 
> contains the three panes on the left and a single (initially hidden) VR 
> pane on the right. The secondary splitter (or splitters) split 
> *vertically.*
>
> > Don't expect that magic tools will make all layouts easy to create.
>
> Focusing on splitters clarifies matters. QtDesigner isn't going to help.
>
> Two more rules of thumb:
>
> - All layouts should be independent of each other.
> - Don't use settings to modify layouts.
>
> *Summary*
>
> Leo will soon have a library of official layouts. Plugins can provide 
> more. Leo's existing features will suffice to discover and select layouts.
>
> I expect to complete layout work soon after returning from vacation. 
> Please be patient until then :-)
>
> Edward
>
>

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/315d2841-355f-45ba-9961-a022ce1c04ecn%40googlegroups.com.

Reply via email to