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

PR: Remove dockwidget title bars by default and improve dock/undock behavior #8192

Merged
merged 71 commits into from
Dec 24, 2018

Conversation

ccordoba12
Copy link
Member

@ccordoba12 ccordoba12 commented Nov 2, 2018

The purpose of this PR is to implement the following:

  • Hide DockWidgets title bar when locked and lock toolbars too.
  • Remove the undock button and make the undock action to create a new window
  • Show Editor's current file path on its title bar under all circumstances
  • Fix placement of File Explorer and Plots plugin
  • Add a close action to the Options menu of every plugin.
  • Change Options menu icon to be hamburger icon.
  • Restore "New window" action for the Editor
  • Change tour color widget to follow QDarkStyle Python 3 theme. Since we can't get the colors used by qdarkstyle programmatically, we have to hardcode them and we prefer the Python 3 theme instead of Python 2 one.
  • Make env and sys.path dialogs of the IPython console to follow the current theme.
  • Change "Browse tabs" icon
  • Fix icon color of "Restart kernel" action.
  • Close undocked windows when closing Spyder main window

Resources:


Screenshots

  • Custom dockwidget title bar / New Options menu icon (the same one used in web browsers)
    seleccion_002

  • New Options menu actions (the last there in this screenshot): All plugins have now an Undock and a Close action.
    seleccion_013

  • Lock panes action locks toolbars now too
    seleccion_017


Fixes #8171.
Fixes #8011.
Fixes #5515.
Fixes #2855.
Fixes #2854.

This allows us to have very nice features for DockWidgets introduced in
that version
@ccordoba12 ccordoba12 added this to the v4.0beta2 milestone Nov 2, 2018
@pep8speaks
Copy link

pep8speaks commented Nov 2, 2018

Hello @ccordoba12! Thanks for updating the PR.

Line 72:80: E501 line too long (84 > 79 characters)
Line 267:80: E501 line too long (81 > 79 characters)
Line 268:80: E501 line too long (87 > 79 characters)
Line 269:80: E501 line too long (82 > 79 characters)

Comment last updated on December 24, 2018 at 04:05 Hours UTC

@ccordoba12
Copy link
Member Author

@jnsebgosselin, I'm taking over these tasks from you, hope that's fine :-)

With the new dark theme, I really think we need this.

@jnsebgosselin
Copy link
Member

@jnsebgosselin, I'm taking over these tasks from you, hope that's fine :-)

With the new dark theme, I really think we need this.

Sure go ahead!

I have another suggestion that could be considered for this PR. Maybe when we check the View ->Lock panes option, we could also lock the toolbars in addition to the panels.

Here is an example of what I mean in LibreOffice:

image

@ccordoba12 ccordoba12 changed the title [WIP] PR: Improve dockwidget appearance [WIP] PR: Remove dockwidget title bars and improve dock/undock behavior Nov 3, 2018
@ccordoba12 ccordoba12 changed the title [WIP] PR: Remove dockwidget title bars and improve dock/undock behavior [WIP] PR: Remove dockwidget title bars by default and improve dock/undock behavior Nov 3, 2018
@CAM-Gerlach
Copy link
Member

@ccordoba12 FYI, in my testing when panels are undocked as this PR implements, they do not close when Spyder does and hang around indefinitely (this is also true of e.g. the prefs window outside of this PR). There appears to be two methods (as I discuss in #8474 ) to address this. I assume that's in scope here.

…rent theme

Also close them when a client is closed.
@ccordoba12
Copy link
Member Author

I think this is finally ready!! My comments:

The new close button in the project explorer dropdown menu doesn't work

I couldn't reproduce this one, sorry.

After undocking a pane while panes are unlocked, locking panes makes the undocked pane revert to a "docked" appearance

I removed the undock button and leave only the undock action to avoid confusion. I also made undocked windows to be closed when Spyder is closed.

When the tile bars are hidden, the tabs of the Console pane are missing their top lines when active

I reverted to have tabs on top to avoid this.

I'd prefer to be able to drag and drop both types of undocked panes when "Lock panes" is unchecked, as it could otherwise be very confusing to the user (as it was to me).

This no longer applies because I removed the undock button. Besides, I added a custom title bar to all plugins that is shown when "Lock panes" is unchecked and that only let's you drag and drop panes to a different location.

Pierre decided to clone to current tabs disposition to the new window, but that's really not intuitive. This is an easy change.

I decided to leave the current behavior because this PR was getting too big (it could be implemented in another PR, but I think it's low priority).


@CAM-Gerlach, do you have something to add?

@CAM-Gerlach
Copy link
Member

@ccordoba12 Sounds good, thanks for all your hard work and for addressing my comments! I'll take one last look at it and let you know momentarily if I find anything egregious. This indeed has gotten pretty big so I don't want to get off topic and make it any bigger, just if I see a significant issue with the current functionality here.

@ccordoba12
Copy link
Member Author

Ok, thanks! If you have more suggestions on how to improve this functionality, please open a new issue about it. But for now, please focus on reviewing the things implemented here.

@CAM-Gerlach
Copy link
Member

CAM-Gerlach commented Dec 22, 2018

@ccordoba12 I like the new UX and everything works and looks pretty good; and it seems the project explorer close button not working issue was fixed somewhere down the line. However, I did see some significant issue:

On opening Spyder with panes locked (The default), the toolbar of the project explorer:

image

and the file explorer:

image

look all messed up, with the close button embedded in them. Resizing the window doesn't fix it; the only thing that does is toggling "unlock panes" then "lock panes" again and it thereafter looks normal. I assume some part of your changes is/isn't getting fired on startup but isn't/is triggering on toggling that option.

Correct look:

image

image

This is under Qt 5.9.6. PyQt 5.9.2, Windows 8.1 and Python 3.6.7

@ccordoba12
Copy link
Member Author

On opening Spyder with panes locked (The default), the toolbar of the project explorer and the file explorer look all messed up

Thanks for noticing it. This was due to a bug in the initialization of our custom title bar for dock widgets and it should be fixed with my latest commits.

@ccordoba12
Copy link
Member Author

Please check if that's the case to merge this one.

Copy link
Member

@CAM-Gerlach CAM-Gerlach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now, your changes fixed the initialization issue. Thanks!

@ccordoba12
Copy link
Member Author

I finally added a couple of tests to verify that the basic functionality is working as expected.

Thanks @CAM-Gerlach for your help with this one!

@ccordoba12 ccordoba12 merged commit cb0f51b into spyder-ide:master Dec 24, 2018
@ccordoba12 ccordoba12 deleted the improve-docks branch December 24, 2018 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment