Files
Jungfraujoch/viewer/JFJochViewerWindow.h
T
leonarski_fandClaude Opus 4.8 67ad43a2b2 viewer: palette theming, Original as a run row, stable plot colours
Styling (now via the application palette in main(), not a stylesheet, so it
applies to every widget incl. dialogs):
- Entry fields and item views (line edits, spin boxes, combos, tables) are white
  when enabled and salmon (the GUI default) when disabled - so it's clear where
  you can type. Panels stay salmon (Window role).
- Teal (#2a9d8f) accent via the Highlight role: selections and progress-bar chunks.

Runs list / plots:
- The original file is listed as a first "Original" run (Mode "HDF5"); double-click
  any run row to show it (replaces the "Show original" button). The currently shown
  run is bold (driven by snapshotsChanged).
- Fix the colour "swap" when switching runs: the primary line is matched by the
  active-dataset pointer (not active_id_), so a run keeps its colour even while a
  datasetLoaded/runsChanged pair is mid-flight.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 15:34:06 +02:00

61 lines
2.2 KiB
C++

// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <QMainWindow>
#include <QProgressDialog>
#include "JFJochViewerMenu.h"
#include "../reader/JFJochHDF5Reader.h"
#include "JFJochImageReadingWorker.h"
#include "JFJochViewerDatasetInfo.h"
#include "JFJochViewerStatusBar.h"
#include "toolbar/JFJochViewerToolbarDisplay.h"
class JFJochProcessingJobsWindow;
class QDockWidget;
class JFJochViewerWindow : public QMainWindow {
Q_OBJECT
// Theming is done via the application palette in main() (salmon panels, white entry fields,
// teal accent) so it applies consistently to every widget, including dialogs.
public:
explicit JFJochViewerWindow(QWidget *parent = nullptr, bool dbus = true, const QString &file = "");
~JFJochViewerWindow() override;
private:
JFJochViewerMenu *menuBar;
JFJochImageReadingWorker *reading_worker;
JFJochViewerToolbarDisplay *toolBarDisplay;
JFJochViewerStatusBar *statusbar;
JFJochProcessingJobsWindow *processingJobsWindow;
std::shared_ptr<const JFJochReaderDataset> lastDataset; // added
std::shared_ptr<const JFJochReaderImage> lastImage; // added
QVector<RunData> lastRuns; // for dataset-info docks opened later
QString lastActiveRunId;
QProgressDialog *retryDialog = nullptr;
QDockWidget *lastDatasetInfoDock = nullptr; // most recent dataset-info dock, for docking layout
QThread *reading_thread;
void keyPressEvent(QKeyEvent *event) override;
void keyReleaseEvent(QKeyEvent *event) override;
public slots:
void LoadFile(const QString &filename, qint64 image_number, qint64 summation, bool retry);
void LoadImage(qint64 image_number, qint64 summation);
void NewDatasetInfo();
void OnFileLoadError(QString title, QString message);
void OnFileLoadRetryStatus(bool active, QString message);
signals:
void LoadFileRequest(const QString &filename, qint64 image_number, qint64 summation, bool retry);
void LoadImageRequest(int64_t image_number, int64_t summation);
void adjustForegroundButton(bool input);
void setAutoForeground(bool val);
};