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

Change ROI Colour #2015

Merged
merged 11 commits into from
Feb 9, 2024
Merged

Change ROI Colour #2015

merged 11 commits into from
Feb 9, 2024

Conversation

ashmeigh
Copy link
Collaborator

@ashmeigh ashmeigh commented Jan 22, 2024

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.

@samtygier-stfc samtygier-stfc changed the title updated default values in Remove all stripes Change ROI Colour Jan 30, 2024
@ashmeigh
Copy link
Collaborator Author

ashmeigh commented Feb 5, 2024

roi_screen

Comment on lines 48 to 55
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)
Copy link
Collaborator

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.

@coveralls
Copy link

coveralls commented Feb 9, 2024

Coverage Status

coverage: 75.287% (-0.2%) from 75.445%
when pulling a9a0095 on 1992-ROI-Colour-Change
into 9611a8d on main.

Copy link
Collaborator

@samtygier-stfc samtygier-stfc left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks.

@samtygier-stfc samtygier-stfc added this pull request to the merge queue Feb 9, 2024
Merged via the queue into main with commit 7a0ca6e Feb 9, 2024
8 checks passed
@samtygier-stfc samtygier-stfc deleted the 1992-ROI-Colour-Change branch February 9, 2024 18:06
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.

Spectrum Viewer: Change ROI Colour Through Right Click Dialog Menu
3 participants