Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] HyperSpectra: move image properties to control area #777

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading