2511-viewer-enh #5

Merged
leonarski_f merged 10 commits from 2511-viewer-enh into main 2025-11-14 12:32:28 +01:00
3 changed files with 7 additions and 21 deletions
Showing only changes of commit ea51efe2fe - Show all commits

View File

@@ -26,10 +26,11 @@ JFJochViewerWindow::JFJochViewerWindow(QWidget *parent, bool dbus, const QString
setMenuBar(menuBar);
auto toolBarImage = new JFJochViewerToolbarImage(this);
addToolBar(toolBarImage);
addToolBar(Qt::TopToolBarArea, toolBarImage);
addToolBarBreak(Qt::TopToolBarArea);
auto toolBarDisplay = new JFJochViewerToolbarDisplay(this);
addToolBar(toolBarDisplay);
addToolBar(Qt::TopToolBarArea, toolBarDisplay);
auto statusbar = new JFJochViewerStatusBar(this);
setStatusBar(statusbar);
@@ -143,9 +144,6 @@ JFJochViewerWindow::JFJochViewerWindow(QWidget *parent, bool dbus, const QString
connect(toolBarDisplay, &JFJochViewerToolbarDisplay::setForeground, viewer,
&JFJochDiffractionImage::changeForeground);
connect(toolBarDisplay, &JFJochViewerToolbarDisplay::setBackground, viewer,
&JFJochDiffractionImage::changeBackground);
connect(toolBarDisplay, &JFJochViewerToolbarDisplay::setAutoForeground, viewer,
&JFJochDiffractionImage::setAutoForeground);

View File

@@ -31,19 +31,14 @@ JFJochViewerToolbarDisplay::JFJochViewerToolbarDisplay(QWidget *parent)
addWidget(new QLabel("&nbsp;&nbsp;<b>Background </b>&nbsp;&nbsp;"));
background_slider = new SliderPlusBox(-30000, 30000, 1.0, 1, this,
SliderPlusBox::ScaleType::Linear);
background_slider->setValue(0);
addWidget(background_slider);
auto *stretch = new QWidget(this);
stretch->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
addWidget(stretch);
connect(foreground_slider, &SliderPlusBox::valueChanged, this, &JFJochViewerToolbarDisplay::foregroundSet);
connect(background_slider, &SliderPlusBox::valueChanged, this, &JFJochViewerToolbarDisplay::backgroundSet);
connect(color_map_select, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &JFJochViewerToolbarDisplay::colorComboBoxSet);
connect(auto_foreground_button, &QPushButton::clicked, this, &JFJochViewerToolbarDisplay::autoForegroundButtonPressed);
auto *stretch = new QWidget(this);
stretch->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
addWidget(stretch);
}
void JFJochViewerToolbarDisplay::foregroundSet(double val) {
@@ -55,10 +50,6 @@ void JFJochViewerToolbarDisplay::foregroundSet(double val) {
emit setForeground(static_cast<float>(val));
}
void JFJochViewerToolbarDisplay::backgroundSet(double val) {
emit setBackground(static_cast<float>(val));
}
void JFJochViewerToolbarDisplay::updateForeground(float val) {
QSignalBlocker blocker(foreground_slider);
foreground_slider->setValue(val);

View File

@@ -14,7 +14,6 @@ class JFJochViewerToolbarDisplay : public QToolBar {
bool auto_foreground = false;
SliderPlusBox *background_slider;
SliderPlusBox *foreground_slider;
QPushButton *auto_foreground_button;
@@ -24,7 +23,6 @@ public:
signals:
void setForeground(float val);
void setBackground(float val);
void colorMapChanged(int val);
void setAutoForeground(bool val);
@@ -33,7 +31,6 @@ public slots:
private slots:
void foregroundSet(double val);
void backgroundSet(double val);
void colorComboBoxSet(int val);
void autoForegroundButtonPressed();
};