On Sat, Jul 27, 2024 at 2:12 PM Thomas Passin wrote: This script will safely undo all the layout changes we have been discussing > recently. It will work for most layouts that include zero, one, or both of > VR and VR3. It does not solve the general problem.
Thanks for this work. My experiments with PR #4017 <https://github.com/leo-editor/leo-editor/pull/4017> suggest there is no way (in general) to switch layouts without restarting Leo. In the PR, dw.reloadSettings calls the new *dw.recreateMainWindow* method. This method *restarts Leo* if the layout has changed. This approach solves one problem but creates another. How can we allow users to define their own layouts? We don't want to mandate executing `@script` nodes at startup, so a descriptive approach seems necessary. The PR suggests using an `@data` node but provides no details. Let me sketch the idea. When the main splitter has the (usual) vertical orientation, the (working!!) code to create the layout is (roughly): self.createOutlinePane(secondary_splitter) self.createLogPane(secondary_splitter) self.vr_parent_frame = vr_splitter = QtWidgets.QSplitter() vr_splitter.setObjectName('vr-splitter') self.createBodyPane(vr_splitter) main_splitter.addWidget(vr_splitter) A description of this code in an *@data qt-layouts* node might look something like this: legacy= secondary_splitter: tree, log main_splitter: vr_splitter with the understanding that: - Layouts always create main and secondary splitters. - Layouts will create the vr_splitter only if needed. - The vr_splitter always contains the body and VR pane. This scheme will surely be modified as we go along. *Summary* The PR will soon contain hard-coded methods that define all Jake's suggested layouts. When that work is complete, I'll start work on *@data qt-layouts*. 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/CAMF8tS3-J3OJ1LeUdS2TqGorHM4_TGB0rHR-7Zps7hec5E5cWg%40mail.gmail.com.