Skip to content

Commit

Permalink
HyperSpectra: move image properties to control area
Browse files Browse the repository at this point in the history
  • Loading branch information
markotoplak committed Nov 22, 2024
1 parent 4e9ec12 commit fa2e160
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions orangecontrib/spectroscopy/widgets/owhyper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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)
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit fa2e160

Please sign in to comment.