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: Improve UI/UX of how repositioning panes work #17813

Merged
merged 17 commits into from
Jun 29, 2022

Conversation

ccordoba12
Copy link
Member

@ccordoba12 ccordoba12 commented May 3, 2022

Description of Changes

  • Add new action to the Options menu of all dockable plugins called Unlock position, so that users can more easily find how to reorganize plugins in the interface.

    image

  • Improve UI of title bar that is shown when Unlock position is clicked:

    • Make it taller.
    • Change icon for drag and drop area to better convey the idea that panes can be moved up/down or left/right to be repositioned.
    • Use close hand cursor when dragging pane around.
    • Add lock icon to the right to easily hide the title bar. Also use regular cursor when hovering on it.
    • Use hover and clicked palette states when interacting with it.
    • Add tooltip to the drag/drop and close areas.

    drag

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct:

ccordoba12 added 12 commits May 3, 2022 12:08
- Use "open hand" as the cursor shape when hovering over the title bar.
Before it was "size all", which is a bit strange.
- Make the invisible close button in the title bar behave exactly the
same as the rest of it. Before it was showing the arrow cursor on
hover and it was not possible to drag the widget from it.
- Change the cursor shape to "closed hand" when dragging the widget to
indicate that the operation is still in place (i.e. that it won't end
until the mouse is released).
- Prevent dock widgets to be left floating.
- Remove mouseMoveEvent, which was doing nothing.
- Increase buttons size, which increases vertical size too.
- Change background color on hover and pressed states.
This removes some flickering at startup
- Use lock/unlock icon
- Make it behave as a regular button (i.e. change hover and pressed
states according to the theme).
- Don't make it share color state with the drag region so users
understand that is different from it.
- Add tooltip.
Also adjust width of close button to be the same one of other buttons in
that toolbar.
@ccordoba12 ccordoba12 added this to the v5.3.1 milestone May 3, 2022
@ccordoba12 ccordoba12 self-assigned this May 3, 2022
@pep8speaks
Copy link

pep8speaks commented May 3, 2022

Hello @ccordoba12! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 113:80: E501 line too long (94 > 79 characters)

Comment last updated at 2022-06-29 18:09:18 UTC

Copy link
Member

@dalthviz dalthviz left a comment

Choose a reason for hiding this comment

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

Thanks @ccordoba12 ! Checking locally on Windows and the CI tests I noticed a couple of things:

  • The new Unlock position is disabled for Plots:

plots

  • Seems like the Options menu now positions different if there is no space to show all the actions. For example with the IPython Console options menu it overlaps the console instead of being shown at the top of the pane:

menu

  • Some tests are failing due to the new action (spyder/plugins/history/tests/test_plugin.py::test_init) or due to missing setup code in the test at the end of the files like for the EditorPluginExample:
    def test():
    from spyder.utils.qthelpers import qapplication
    from spyder.config.base import get_module_path
    spyder_dir = get_module_path('spyder')
    app = qapplication(test_time=8)
    test = EditorPluginExample()
    test.resize(900, 700)
    test.show()
    import time
    t0 = time.time()
    test.load(osp.join(spyder_dir, "widgets", "collectionseditor.py"))
    test.load(osp.join(spyder_dir, "plugins", "editor", "widgets",
    "editor.py"))
    test.load(osp.join(spyder_dir, "plugins", "explorer", "widgets",
    'explorer.py'))
    test.load(osp.join(spyder_dir, "plugins", "editor", "widgets",
    "codeeditor.py"))
    print("Elapsed time: %.3f s" % (time.time()-t0)) # spyder: test-skip
    sys.exit(app.exec_())
    if __name__ == "__main__":
    test()

@ccordoba12 ccordoba12 modified the milestones: v5.3.1, v5.3.2 May 4, 2022
Copy link
Collaborator

@isabela-pf isabela-pf left a comment

Choose a reason for hiding this comment

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

Hey there! I've seen this work a few times, and it looks like what I expected. Thank you so much for listing everything changed as a list.

I think this is good to merge from my end, I'd just like to suggest a minor change to the tool tips for specificity.

spyder/api/widgets/main_widget.py Outdated Show resolved Hide resolved
spyder/api/widgets/main_widget.py Outdated Show resolved Hide resolved
spyder/plugins/base.py Outdated Show resolved Hide resolved
spyder/plugins/base.py Outdated Show resolved Hide resolved
@ccordoba12
Copy link
Member Author

ccordoba12 commented Jun 29, 2022

@dalthviz, about your comments above:

The new Unlock position is disabled for Plots

Fixed in one of my latest commits

Seems like the Options menu now positions different if there is no space to show all the actions

That's most probably due to the addition of the new Lock/Unlock action because I didn't change that specifically (you can check the code about it). Other than this (which we could try to address in another PR), this should be ready.

@ccordoba12 ccordoba12 removed the request for review from CAM-Gerlach June 29, 2022 17:55
@ccordoba12 ccordoba12 requested a review from dalthviz June 29, 2022 17:55
@ccordoba12 ccordoba12 changed the title PR: Improve UI/UX of repositioning panes in the main window PR: Improve UI/UX of how repositioning panes work Jun 29, 2022
Copy link
Member

@dalthviz dalthviz left a comment

Choose a reason for hiding this comment

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

Thanks @ccordoba12 ! Checking locally on WIndows seems like the issues with the undock action for plots and even the options menu position error are gone so this LGTM 👍

@dalthviz dalthviz merged commit 3c84dc3 into spyder-ide:5.x Jun 29, 2022
dalthviz added a commit that referenced this pull request Jun 29, 2022
@ccordoba12 ccordoba12 deleted the improve-drag-panes branch June 29, 2022 20:50
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.

4 participants