I have been improving the new layout and integrating it into Leo's code
base. For those of you who so kindly tried out the demo scripts earlier,
here's what has changed:
1. A new python file, leo/plugins/qt_layout.py. This contains some layout
descriptors, and a new LayoutCacheWidget Qwidget. This widget serves as a
place to store layout components not needed by the current layout, so they
can be found when needed again. It also has code to apply layouts using a
layout descriptor. All six of Leo's current standard layouts are
reproduced in the qt_layout module, most of them using layout descriptors.
2. The DynamicWindow of an outline now creates a instance of the
LayoutCacheWidget during startup. This is always available as:
dw = c.frame.top
cache = dw.layout_cache
Given a layout descriptor, applying it is simple:
cache.restoreFromLayout(layout)
The programming techniques some people used to create other layouts will
still work, but they should be changed to store unused splitters and
widgets in the new cache widget.
Some VR3 commands have been adjusted to play better with the new code,
especially vr3-toggle and vr3-show.
A PR for the new code has been submitted. You don't have to wait for it to
be reviewed and merged - get the tbp-leo_layouts branch from my cloned repo
at
https://github.com/tbpassin/leo-editor/tree/tbp-leo_layouts
I have also revised the Layout-Demo outline. It creates a new menu filled
with items that show how many of the commands work, along with others that
are scripts not included in the qt_layout module. This outline can be
gotten from my repo at
https://github.com/tbpassin/leo-editor-contrib/tree/devel/Projects/new-layout
Be sure to read the "About This Outline" node in the outline.
--
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/b6d2d8f7-2e26-4c0e-8491-8782b34d63f3n%40googlegroups.com.