viewer: chart top margin + settings dock width bounds

- The chart top margin was too tight (2 px), so the highest Y-axis label
  overlapped the top edge; give it 10 px of room (both chart views).
- The settings dock had no width constraints (unlike the inspector), so it
  stretched ugly when widened and would not fold back narrowly. Cap it to
  330–480 px like the inspector.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-23 16:26:15 +02:00
co-authored by Claude Opus 4.8
parent 6ead87fcce
commit 9ba8096c0b
3 changed files with 6 additions and 2 deletions
+4
View File
@@ -501,6 +501,10 @@ JFJochViewerWindow::JFJochViewerWindow(QWidget *parent, bool dbus, const QString
settingsScroll->setWidgetResizable(true);
settingsScroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
settingsScroll->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
// Constrain the width like the inspector, so it neither stretches ugly when widened nor
// refuses to fold back narrow.
settingsScroll->setMinimumWidth(330);
settingsScroll->setMaximumWidth(480);
settingsDock = new QDockWidget("Settings", this);
settingsDock->setObjectName("settingsDock");
settingsDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+1 -1
View File
@@ -16,7 +16,7 @@ JFJochDatasetInfoChartView::JFJochDatasetInfoChartView(QWidget *parent)
// Reclaim Qt Charts' outer layout padding and trim the inner margins so the axis labels keep
// their room even when the dock is short (otherwise they are the first thing Qt drops).
chart()->layout()->setContentsMargins(0, 0, 0, 0);
chart()->setMargins(QMargins(2, 2, 6, 2));
chart()->setMargins(QMargins(2, 10, 8, 2)); // top room so the highest Y label is not clipped
chart()->setBackgroundRoundness(0);
setRenderHint(QPainter::Antialiasing);
// setRubberBand(QChartView::RubberBand::RectangleRubberBand);
+1 -1
View File
@@ -14,7 +14,7 @@ JFJochSimpleChartView::JFJochSimpleChartView(QWidget *parent)
: QChartView(new QChart(), parent) {
chart()->legend()->hide();
chart()->layout()->setContentsMargins(0, 0, 0, 0); // reclaim padding for the plot + labels
chart()->setMargins(QMargins(2, 2, 6, 2));
chart()->setMargins(QMargins(2, 10, 8, 2)); // top room so the highest Y label is not clipped
setMinimumHeight(140); // soft floor: enough for the axis labels to stay readable
setRenderHint(QPainter::Antialiasing);
setMouseTracking(true);