-
Notifications
You must be signed in to change notification settings - Fork 7
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
Change ROI Colour #2015
Change ROI Colour #2015
Conversation
color_dialog = QtWidgets.QColorDialog() | ||
current_color = QtGui.QColor(*self._colour) | ||
selected_color = color_dialog.getColor(current_color) | ||
|
||
if selected_color.isValid(): | ||
new_color = (selected_color.red(), selected_color.green(), selected_color.blue(), 255) | ||
self.colour = new_color # Update the ROI color | ||
self.sig_colour_change.emit(self._name, new_color) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets split this into is own method. So that asking for the colour is separated from triggering it.
Also, move the menu into the existing menu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks.
Issue
Closes #1992
Description
This pull request addresses the issue reported in #1992. This pull request introduces an enhancement to the Spectrum Viewer, targeting the functionality around ROIs. Previously, users could not easily change the colour of an ROI within the viewer. With this update, I have implemented a right-click context menu for ROIs, providing users with an interface to select new colours. This enhancement improves user interaction with the Spectrum Viewer
Testing
Describe the tests that were used to verify your changes.
Acceptance Criteria
Right-clicked on various ROIs within the Spectrum Viewer to ensure the context menu appears consistently.
Selected different colours from the colour dialog and verified that the selected ROI updated to the new colour immediately.
Tested with multiple ROIs to ensure that changing the colour of one ROI does not affect others.
Documentation
Noted the changes in the appropriate file in docs/release_notes.