From e3ede85efd2496f62c688a0f15edd8a653f4db02 Mon Sep 17 00:00:00 2001 From: Shane Ringrose Date: Sat, 13 Jun 2026 18:05:26 +1200 Subject: [PATCH] conductor dock: scrollable/narrowable + View-menu enable toggle (#500) --- sources/factory/propertieseditorfactory.cpp | 8 ++++++++ sources/qetdiagrameditor.cpp | 17 +++++++++++++++++ sources/ui/conductorpropertieseditorwidget.cpp | 13 ++++++++++++- 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/sources/factory/propertieseditorfactory.cpp b/sources/factory/propertieseditorfactory.cpp index f53ec4b1e..f08935423 100644 --- a/sources/factory/propertieseditorfactory.cpp +++ b/sources/factory/propertieseditorfactory.cpp @@ -37,6 +37,7 @@ #include "../ui/shapegraphicsitempropertieswidget.h" #include +#include /** @brief PropertiesEditorFactory::propertiesEditor @@ -104,6 +105,13 @@ PropertiesEditorWidget *PropertiesEditorFactory::propertiesEditor( { case Conductor::Type: //1001 { + //Feature toggle (#500): when disabled in the View menu, selecting a + //conductor brings up nothing in the dock. Default enabled. + if (!QSettings().value( + QStringLiteral("diagrameditor/conductor_properties_panel"), + true).toBool()) { + return nullptr; + } //Prototype (#500): single-conductor editing in the dock. if (count_ > 1) { return nullptr; diff --git a/sources/qetdiagrameditor.cpp b/sources/qetdiagrameditor.cpp index 2b1d9607c..c38acd2fa 100644 --- a/sources/qetdiagrameditor.cpp +++ b/sources/qetdiagrameditor.cpp @@ -879,6 +879,23 @@ void QETDiagramEditor::setUpMenu() menu_affichage -> addSeparator(); menu_affichage -> addAction(m_draw_grid); menu_affichage -> addAction(m_grey_background); + + // Toggle: show a selected conductor's properties in the selection-properties + // dock (#500). When off, selecting a conductor brings up nothing there. + QAction *cond_panel = menu_affichage -> addAction(tr("Propriétés du conducteur dans le panneau")); + cond_panel -> setCheckable(true); + cond_panel -> setStatusTip(tr("Affiche ou non les propriétés d'un conducteur sélectionné dans le panneau de sélection")); + { + QSettings settings; + cond_panel -> setChecked(settings.value(QStringLiteral("diagrameditor/conductor_properties_panel"), true).toBool()); + } + connect(cond_panel, &QAction::toggled, this, [this](bool on) { + QSettings().setValue(QStringLiteral("diagrameditor/conductor_properties_panel"), on); + // Apply immediately to the current selection. + if (DiagramView *dv = currentDiagramView()) + m_selection_properties_editor -> setDiagram(dv -> diagram()); + }); + menu_affichage -> addSeparator(); menu_affichage -> addActions(m_zoom_actions_group.actions()); diff --git a/sources/ui/conductorpropertieseditorwidget.cpp b/sources/ui/conductorpropertieseditorwidget.cpp index 33a73077d..e79450c71 100644 --- a/sources/ui/conductorpropertieseditorwidget.cpp +++ b/sources/ui/conductorpropertieseditorwidget.cpp @@ -22,6 +22,7 @@ #include "../qetgraphicsitem/conductor.h" #include "conductorpropertieswidget.h" +#include #include /** @@ -34,9 +35,19 @@ ConductorPropertiesEditorWidget::ConductorPropertiesEditorWidget( PropertiesEditorWidget(parent), m_cpw(new ConductorPropertiesWidget(this)) { + // The conductor widget is dialog-sized (min width ~600px), far too wide for + // a dock. Host it in a scroll area with a small minimum width so the dock + // can be dragged to any width (a scrollbar appears when narrower than the + // content). QET already persists dock geometry across restarts via + // QETDiagramEditor save/restoreState, so the chosen width is remembered. + auto *scroll = new QScrollArea(this); + scroll->setWidgetResizable(true); + scroll->setFrameShape(QFrame::NoFrame); + scroll->setWidget(m_cpw); auto *layout = new QVBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); - layout->addWidget(m_cpw); + layout->addWidget(scroll); + setMinimumWidth(120); setDisabled(true); setConductor(conductor); }