Merge pull request #19 from nqrduck/15-menubar-ui-problems

Updated menubar entry for spectrometer selection.
This commit is contained in:
Julia P 2024-04-14 20:14:19 +02:00 committed by GitHub
commit fbac6c8a69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -112,6 +112,14 @@ class SpectrometerView(ModuleView):
self._module.model._available_spectrometers,
)
# Create an header action called 'Spectrometer"
self._actions["Spectrometer"] = QAction("Spectrometer:", menu_item)
font = self._actions["Spectrometer"].font()
font.setBold(True)
self._actions["Spectrometer"].setFont(font)
self._actions["Spectrometer"].setEnabled(False)
menu_item.addSeparator()
for (
spectrometer_name,
spectrometer_module,
@ -130,7 +138,7 @@ class SpectrometerView(ModuleView):
last_added_action = self._actions[list(self._actions.keys())[-1]]
last_added_action.setChecked(True)
self.add_menubar_item.emit("Hardware", list(self._actions.values()))
self.add_menubar_item.emit("Hardware", list(self._actions.values()), True)
@pyqtSlot(str)
def on_menu_button_clicked(self, spectrometer_name):