|
37 | 37 | #include "qgspanelwidget.h" |
38 | 38 | #include "qgsdockwidget.h" |
39 | 39 | #include "qgslayoutpagepropertieswidget.h" |
| 40 | +#include "qgslayoutguidewidget.h" |
40 | 41 | #include <QShortcut> |
41 | 42 | #include <QComboBox> |
42 | 43 | #include <QLineEdit> |
@@ -257,8 +258,20 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla |
257 | 258 | mItemDock->setWidget( mItemPropertiesStack ); |
258 | 259 | mPanelsMenu->addAction( mItemDock->toggleViewAction() ); |
259 | 260 |
|
| 261 | + mGuideDock = new QgsDockWidget( tr( "Guides" ), this ); |
| 262 | + mGuideDock->setObjectName( QStringLiteral( "GuideDock" ) ); |
| 263 | + mGuideDock->setMinimumWidth( minDockWidth ); |
| 264 | + mGuideStack = new QgsPanelWidgetStack(); |
| 265 | + mGuideDock->setWidget( mGuideStack ); |
| 266 | + mPanelsMenu->addAction( mGuideDock->toggleViewAction() ); |
| 267 | + connect( mActionManageGuides, &QAction::triggered, this, [ = ] |
| 268 | + { |
| 269 | + mGuideDock->setUserVisible( true ); |
| 270 | + } ); |
| 271 | + |
260 | 272 | addDockWidget( Qt::RightDockWidgetArea, mItemDock ); |
261 | 273 | addDockWidget( Qt::RightDockWidgetArea, mGeneralDock ); |
| 274 | + addDockWidget( Qt::RightDockWidgetArea, mGuideDock ); |
262 | 275 |
|
263 | 276 | createLayoutPropertiesWidget(); |
264 | 277 |
|
@@ -317,6 +330,7 @@ void QgsLayoutDesignerDialog::showItemOptions( QgsLayoutItem *item ) |
317 | 330 | delete mItemPropertiesStack->takeMainPanel(); |
318 | 331 | widget->setDockMode( true ); |
319 | 332 | mItemPropertiesStack->setMainPanel( widget.release() ); |
| 333 | + mItemDock->setUserVisible( true ); |
320 | 334 | } |
321 | 335 |
|
322 | 336 | void QgsLayoutDesignerDialog::open() |
@@ -615,13 +629,19 @@ void QgsLayoutDesignerDialog::createLayoutPropertiesWidget() |
615 | 629 | return; |
616 | 630 | } |
617 | 631 |
|
618 | | - // update composition widget |
| 632 | + // update layout based widgets |
619 | 633 | QgsLayoutPropertiesWidget *oldCompositionWidget = qobject_cast<QgsLayoutPropertiesWidget *>( mGeneralPropertiesStack->takeMainPanel() ); |
620 | 634 | delete oldCompositionWidget; |
| 635 | + QgsLayoutGuideWidget *oldGuideWidget = qobject_cast<QgsLayoutGuideWidget *>( mGuideStack->takeMainPanel() ); |
| 636 | + delete oldGuideWidget; |
621 | 637 |
|
622 | 638 | QgsLayoutPropertiesWidget *widget = new QgsLayoutPropertiesWidget( mGeneralDock, mLayout ); |
623 | 639 | widget->setDockMode( true ); |
624 | 640 | mGeneralPropertiesStack->setMainPanel( widget ); |
| 641 | + |
| 642 | + QgsLayoutGuideWidget *guideWidget = new QgsLayoutGuideWidget( mGuideDock, mLayout, mView ); |
| 643 | + guideWidget->setDockMode( true ); |
| 644 | + mGuideStack->setMainPanel( guideWidget ); |
625 | 645 | } |
626 | 646 |
|
627 | 647 | void QgsLayoutDesignerDialog::initializeRegistry() |
|
0 commit comments