From fa2e160a366d877e43c42f6caccba462b9bc9755 Mon Sep 17 00:00:00 2001 From: Marko Toplak Date: Fri, 22 Nov 2024 14:35:44 +0100 Subject: [PATCH] HyperSpectra: move image properties to control area --- orangecontrib/spectroscopy/widgets/owhyper.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/orangecontrib/spectroscopy/widgets/owhyper.py b/orangecontrib/spectroscopy/widgets/owhyper.py index baf126b95..4580765ad 100644 --- a/orangecontrib/spectroscopy/widgets/owhyper.py +++ b/orangecontrib/spectroscopy/widgets/owhyper.py @@ -361,7 +361,8 @@ def setup_color_settings_box(self): box = gui.vBox(self) box.setContentsMargins(0, 0, 0, 5) self.color_cb = gui.comboBox(box, self, "palette_index", label="Color:", - labelWidth=50, orientation=Qt.Horizontal) + labelWidth=50, orientation=Qt.Horizontal, + contentsLength=10) self.color_cb.setIconSize(QSize(64, 16)) palettes = _color_palettes model = color_palette_model(palettes, self.color_cb.iconSize()) @@ -384,19 +385,21 @@ def limit_changed(): self._level_low_le = lineEditDecimalOrNone(self, self, "level_low", callback=limit_changed) self._level_low_le.validator().setDefault(0) + self._level_low_le.sizeHintFactor = 0.5 form.addRow("Low limit:", self._level_low_le) self._level_high_le = lineEditDecimalOrNone(self, self, "level_high", callback=limit_changed) self._level_high_le.validator().setDefault(1) + self._level_high_le.sizeHintFactor = 0.5 form.addRow("High limit:", self._level_high_le) self._threshold_low_slider = lowslider = gui.hSlider( box, self, "threshold_low", minValue=0.0, maxValue=1.0, - step=0.05, ticks=True, intOnly=False, + step=0.05, intOnly=False, createLabel=False, callback=self.update_levels) self._threshold_high_slider = highslider = gui.hSlider( box, self, "threshold_high", minValue=0.0, maxValue=1.0, - step=0.05, ticks=True, intOnly=False, + step=0.05, intOnly=False, createLabel=False, callback=self.update_levels) form.addRow("Low:", lowslider) @@ -1430,8 +1433,12 @@ def __init__(self): super().__init__() SelectionOutputsMixin.__init__(self) + iabox = gui.widgetBox(self.controlArea, "Image axes") + dbox = gui.widgetBox(self.controlArea, "Image values") + icbox = gui.widgetBox(self.controlArea, "Image colors") + rbox = gui.radioButtons( dbox, self, "value_type", callback=self._change_integration) @@ -1481,6 +1488,10 @@ def __init__(self): self.imageplot = ImagePlot(self) self.imageplot.selection_changed.connect(self.output_image_selection) + # add image settings to the main panne after ImagePlot.__init__ + iabox.layout().addWidget(self.imageplot.axes_settings_box) + icbox.layout().addWidget(self.imageplot.color_settings_box) + self.data = None self.setup_vector_plot_controls()