Skip to content

Allow ROI context menu to show if non-removable#2932

Merged
j9ac9k merged 1 commit intopyqtgraph:masterfrom
samtygier:roi-menu
Feb 17, 2024
Merged

Allow ROI context menu to show if non-removable#2932
j9ac9k merged 1 commit intopyqtgraph:masterfrom
samtygier:roi-menu

Conversation

@samtygier
Copy link
Copy Markdown
Contributor

Previously getmenu() would always add a "Remove ROI" entry, but would only show the menu if self.removable was True. This meant that if a user adds a menu item to a non-removable ROI it is never show.

Now only add a "Remove ROI" entry for a removale ROI, and show the menu if it is removable, or there has been an item added.

Fixes #2931

Does this need to handle the removable attribute being modified later? Currently the "Remove ROI" entry is added when the menu if first made, and not changed after.

Should the menu show, if not removable and no other items are added? This would change the existing behaviour of an ROI which is to suppress the menu of the parent.

Does this need to be done for other objects?

Other Tasks

Bump Dependency Versions

Files that need updates

Confirm the following files have been either updated or there has been a determination that no update is needed.

  • README.md
  • setup.py
  • tox.ini
  • .github/workflows/main.yml and associated requirements.txt and conda environemt.yml files
  • pyproject.toml
  • binder/requirements.txt
Pre-Release Checklist

Pre Release Checklist

  • Update version info in __init__.py
  • Update CHANGELOG primarily using contents from automated changelog generation in GitHub release page
  • Have git tag in the format of pyqtgraph-
Post-Release Checklist

Steps To Complete

  • Append .dev0 to __version__ in __init__.py
  • Announce on mail list
  • Announce on Twitter

Previously the context menu would one show if self.removable was true,
even if the user had added a menu item. Now show the menu if either the
ROI is removeable, or there has been an item added.
@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Feb 17, 2024

Thanks for the PR @samtygier this LGTM 👍🏻

@j9ac9k j9ac9k merged commit 43890d7 into pyqtgraph:master Feb 17, 2024
@samtygier samtygier deleted the roi-menu branch February 18, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't add menu item to non-removable ROI

2 participants