From 961836837fc217647c2d32cbb734ed430b57ecc8 Mon Sep 17 00:00:00 2001 From: leonarski_f Date: Mon, 22 Jun 2026 16:56:18 +0200 Subject: [PATCH] viewer: salmon group boxes; dataset-info x-axis spans the whole dataset - Fusion fills QGroupBox interiors with a flat light colour, so the settings window lost its salmon look. A tiny app stylesheet (QGroupBox { background: transparent }) makes them show the salmon window background again; entry widgets stay white via the palette. - The dataset-info chart now fixes the x-axis to the whole dataset [0, n) (the largest run = the original file), so a subset run is drawn at its real image positions instead of being stretched to fill the plot. Subsets with binning bin by ordinal and place each point at its mapped image number (correct for the common contiguous sub-range). Co-Authored-By: Claude Opus 4.8 --- viewer/JFJochViewerDatasetInfo.cpp | 9 ++++++++- viewer/charts/JFJochDatasetInfoChartView.cpp | 6 +++++- viewer/charts/JFJochDatasetInfoChartView.h | 4 +++- viewer/jfjoch_viewer.cpp | 3 +++ 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/viewer/JFJochViewerDatasetInfo.cpp b/viewer/JFJochViewerDatasetInfo.cpp index 985c3f6f..aa0a535c 100644 --- a/viewer/JFJochViewerDatasetInfo.cpp +++ b/viewer/JFJochViewerDatasetInfo.cpp @@ -251,8 +251,15 @@ void JFJochViewerDatasetInfo::UpdatePlot() { RunColor(static_cast(runs_.size())), XForRun(*live_run_)}); } + // The whole dataset spans this many images (the largest run, i.e. the original file), so the + // x-axis is fixed to it and subset runs appear at their real position. + int64_t full_range = dataset->experiment.GetImageNum(); + for (const auto &run: runs_) + if (run.dataset) + full_range = std::max(full_range, run.dataset->experiment.GetImageNum()); + chart_view->loadValues(data, image_number, one_over_d2, dataset.get(), primary_name, - std::move(overlays), primary_color, XForRun(*dataset)); + std::move(overlays), primary_color, XForRun(*dataset), full_range); if (dataset->experiment.GetGridScan()) { stack->setCurrentWidget(grid_scan_image); diff --git a/viewer/charts/JFJochDatasetInfoChartView.cpp b/viewer/charts/JFJochDatasetInfoChartView.cpp index 25e65dde..77806db2 100644 --- a/viewer/charts/JFJochDatasetInfoChartView.cpp +++ b/viewer/charts/JFJochDatasetInfoChartView.cpp @@ -132,11 +132,12 @@ void JFJochDatasetInfoChartView::resetZoom() { void JFJochDatasetInfoChartView::loadValues(const std::vector &input, int64_t image, bool one_over_d2, const JFJochReaderDataset *dataset, const QString &primaryName, std::vector overlays, const QColor &primaryColor, - std::vector primaryX) { + std::vector primaryX, int64_t fullRange) { m_yOneOverD = one_over_d2; primaryName_ = primaryName; primary_color_ = primaryColor; primary_x_ = std::move(primaryX); + full_range_ = fullRange; // d -> 1/d^2 for resolution plots; identity otherwise. Applied to every series alike. auto transform = [one_over_d2](const std::vector &in, std::vector &out) { @@ -301,6 +302,9 @@ void JFJochDatasetInfoChartView::buildTimeDomainChart() { // ----- X axis handling ----- QValueAxis *axisX = qobject_cast(chart()->axisX(series)); if (axisX) { + // Always span the whole dataset so a subset run shows at its real position, not stretched. + if (full_range_ > 1) + axisX->setRange(0, static_cast(full_range_ - 1)); if (goniometer_axis.has_value() && m_xUseGoniometerAxis) { // Hide labels on numeric axis and move it to the top diff --git a/viewer/charts/JFJochDatasetInfoChartView.h b/viewer/charts/JFJochDatasetInfoChartView.h index ce3f6bca..98352e66 100644 --- a/viewer/charts/JFJochDatasetInfoChartView.h +++ b/viewer/charts/JFJochDatasetInfoChartView.h @@ -54,6 +54,7 @@ private: std::vector overlays_; QColor primary_color_; // colour of the active (primary) run, if assigned std::vector primary_x_; // x (image numbers) for the primary series; empty => index + int64_t full_range_ = 0; // total images in the dataset; fixes the x-axis to [0, n) // Append (binned) finite points of vals to s at x positions (xs empty => index), extending [mn,mx]. void appendSeries(QLineSeries *s, const std::vector &vals, const std::vector &xs, double &mn, double &mx) const; @@ -99,7 +100,8 @@ public: const QString &primaryName = QString(), std::vector overlays = {}, const QColor &primaryColor = QColor(), - std::vector primaryX = {}); + std::vector primaryX = {}, + int64_t fullRange = 0); }; diff --git a/viewer/jfjoch_viewer.cpp b/viewer/jfjoch_viewer.cpp index 863a3e48..6b2cb111 100644 --- a/viewer/jfjoch_viewer.cpp +++ b/viewer/jfjoch_viewer.cpp @@ -29,6 +29,9 @@ int main(int argc, char *argv[]) { pal.setColor(QPalette::Highlight, QColor(0x2a, 0x9d, 0x8f)); pal.setColor(QPalette::HighlightedText, Qt::white); app.setPalette(pal); + // Fusion fills QGroupBox interiors with a flat light colour; make them transparent so they show + // the salmon window background like the rest of the UI (entry widgets stay white via the palette). + app.setStyleSheet("QGroupBox { background-color: transparent; }"); QIcon appIcon(":/jfjoch.png"); app.setWindowIcon(appIcon);