Skip to content

Commit 4e6a072

Browse files
committedJan 5, 2018
Make report/atlas settings actions checkable, so they can also hide the panels
1 parent a4f854e commit 4e6a072

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed
 

‎src/app/layout/qgslayoutdesignerdialog.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,9 +659,11 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
659659

660660
mAtlasDock = new QgsDockWidget( tr( "Atlas" ), this );
661661
mAtlasDock->setObjectName( QStringLiteral( "AtlasDock" ) );
662+
connect( mAtlasDock, &QDockWidget::visibilityChanged, mActionAtlasSettings, &QAction::setChecked );
662663

663664
mReportDock = new QgsDockWidget( tr( "Report" ), this );
664665
mReportDock->setObjectName( QStringLiteral( "ReportDock" ) );
666+
connect( mReportDock, &QDockWidget::visibilityChanged, mActionReportSettings, &QAction::setChecked );
665667

666668
const QList<QDockWidget *> docks = findChildren<QDockWidget *>();
667669
for ( QDockWidget *dock : docks )
@@ -1992,12 +1994,12 @@ void QgsLayoutDesignerDialog::exportToSvg()
19921994
QApplication::restoreOverrideCursor();
19931995
}
19941996

1995-
void QgsLayoutDesignerDialog::showAtlasSettings()
1997+
void QgsLayoutDesignerDialog::showAtlasSettings( bool checked )
19961998
{
19971999
if ( !mAtlasDock )
19982000
return;
19992001

2000-
mAtlasDock->setUserVisible( true );
2002+
mAtlasDock->setUserVisible( checked );
20012003
}
20022004

20032005
void QgsLayoutDesignerDialog::atlasPreviewTriggered( bool checked )
@@ -3274,12 +3276,12 @@ void QgsLayoutDesignerDialog::printReport()
32743276
QApplication::restoreOverrideCursor();
32753277
}
32763278

3277-
void QgsLayoutDesignerDialog::showReportSettings()
3279+
void QgsLayoutDesignerDialog::showReportSettings( bool checked )
32783280
{
32793281
if ( !mReportDock )
32803282
return;
32813283

3282-
mReportDock->setUserVisible( true );
3284+
mReportDock->setUserVisible( checked );
32833285
}
32843286

32853287
void QgsLayoutDesignerDialog::pageSetup()

‎src/app/layout/qgslayoutdesignerdialog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
309309
void exportToRaster();
310310
void exportToPdf();
311311
void exportToSvg();
312-
void showAtlasSettings();
312+
void showAtlasSettings( bool checked );
313313
void atlasPreviewTriggered( bool checked );
314314
void atlasPageComboEditingFinished();
315315
void atlasNext();
@@ -325,7 +325,7 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
325325
void exportReportToSvg();
326326
void exportReportToPdf();
327327
void printReport();
328-
void showReportSettings();
328+
void showReportSettings( bool checked );
329329

330330
void pageSetup();
331331

‎src/ui/layout/qgslayoutdesignerbase.ui

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
<x>0</x>
100100
<y>0</y>
101101
<width>2180</width>
102-
<height>42</height>
102+
<height>25</height>
103103
</rect>
104104
</property>
105105
<widget class="QMenu" name="mLayoutMenu">
@@ -1369,6 +1369,9 @@
13691369
</property>
13701370
</action>
13711371
<action name="mActionAtlasSettings">
1372+
<property name="checkable">
1373+
<bool>true</bool>
1374+
</property>
13721375
<property name="icon">
13731376
<iconset resource="../../../images/images.qrc">
13741377
<normaloff>:/images/themes/default/mActionAtlasSettings.svg</normaloff>:/images/themes/default/mActionAtlasSettings.svg</iconset>
@@ -1429,6 +1432,9 @@
14291432
</property>
14301433
</action>
14311434
<action name="mActionReportSettings">
1435+
<property name="checkable">
1436+
<bool>true</bool>
1437+
</property>
14321438
<property name="icon">
14331439
<iconset resource="../../../images/images.qrc">
14341440
<normaloff>:/images/themes/default/mActionAtlasSettings.svg</normaloff>:/images/themes/default/mActionAtlasSettings.svg</iconset>
@@ -1510,6 +1516,7 @@
15101516
<include location="../../../images/images.qrc"/>
15111517
<include location="../../../images/images.qrc"/>
15121518
<include location="../../../images/images.qrc"/>
1519+
<include location="../../../images/images.qrc"/>
15131520
</resources>
15141521
<connections/>
15151522
</ui>

0 commit comments

Comments
 (0)
Please sign in to comment.