From e3bd1a3529a74ae3153239da22aae03265bbcff4 Mon Sep 17 00:00:00 2001 From: leonarski_f Date: Tue, 23 Jun 2026 16:21:03 +0200 Subject: [PATCH] viewer: settings fields fill the panel width (form growth policy) The settings content stopped resizing past ~360 px, leaving dead space when the dock was widened. Cause: QFormLayout's default field growth policy keeps fields at their size hint. Set AllNonFixedFieldsGrow on all five forms (geometry, unit cell, spot finding, indexing, azint) so the fields grow to fill the dock width. Co-Authored-By: Claude Opus 4.8 --- viewer/widgets/JFJochViewerSettingsDock.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/viewer/widgets/JFJochViewerSettingsDock.cpp b/viewer/widgets/JFJochViewerSettingsDock.cpp index f130c717..7cf819aa 100644 --- a/viewer/widgets/JFJochViewerSettingsDock.cpp +++ b/viewer/widgets/JFJochViewerSettingsDock.cpp @@ -62,6 +62,7 @@ JFJochViewerSettingsDock::JFJochViewerSettingsDock(const SpotFindingSettings &sp QWidget *JFJochViewerSettingsDock::BuildGeometrySection() { auto *section = new CollapsibleSection("Geometry", this); auto *geom = new QFormLayout(); + geom->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); // fields fill the panel width energy_ = new NumberLineEdit(1.0, 200.0, 12.4, 4, "keV", this); distance_ = new NumberLineEdit(10.0, 5000.0, 100.0, 2, "mm", this); @@ -108,6 +109,7 @@ QWidget *JFJochViewerSettingsDock::BuildMXPage() { // --- Unit cell + space group (new: no input existed before) --- auto *cellSection = new CollapsibleSection("Unit cell", page); auto *cell = new QFormLayout(); + cell->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); cellKnown_ = new QCheckBox("Known unit cell", page); cell->addRow("", cellKnown_); cellA_ = new NumberLineEdit(1.0, 2000.0, 79.0, 3, "Å", page); @@ -153,6 +155,7 @@ QWidget *JFJochViewerSettingsDock::BuildMXPage() { // --- Spot finding --- auto *spotSection = new CollapsibleSection("Spot finding", page); auto *spot = new QFormLayout(); + spot->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); auto *snr = new SliderPlusBox(1.0, 10.0, 0.1, 1, page); snr->setValue(spot_.signal_to_noise_threshold); auto *count = new SliderPlusBox(0.0, 100.0, 1.0, 0, page); @@ -174,6 +177,7 @@ QWidget *JFJochViewerSettingsDock::BuildMXPage() { // --- Indexing --- auto *idxSection = new CollapsibleSection("Indexing", page); auto *idx = new QFormLayout(); + idx->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); auto *algo = new QComboBox(page); algo->addItem("Auto", static_cast(IndexingAlgorithmEnum::Auto)); algo->addItem("FFBIDX (GPU, known cell)", static_cast(IndexingAlgorithmEnum::FFBIDX)); @@ -211,6 +215,7 @@ QWidget *JFJochViewerSettingsDock::BuildAzIntPage() { auto *azSection = new CollapsibleSection("Azimuthal integration", page); auto *az = new QFormLayout(); + az->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); auto *lowQ = new SliderPlusBox(1e-5, 10.0, 0.001, 4, page); lowQ->setValue(azint_.GetLowQ_recipA()); auto *highQ = new SliderPlusBox(2e-5, 10.0, 0.001, 4, page);