Skip to content

Commit

Permalink
Merge pull request #777 from markotoplak/hyper-controls
Browse files Browse the repository at this point in the history
[ENH] HyperSpectra: move image properties to control area
  • Loading branch information
markotoplak authored Nov 26, 2024
2 parents 9008270 + 9446cd2 commit 05c00ee
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 @@ -324,7 +324,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 @@ -347,19 +348,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 @@ -1177,8 +1180,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 @@ -1229,6 +1236,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)

# do not save visible image (a complex structure as a setting;
# only save its name)
self.visible_image = None
Expand Down

0 comments on commit 05c00ee

Please sign in to comment.