Layout questions

28 views
Skip to first unread message

Arjan

unread,
Nov 11, 2024, 10:22:18 AM11/11/24
to leo-editor
Hello, in Leo v6.8.2 I have configured `@string qt-layout-name = vertical-thirds`, which is closest to what I want. Some questions:

1. How to persist the size of the panes? This used to be remembered after restarting leo, but now the left-right split always starts at 50%.
2. Previously I was using a layout of 3 panes next to each other, since I use an ultrawide display: outline, body, log. Is such a layout still possible?
3. There still is a free_layout plugin included. Is it still supposed to work? (I get ..  line 442, in free_layout_context_menu  splitter = c.free_layout.get_top_splitter()`AttributeError: 'NoneType' object has no attribute 'get_top_splitter'` when trying it).

Thomas Passin

unread,
Nov 11, 2024, 10:41:40 AM11/11/24
to leo-editor
On Monday, November 11, 2024 at 10:22:18 AM UTC-5 Arjan wrote:
Hello, in Leo v6.8.2 I have configured `@string qt-layout-name = vertical-thirds`, which is closest to what I want. Some questions:

1. How to persist the size of the panes? This used to be remembered after restarting leo, but now the left-right split always starts at 50%.

With the new layout system, all layouts equalize the pane sizes when applied. There is currently no way to remember what pane sizes used to be. I remember that with the old system, sometimes the sizes were remembered right and sometimes they weren't.  That was annoying so for the new system we didn't put any effort into restoring sizes.  It would be possible to write a script to change the size ratios for any particular layout after it has been applied.  The ratios would be hard-coded into the script. That should not be very hard.
 
2. Previously I was using a layout of 3 panes next to each other, since I use an ultrawide display: outline, body, log. Is such a layout still possible?

It is possible and I use it often.  Currently there is no built-in layout for this arrangement but there are two ways to get it:

1. Use the "vertical-thirds" layout and then run the layout-swap-log-panel command.

2. Run this layout command.  You can make an @command setting for it in myLeoSettings,leo if you like:

from leo.core.leoQt import Orientation

VRX_PLACEHOLDER_NAME = 'viewrenderedx_pane'
LAYOUT = {
    'SPLITTERS': dict(
            (('outlineFrame', 'secondary_splitter'),
            ('secondary_splitter', 'main_splitter'),
            ('bodyFrame', 'main_splitter'),
            ('logFrame', 'main_splitter'),
            (VRX_PLACEHOLDER_NAME, 'main_splitter'))
        ),
    'ORIENTATIONS': {
        'secondary_splitter': Orientation.Vertical,
        'main_splitter': Orientation.Horizontal
    }
}

dw = c.frame.top
cache = dw.layout_cache
cache.restoreFromLayout(LAYOUT)


If there is interest out there - so far it's you and me - this layout could be added to the built-in set of layouts.
 
3. There still is a free_layout plugin included. Is it still supposed to work? (I get ..  line 442, in free_layout_context_menu  splitter = c.free_layout.get_top_splitter()`AttributeError: 'NoneType' object has no attribute 'get_top_splitter'` when trying it).

No, that machinery is gone now.

Arjan

unread,
Nov 11, 2024, 10:51:30 AM11/11/24
to leo-editor
Great, thanks!
Reply all
Reply to author
Forward
0 new messages