From 03a09c43bc70d9808bd4a1b3bd8416cfdaf2a0ba Mon Sep 17 00:00:00 2001 From: leonarski_f Date: Mon, 22 Jun 2026 15:10:36 +0200 Subject: [PATCH] viewer: white-when-active inputs, teal accent, Status column visible Styling: - Entry widgets (line edits, spin boxes, combos, item views) are salmon (the GUI default) when inactive and turn white while focused/active. - A teal accent (#2a9d8f) for selections and the QProgressBar chunk, against the salmon background. - Move the jobs-table Status column (the progress bar) to column 2 so it stays visible in the narrow dock instead of scrolling off the right edge. Co-Authored-By: Claude Opus 4.8 --- viewer/JFJochViewerWindow.h | 26 ++++++++++++++++++- viewer/windows/JFJochProcessingJobsWindow.cpp | 5 ++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/viewer/JFJochViewerWindow.h b/viewer/JFJochViewerWindow.h index c1ce10e5..56537bca 100644 --- a/viewer/JFJochViewerWindow.h +++ b/viewer/JFJochViewerWindow.h @@ -18,7 +18,31 @@ class QDockWidget; class JFJochViewerWindow : public QMainWindow { Q_OBJECT - const QString stylesheet = "background-color: rgb(255, 235, 230);"; + // Salmon (GUI default) everywhere; entry widgets (line edits, spin boxes, combos, tables) turn + // white while focused/active. A teal accent (selection + progress chunks) adds some colour. + const QString stylesheet = R"( + background-color: rgb(255, 235, 230); + + QLineEdit, QPlainTextEdit, QTextEdit, QAbstractSpinBox, QComboBox, QAbstractItemView { + background-color: rgb(255, 235, 230); + selection-background-color: #2a9d8f; + selection-color: white; + } + QLineEdit:focus, QPlainTextEdit:focus, QTextEdit:focus, QAbstractSpinBox:focus, + QComboBox:focus, QAbstractItemView:focus { + background-color: white; + } + QProgressBar { + border: 1px solid #d9b3aa; + border-radius: 3px; + background-color: rgb(255, 235, 230); + text-align: center; + } + QProgressBar::chunk { + background-color: #2a9d8f; + border-radius: 2px; + } + )"; public: explicit JFJochViewerWindow(QWidget *parent = nullptr, bool dbus = true, const QString &file = ""); ~JFJochViewerWindow() override; diff --git a/viewer/windows/JFJochProcessingJobsWindow.cpp b/viewer/windows/JFJochProcessingJobsWindow.cpp index 9fc985ff..d955f837 100644 --- a/viewer/windows/JFJochProcessingJobsWindow.cpp +++ b/viewer/windows/JFJochProcessingJobsWindow.cpp @@ -28,7 +28,8 @@ #include namespace { - enum Column { COL_NAME = 0, COL_STARTED, COL_MODE, COL_IMAGES, COL_STATUS, COL_INDEX, COL_CELL, COL_COUNT }; + // Status (the progress bar) is column 2 so it stays visible in the narrow dock. + enum Column { COL_NAME = 0, COL_STATUS, COL_STARTED, COL_MODE, COL_IMAGES, COL_INDEX, COL_CELL, COL_COUNT }; int default_threads() { const unsigned hc = std::thread::hardware_concurrency(); @@ -58,7 +59,7 @@ JFJochProcessingJobsWindow::JFJochProcessingJobsWindow(JFJochImageReadingWorker table_ = new QTableWidget(0, COL_COUNT, this); table_->setMinimumHeight(60); // let the bottom dock shrink freely - table_->setHorizontalHeaderLabels({"Name", "Started", "Mode", "Images", "Status", "Index %", "Unit cell"}); + table_->setHorizontalHeaderLabels({"Name", "Status", "Started", "Mode", "Images", "Index %", "Unit cell"}); table_->horizontalHeader()->setStretchLastSection(true); table_->setSelectionBehavior(QAbstractItemView::SelectRows); table_->setSelectionMode(QAbstractItemView::SingleSelection);