Skip to content

Commit

Permalink
Fix menu position (#2120)
Browse files Browse the repository at this point in the history
  • Loading branch information
samtygier-stfc authored May 16, 2024
2 parents 2a6191e + addf052 commit aa6025b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions docs/release_notes/next/fix-2119-pyqt-menu
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#2129 : fix menu position for new pyqtgraph
7 changes: 3 additions & 4 deletions mantidimaging/gui/widgets/auto_colour_menu/auto_color_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import numpy as np
from PyQt5.QtWidgets import QWidget

DEFAULT_MENU_POSITION = 12


class AutoColorMenu:
"""
Expand All @@ -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)
Expand Down

0 comments on commit aa6025b

Please sign in to comment.