From 659feb468c59da5fbd031a3c07ea51f9522aec42 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 18 Jan 2026 22:12:47 +0100 Subject: [PATCH] Fixing a small glitch when notifications and toolbox widgets interact --- src/layview/layview/layLayoutView_qt.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/layview/layview/layLayoutView_qt.cc b/src/layview/layview/layLayoutView_qt.cc index 894da7c33..45f590f2e 100644 --- a/src/layview/layview/layLayoutView_qt.cc +++ b/src/layview/layview/layLayoutView_qt.cc @@ -194,8 +194,22 @@ LayoutViewWidget::~LayoutViewWidget () void LayoutViewWidget::add_toolbox_widget (lay::EditorOptionsPageWidget *toolbox_widget) { - toolbox_widget->setParent (this); - mp_layout->insertWidget (0, toolbox_widget); + if (toolbox_widget->parent () != this) { + + toolbox_widget->setParent (this); + + // insert after the last notification widget + int index = 0; + for (int i = 0; i < mp_layout->count (); ++i) { + QLayoutItem *item = mp_layout->itemAt (i); + if (dynamic_cast (item)) { + index = i + 1; + } + } + + mp_layout->insertWidget (index, toolbox_widget); + + } } void