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

Add lock/unlock option for panes #2345

Merged
merged 7 commits into from
Apr 28, 2015
Merged

Add lock/unlock option for panes #2345

merged 7 commits into from
Apr 28, 2015

Conversation

goanpeca
Copy link
Member

Fixes #2096


Description

This PR fixes three things:

  • Adds ability to lock panes. The locked state is True by default (i.e. first start of spyder after reset), and is remembered every time is changed.
  • Rephrase Dockwidget mention in preferences to panes (the official name used for dockwidgets in Spyder lingo)
  • Reorganize the View menu structure.

Menu entry

Before

image

Now

image

Preferences dialog

New wording (Replaced dockwidgets by panes)

image

Todo:

  • Agree on a shortcut
  • Agree on location of menu
  • Reorganize entries in View menu.

@goanpeca
Copy link
Member Author

@dougthor42 can you give it a try?

@goanpeca
Copy link
Member Author

Hmmm I think we should change places where it says 'dockwidget' to pane... otherwise the preferences looks funny....

Vertical dockwidget title bars -> dockwidget is a Qt term.. irrelevant to the user

So maybe it should say

Vertical title bars on panes

@Nodd
Copy link
Contributor

Nodd commented Apr 21, 2015

I agree on the location in the menu, but I wouldn't add this option in the preferences at all. The lock state should be remembered, that's all.(and disabled by defalut, new users should be able toe asily change the layout).
I don't have a strong opinion on the shortcut, this one is coherent with CLose current pane.

Going back to the menu, what do you think about grouping options dirferentely (it could be another PR). The point is to better group what goes together:

  • Toolbars

  • Panes
  • Lock panes
  • Close current pane
  • Maximize cuirrent pane

  • Custom window layouts
  • Toggle previous layout (is "toggle" the right word here ? How about "Use", or no verb at all ?)
  • Toggle next layout

  • Full screen mode

I don't know where the attached console window comes from so I don't know where to put it.

@goanpeca
Copy link
Member Author

👍 makes sense.


Yes i agree on the menu change, what do you think of changing the word dockwidgt by pane? It would be more coherent

@goanpeca
Copy link
Member Author

If the others agree with @Nodd I can make the corrections he suggests to arrange the menu, as it indeed would be better...

I think I would like

Toolbars ->
-------------------------
Panes ->
Lock panes
Close current pane
Maximize current pane
-------------------------
Custom window layouts ->
Use previous layout 
Use next layout
-------------------------
Full screen mode
-------------------------
Attached console window

@Nodd
Copy link
Contributor

Nodd commented Apr 21, 2015

👍 for pane instead of dockwidget.
Also I'd prefer Previous layout and Next layout.

@goanpeca
Copy link
Member Author

👍 sure ;-)

@dougthor42
Copy link
Contributor

Works wonderfully. Thanks a bunch

@ccordoba12
Copy link
Member

Just a minor comment: I think the lock option should be on by default, not off :-)

Will come back later.

@goanpeca
Copy link
Member Author

@ccordoba12 by on you mean having panes locked by default (no possibility of rearranging them?), I thought you preferred off.

I prefer on by default as well... but I had the impression the rest of @spyder-ide/collaborators (including you) preferred off

@Nodd
Copy link
Contributor

Nodd commented Apr 21, 2015

Personally, one of the first things I do when launching spyder on a new computer is to rearrange the panes. Maybe I'm too much of a "power user".
On the other hand if a new user accidentally closes a pane he may be in trouble. But he may never discover that the panes can be moved around. I don't know what is the most important...

@goanpeca
Copy link
Member Author

I personally find super annoying that sometimes the panes get crazy because I missed a mouse click... but when in keyboard only mode (most of the time)... that is hardly a problem. Now off goes against discover-ability maybe, but I also think first impressions are lasting ones, so if a panes goes crazy for a new user the user might think the software is buggy...

@dougthor42
Copy link
Contributor

I think that the default, unconfigured value should be Locked Panes = Off.

For new users:
It's likely that the first thing that someone will look for after accidentally moving a pane will be the "Lock Panes" feature. By having it default to off, they can see that that they can move panes around. Perhaps it's just because I'm used to pane-based programs, but I immediately recognized when I accidentally moved a pane. I like to believe that most users, even brand new ones, would be think the same thing...

For users coming from PyCharm, Visual Studio, Eclipse, etc:
The first thing that these users will do is try to move things around to how they like them. After things are set, then I'd imagine that they go look for the lock/unlock option.
If they can't move things right off the bat, they might not think to look for a lock/unlock option.

Or it could just be added to the tutorial.

@goanpeca goanpeca changed the title Fixes #2096: Add lock/unlock option for panes Add lock/unlock option for panes Apr 22, 2015
@ccordoba12
Copy link
Member

@goanpeca, I changed my mind after altering my layout several times because of misplaced mouse clicks ;-)

@dougthor42, it's true that power users always want to rearrange things to their liking. But I think Spyder is picked up by a lot of newbies, so I'd prefer to adjust things for them.

But power user can always lookup for the option to unlock panels and adjust things again ;-)

@goanpeca
Copy link
Member Author

So... change to locked by default? I say 👍 to that.


@ccordoba12 any comments on reorganizing the menu?

@ccordoba12
Copy link
Member

  • Yep, 👍 from me too to lock panes by default ;-)
  • Also 👍 for the shortcut
  • About the menu, my proposal is
Panes ->
Lock panes
Close current pane
Maximize current pane
-------------------------
Toolbars ->
-------------------------
Custom window layouts ->
Use previous layout 
Use next layout
-------------------------
Full screen mode
-------------------------
Attached console window

I think Panes are much more important than Toolbars and deserve to be first in that menu :-)

@goanpeca
Copy link
Member Author

👍

Should I add this change to this PR, or should I open a new one.

Any thought on changing the entries in the preferences dialog where it says: dockwidgets... -> it should read panes... (dockwidget is not a very clear concept for someone not use to Qt)

@Nodd
Copy link
Contributor

Nodd commented Apr 22, 2015

I originally put the panes near the layouts because the layout change the panes. But I agree that they are more important so at the top is also fine.

Custom window layouts should be Window layouts because there are predefined ones.

I vote that reordering the menu and changing a few labels can be done in this PR, as long as they are separate commits.

@ccordoba12
Copy link
Member

Yes, please do those changes in this PR too.

@goanpeca
Copy link
Member Author

@ccordoba12 done!

'_/preferences': "Ctrl+Alt+Shift+P",
'_/maximize pane': "Ctrl+Alt+Shift+M",
'_/fullscreen mode': "F11",
'_/toggle next layout': "Shift+Alt+PgDown",
'_/toggle previous layout': "Shift+Alt+PgUp",
Copy link
Member

Choose a reason for hiding this comment

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

Since you're removing these options, you need to bump CONF_VERSION below

Copy link
Member Author

Choose a reason for hiding this comment

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

I was actually renaming them,

Copy link
Member

Choose a reason for hiding this comment

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

I know, but that's exactly the same as removing some options and adding new ones. And the removing part needs a bump in CONF_VERSION :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, will make the bump then

Copy link
Member Author

Choose a reason for hiding this comment

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

Right now I have 16.1.0 I should change it to 17.0.0 ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes

@goanpeca
Copy link
Member Author

Should we hide the dockwidget titlebar when locked?

This was discussed and suggested in #2353 to improve usable space in Spyder.

@Nodd
Copy link
Contributor

Nodd commented Apr 26, 2015

I vote yes (I would use such a feature) but as an option and disabled by default, because locked is the default, which means that a new user would no see the titlebars at all.

@goanpeca
Copy link
Member Author

Sure, I would use it too, is it that problematic to make it on by default?

@Nodd
Copy link
Contributor

Nodd commented Apr 26, 2015

Imagine a new user, first time launching spyder an looking at the interface: there would be no indication of what all the dockwidgets are (unless there are multiple widgets in the same area, there would be tabs). I see this a a feature for advanced users who already know what each pane is for.

@ccordoba12
Copy link
Member

I just like to say: new features = new PRs :-)

Please keep things simple in every PR to make my life easier :-) Since the purpose of this PR is to add a lock/unlock menu entry, you should leave things up to that point.

@goanpeca
Copy link
Member Author

Well in that case please merge :-)

@@ -485,7 +485,7 @@ def __init__(self, options=None):
self.is_starting_up = True
self.is_setting_up = True

self.dockwidgets_locked = False
self.dockwidgets_locked = CONF.get('main', 'panes_locked', True)
Copy link
Member

Choose a reason for hiding this comment

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

Please don't add default values to CONF.get (i.e. remove the True at the end). This messes up with updates in CONF_VERSION

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the argument should be removed from the fuction then, to avoid future similar problems ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops.. that is a remnant from the first code ... 👍 fixed

@ccordoba12
Copy link
Member

I tested this locally, and it's working as expected.

Thanks for this, great work as usual!

ccordoba12 added a commit that referenced this pull request Apr 28, 2015
Add lock/unlock option for panes
@ccordoba12 ccordoba12 merged commit b3fea4e into spyder-ide:master Apr 28, 2015
@goanpeca
Copy link
Member Author

👍

@goanpeca goanpeca deleted the lock-panes branch April 28, 2015 15:58
d1manson pushed a commit to d1manson/spyder that referenced this pull request Apr 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Add option to lock window/pane layout
4 participants