Yes, I get that too. It's because the current layouts have a slot for VRx,
and if VR3 is available it goes into the slot, otherwise VR goes in. We
discussed how to cure that in an earlier thread (it's not hard) but AFAIK
nothing has been decided about making a change to the "official" layouts
yet.
Never fear, here's a script that will display VR alongside that slot in the
layouts:
@language python
"""Toggle VR in main splitter without destroying the instance."""
from leo.core.leoQt import QtCore
def find_widget(name):
return g.app.gui.find_widget_by_name(c, name)
def show_pane(w):
w.setUpdatesEnabled(True)
c.doCommandByName('vr-show')
c.doCommandByName('layout-initialize')
cache = find_widget('leo-layout-cache')
# Find or create VR widget
vr = find_widget('viewrendered_pane')
if not vr:
import leo.plugins.viewrendered as v
vr = v.getVr()
ms = find_widget('main_splitter')
if vr.parent() == ms:
vr.setParent(cache)
else:
ms.addWidget(vr)
g.app.gui.equalize_splitter(ms)
# Avoid flash each time VR pane is re-opened.
QtCore.QTimer.singleShot(60, lambda: show_pane(vr))
If because of your layout you would rather have VR appear next to the
secondary splitter, just change `main_splitter` to 'secondary_splitter'. I
have a custom menu item to launch this command .
This command makes use of another custom command named
"layout-initialize". You can comment out this line but the VR pane will be
better-behaved if you include it. IIRC, I wrote this command before the
layout system was finalized and it could probably be improved on. Some of
the dictionary keys don't even exist anymore so they get defaulted. But it
does the job for me. Here's the command, which you should add as an @command
layout-initialize node to myLeoSettings.leo:
@language python
"""Initialize layout widget cache and dicts."""
from collections import OrderedDict
from leo.core.leoQt import QtWidgets, Orientation
CACHENAME = 'leo-layout-cache'
CACHEHOME = c.frame.top
cache = g.app.gui.find_widget_by_name(c, CACHENAME)
if not cache:
cache = QtWidgets.QWidget(CACHEHOME)
cache.hide()
cache.setObjectName(CACHENAME)
ESSENTIALS = 'layout-essential-objects'
if not c.user_dict.get(ESSENTIALS):
SPLITTERS = OrderedDict(
(('outlineFrame', 'secondary_splitter'),
('logFrame', 'secondary_splitter'),
('secondary_splitter', 'main_splitter'),
('bodyFrame', 'main_splitter'))
)
c.user_dict[ESSENTIALS] = SPLITTERS
DEFAULT_ORIENTATIONS = 'layout-default-orientations'
if not c.user_dict.get(DEFAULT_ORIENTATIONS):
ORIENTATIONS = {
'main_splitter':Orientation.Horizontal,
'secondary_splitter':Orientation.Vertical}
c.user_dict[DEFAULT_ORIENTATIONS] = ORIENTATIONS
If these scripts don't quite work for you, let me know and we'll come up
with a custom layout for you that can contain both VR and VR3.
BTW, did you know you can enable a different set of plugins for individual
outlines? I didn't until a few days ago. You can copy the @enabled-plugins
node to the @settings tree in an outline and change it, e.g., by commenting
out VR3. Only that outline will get the changes. The others will continue
to get the plugins enabled in myLeoSettings.leo.
On Friday, January 3, 2025 at 9:16:23 PM UTC-5 lewis wrote:
> When I give the *vr-show* command the leo screen flashes temporarily but
> the VR pane does not display at all.
>
>
>
> *Leo 6.8.4-devel, build 9c0810cd50Python 3.13.1, PyQt version 6.8.1Windows
> 10*
>
> On Saturday, January 4, 2025 at 10:07:19 AM UTC+11 [email protected]
> wrote:
>
>> On Friday, January 3, 2025 at 5:26:55 PM UTC-5 lewis wrote:
>>
>> The @pdf node renders a pdf file. Thanks for this VR feature.
>> However the VR3 plugin needs to be disabled. If VR and VR3 are both
>> enabled the @pdf node does not render.
>>
>>
>> On my Win11 system I can have VR3 enabled and have VR display a pdf file
>> at the same time. Do you see the VR3 pane but it doesn't show the pdf, or
>> do you not see the VR pane at all?
>>
>
--
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 visit
https://groups.google.com/d/msgid/leo-editor/8b0f199d-a455-4c9d-be82-22dd4e7d2247n%40googlegroups.com.