From f733f19d16953f1a3af878a4041ddac6edd9b678 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Fri, 8 Mar 2024 14:20:00 +0000 Subject: [PATCH 1/3] Set position of Auto relative to RGB to accommodate changes in pyqtgraph --- .../gui/widgets/auto_colour_menu/auto_color_menu.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mantidimaging/gui/widgets/auto_colour_menu/auto_color_menu.py b/mantidimaging/gui/widgets/auto_colour_menu/auto_color_menu.py index 29881e863eb..4e38646e2db 100644 --- a/mantidimaging/gui/widgets/auto_colour_menu/auto_color_menu.py +++ b/mantidimaging/gui/widgets/auto_colour_menu/auto_color_menu.py @@ -12,8 +12,6 @@ import numpy as np from PyQt5.QtWidgets import QWidget -DEFAULT_MENU_POSITION = 12 - class AutoColorMenu: """ @@ -38,12 +36,13 @@ def other_histograms(self) -> list[HistogramLUTItem]: def add_auto_color_menu_action(self, parent: QWidget | None, recon_mode: bool = False, - index: int = DEFAULT_MENU_POSITION, set_enabled: bool = True) -> QAction: self.auto_color_parent = parent self.auto_color_recon_mode = recon_mode self.auto_color_action = QAction("Auto") - place = self.histogram.gradient.menu.actions()[index] + + index_of_rgb_item = [action.text() for action in self.histogram.gradient.menu.actions()].index("RGB") + place = self.histogram.gradient.menu.actions()[index_of_rgb_item - 1] self.histogram.gradient.menu.insertAction(place, self.auto_color_action) self.histogram.gradient.menu.insertSeparator(self.auto_color_action) From 84b97d74c62c1e3c3ffbcb07a810e097585deac2 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Fri, 8 Mar 2024 14:21:20 +0000 Subject: [PATCH 2/3] Update pyqtgraph to 0.13.7 --- conda/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda/meta.yaml b/conda/meta.yaml index 3aea734a6fa..83ef90dbb51 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -36,7 +36,7 @@ requirements: - ccpi-regulariser - jenkspy=0.2.0 - pyqt=5.15.* - - pyqtgraph=0.13.3 + - pyqtgraph=0.13.7 - qt-material=2.14 - darkdetect=0.8.0 - qt-gtk-platformtheme # [linux] From addf052e76925253e6962584f48967b2590c2e30 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Tue, 14 May 2024 14:30:18 +0100 Subject: [PATCH 3/3] Update release notes --- docs/release_notes/next/fix-2119-pyqt-menu | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/release_notes/next/fix-2119-pyqt-menu diff --git a/docs/release_notes/next/fix-2119-pyqt-menu b/docs/release_notes/next/fix-2119-pyqt-menu new file mode 100644 index 00000000000..bfe51c3c1b2 --- /dev/null +++ b/docs/release_notes/next/fix-2119-pyqt-menu @@ -0,0 +1 @@ +#2129 : fix menu position for new pyqtgraph