Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global (singleton) docks #1289

Closed
edreamleo opened this issue Aug 17, 2019 · 5 comments
Closed

Global (singleton) docks #1289

edreamleo opened this issue Aug 17, 2019 · 5 comments
Assignees
Milestone

Comments

@edreamleo
Copy link
Member

edreamleo commented Aug 17, 2019

First discussed here. This is a precondition for #1093: pyzo features. The "gui" branch contains this work.

Status

  • This project is complete
  • Enable this feature with the --global-docks command-line argument.
    This command-line option is permanent. The pyzo_in_leo plugin requires it.
  • The code creates a global, singleton, Outlines dock (plural).
    Each tab in the Outlines dock contains an Outline dock (singular).
    Each Outline dock looks and works exactly as before.

Global vs local docks

  • Global docks are singletons shared by all of Leo's code.
    All of pyzo's docks must be global, with the possible exception of the File Browser dock.
    Note: right-clicking the Outlines (plural) dock shows only global docks.
    Note: The Outlines dock is the central widget of the new global Window, a QMainWindow.
  • Each commander creates its own local docks.
    This is how Leo has always worked. There are good reasons to keep things as they are.
    Note: right-clicking each Outline (singular) dock shows only local docks.
    Note: As before, the user can choose the central widget for each separate outline.

Code changes

g.app.use_global_docks marks all changes to the code in devel. Remarkably few are needed.

The DynamicWindow class is almost completely unchanged. Crucially, the following official ivars retain their legacy meanings:

  • c.frame.top is a DynamicWindow.
  • c.frame.top.leo_master is a LeoTabbedTopLevel.
  • c.frame.top.parent() is a QStackedWidget.
@edreamleo edreamleo added this to the 6.1 milestone Aug 17, 2019
@edreamleo edreamleo self-assigned this Aug 17, 2019
@edreamleo edreamleo changed the title Singleton docks Global docks Aug 26, 2019
@edreamleo edreamleo changed the title Global docks Global (singleton) docks Aug 26, 2019
@ghost
Copy link

ghost commented Aug 26, 2019

Leo 6.1-devel, gui branch, build 6370998
2019-08-26 08:24:34 -0500
Python 3.6.8, PyQt version 5.12.3
linux

command-line: python3 ./launchLeo.py --global-docks

I know that including screenshots isn't considered good form here but as a writer, I sometimes struggle to be clear using just words. So low-resolution shots are used in this report and only where the alternative is a chapter or two of words.

To prepare for testing of the gui branch with --global-docks I cleared all saved preferences from my OS window manager and deleted the global_data and g_app_db in the ~/.leo/db directory.

First, here is a quick capture of my default workspace.

my_default

I use @string central-dock-widget = body

I spend most of my time in the body pane. The nested dock on the right contains all of the other docks. Very rarely do I need to see more than one of those docks at the same time. For certain types of Leo files I do use a three pane setup but for writing it is simply a waste of space.

Here is the default arrangement of --global-docks maximized on my 1920x1080 screen.

default_global

The splitter below Test 3 is immovable. It will not allow me to move it either up or down.
Test 4 is not visible at all. The bottom part of the mainwindow is also not visible. Dynamic resizing of this window (not maximized and dragging corners/top edge) fails to allow the main window to be sized any shorter (up/down) than 1595 pixels. I was able to force a smaller size using the OS window manager and got to see Test 4 for the first time.

It is clear that the window forcing the tall aspect is the central window.

dynamic

All four test docks can be moved and dropped back into the main window. They can also be floated.

Test docks are totally inert with regard to the active window with useful things in it. ie. they are not drop targets for dock widgets or top level tabs (open Leo files) and nothing happens when you right click on the blank colored spaces.

I am unsure as to what exactly the "global" docks are for. At this point they can all be turned off using the rioght-click pop-up menu on the title bars and I could use my two pane setup if not for the bottom part of the UI being not visible. Opening new Leo files works exactly the same as before.

This last screenshot is one of an artifact that scales with the dock holding the main UI. I positioned the yellow Test dock under it to show it clearly.

artifacts_global

I am still working out why Leo has visible artifacts when using virtual python environments so until I get a handle on that I am using the default python/pyqt from my OS. Once I figure out what the problem is I will test the gui branch against other versions of both.

HTH,

Chris

@edreamleo
Copy link
Member Author

edreamleo commented Aug 27, 2019 via email

@ghost
Copy link

ghost commented Aug 27, 2019

Repeated all testing using both --global-docks and --init-docks after deleting the cache.

All of the same behaviours are present including the artifact.

@edreamleo
Copy link
Member Author

edreamleo commented Aug 27, 2019 via email

@edreamleo
Copy link
Member Author

I am going to close this issue. Imo, we can continue the exploration of "artifacts" in the pyzo branch.

@edreamleo edreamleo removed the pyzo label Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant